Decompiled source of RealityShifter v1.0.3

Shifter.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using EntityStates;
using EntityStates.Merc;
using HG.Reflection;
using KinematicCharacterController;
using On.RoR2;
using R2API;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Achievements;
using RoR2.Audio;
using RoR2.CharacterAI;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.UI;

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

public static class Achievements
{
	[RegisterAchievement("SHIFTER_BOSSKILL", "ACHIEVEMENT_SHIFTER_BOSSKILL_UNLOCKABLE_ID", "BossKill", typeof(BossKillServerAchievement))]
	public class BossKillUnlockable : BaseAchievement
	{
		private class BossKillServerAchievement : BaseServerAchievement
		{
			private int killCount;

			private BodyIndex requiredVictimBodyIndex;

			public override void OnInstall()
			{
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				((BaseServerAchievement)this).OnInstall();
				requiredVictimBodyIndex = BodyCatalog.FindBodyIndex("BrotherHurtBody");
				GlobalEventManager.onCharacterDeathGlobal += OnCharacterDeathGlobal;
			}

			public override void OnUninstall()
			{
				GlobalEventManager.onCharacterDeathGlobal -= OnCharacterDeathGlobal;
				((BaseServerAchievement)this).OnUninstall();
			}

			private void OnCharacterDeathGlobal(DamageReport damageReport)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				if (damageReport.victimBodyIndex == requiredVictimBodyIndex && (Object)(object)base.serverAchievementTracker.networkUser.master == (Object)(object)damageReport.attackerMaster)
				{
					killCount++;
					Debug.LogWarning((object)("killCount: " + killCount));
					if (requirement <= killCount)
					{
						((BaseServerAchievement)this).Grant();
					}
				}
			}
		}

		private static readonly int requirement = 10;

		public override BodyIndex LookUpRequiredBodyIndex()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return BodyCatalog.FindBodyIndex("ShifterBody");
		}

		public override void OnBodyRequirementMet()
		{
			((BaseAchievement)this).OnBodyRequirementMet();
			((BaseAchievement)this).SetServerTracked(true);
		}

		public override void OnBodyRequirementBroken()
		{
			((BaseAchievement)this).SetServerTracked(false);
			((BaseAchievement)this).OnBodyRequirementBroken();
		}
	}

	[RegisterAchievement("SHIFTER_BILLIONDMG", "ACHIEVEMENT_SHIFTER_BILLIONDMG_UNLOCKABLE_ID", null, null)]
	public class BillionDamageUnlockable : BaseAchievement
	{
		private static readonly float damageRequirement = 1E+09f;

		private float currentDamageDealt;

		public override BodyIndex LookUpRequiredBodyIndex()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return BodyCatalog.FindBodyIndex("ShifterBody");
		}

		public override void OnBodyRequirementMet()
		{
			GlobalEventManager.onClientDamageNotified += onClientDamageNotified;
		}

		public override void OnBodyRequirementBroken()
		{
			GlobalEventManager.onClientDamageNotified -= onClientDamageNotified;
		}

		private void onClientDamageNotified(DamageDealtMessage message)
		{
			if ((Object)(object)message.attacker == (Object)(object)((BaseAchievement)this).localUser.cachedBodyObject)
			{
				currentDamageDealt += message.damage;
				Debug.LogWarning((object)("currentDamageDealt: " + currentDamageDealt));
				if (damageRequirement <= currentDamageDealt)
				{
					((BaseAchievement)this).Grant();
				}
			}
		}
	}

	[RegisterAchievement("SHIFTER_ENDING", "ACHIEVEMENT_SHIFTER_ENDING_UNLOCKABLE_ID", null, null)]
	public class EarlyVoidEndingAchievement : BaseAchievement
	{
		private static readonly float timeRequirement = 1500f;

		public override BodyIndex LookUpRequiredBodyIndex()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return BodyCatalog.FindBodyIndex("ShifterBody");
		}

		public override void OnBodyRequirementMet()
		{
			((BaseAchievement)this).OnBodyRequirementMet();
			Run.onClientGameOverGlobal += OnClientGameOverGlobal;
		}

		public override void OnBodyRequirementBroken()
		{
			Run.onClientGameOverGlobal -= OnClientGameOverGlobal;
			((BaseAchievement)this).OnBodyRequirementBroken();
		}

		private void OnClientGameOverGlobal(Run run, RunReport runReport)
		{
			if (Run.instance.GetRunStopwatch() < timeRequirement && (Object)(object)runReport.gameEnding == (Object)(object)GameEndings.VoidEnding && ((BaseAchievement)this).isUserAlive)
			{
				((BaseAchievement)this).Grant();
			}
		}
	}

	[RegisterAchievement("SHIFTER_UNLOCKALL", "ACHIEVEMENT_SHIFTER_UNLOCKALL_UNLOCKABLE_ID", null, null)]
	public class UnlockAllAchievement : BaseAchievement
	{
		public override BodyIndex LookUpRequiredBodyIndex()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return BodyCatalog.FindBodyIndex("ShifterBody");
		}

		public override void OnBodyRequirementMet()
		{
			((BaseAchievement)this).OnBodyRequirementMet();
			RoR2Application.onUpdate += Check;
		}

		public override void OnBodyRequirementBroken()
		{
			RoR2Application.onUpdate -= Check;
			((BaseAchievement)this).OnBodyRequirementBroken();
		}

		private void Check()
		{
			if (((BaseAchievement)this).userProfile.HasUnlockable(bossKillUnlock) && ((BaseAchievement)this).userProfile.HasUnlockable(billionDamageUnlock) && ((BaseAchievement)this).userProfile.HasUnlockable(endingUnlock))
			{
				((BaseAchievement)this).Grant();
			}
		}
	}

	internal static UnlockableDef bossKillUnlock;

	internal static UnlockableDef billionDamageUnlock;

	internal static UnlockableDef endingUnlock;

	internal static UnlockableDef unlockAll;

	public static void RegisterUnlockables()
	{
		bossKillUnlock = NewUnlockable<BossKillUnlockable>("BOSSKILL", Prefabs.Load<SkillDef>("RoR2/DLC1/VoidSurvivor/FireCorruptBeam.asset").icon, "SHIFTER: Carnage", "As Reality Shifter, kill Mithrix 10 times in a single run.");
		billionDamageUnlock = NewUnlockable<BillionDamageUnlockable>("BILLIONDMG", Assets.MainAssetBundle.LoadAsset<Sprite>("texVoidSurvivorSkillIcons_8"), "SHIFTER: Savagery", "As Reality Shifter, deal 1,000,000,000 damage in a single run.");
		endingUnlock = NewUnlockable<EarlyVoidEndingAchievement>("ENDING", Assets.MainAssetBundle.LoadAsset<Sprite>("texVoidSurvivorSkillIcons_2"), "SHIFTER: Void Deep", "As Reality Shifter, escape the Planetarium before the timer hits 25 minutes.");
		unlockAll = NewUnlockable<UnlockAllAchievement>("UNLOCKALL", Assets.MainAssetBundle.LoadAsset<Sprite>("texVoidSurvivorSkillIcons_3"), "SHIFTER: Completionist", "Unlock all other skills.");
	}

	private static UnlockableDef NewUnlockable<T>(string AchievementIdentifier, Sprite Icon, string Title, string Description) where T : BaseAchievement
	{
		string text = "ACHIEVEMENT_SHIFTER_";
		UnlockableDef val = ScriptableObject.CreateInstance<UnlockableDef>();
		string langName = text + AchievementIdentifier + "_NAME";
		string langDesc = text + AchievementIdentifier + "_DESCRIPTION";
		LanguageAPI.Add(langName, Title);
		LanguageAPI.Add(langDesc, Description);
		Func<string> func = () => Language.GetStringFormatted("UNLOCKED_FORMAT", new object[2]
		{
			Language.GetString(langName),
			Language.GetString(langDesc)
		});
		Type typeFromHandle = typeof(T);
		val.cachedName = text + AchievementIdentifier + "_UNLOCKABLE_ID";
		val.getHowToUnlockString = func;
		val.getUnlockedString = func;
		val.achievementIcon = Icon;
		val.sortScore = 200;
		val.hidden = false;
		ContentAddition.AddUnlockableDef(val);
		return val;
	}
}
internal class Assets
{
	public static AssetBundle MainAssetBundle;

	public static T Load<T>(string name) where T : Object
	{
		return MainAssetBundle.LoadAsset<T>(name);
	}

	public static void PopulateAssets()
	{
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		if ((Object)(object)MainAssetBundle == (Object)null)
		{
			using (Stream stream = executingAssembly.GetManifestResourceStream("Shifter.AssetBundle.shifterassets"))
			{
				MainAssetBundle = AssetBundle.LoadFromStream(stream);
			}
		}
	}
}
internal class DelayedAlpha : MonoBehaviour
{
	public Transform startTransform;

	public HurtBox target;

	public AnimateShaderAlpha alpha;

	public BezierCurveLine curve;

	private Vector3 lastPos;

	private void Update()
	{
		//IL_0042: 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_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)startTransform))
		{
			startTransform = ((Component)this).transform.parent;
			((Component)this).transform.parent = null;
		}
		else
		{
			((Component)this).transform.position = startTransform.position;
		}
		if (Object.op_Implicit((Object)(object)target))
		{
			lastPos = ((Component)target).transform.position;
			if (!((Behaviour)alpha).enabled && !target.healthComponent.alive)
			{
				((Behaviour)alpha).enabled = true;
			}
		}
		else
		{
			((Behaviour)alpha).enabled = true;
		}
		if (!Object.op_Implicit((Object)(object)startTransform))
		{
			((Behaviour)alpha).enabled = true;
		}
		curve.endTransform.position = lastPos;
	}
}
internal class DelayedProjectile : MonoBehaviour
{
	public ProjectileSimple simple;

	public ProjectileDirectionalTargetFinder finder;

	public ProjectileTargetComponent target;

	public ProjectileController controller;

	public GameObject owner;

	public CharacterBody body;

	private float duration = 0.2f;

	private float stopwatch;

	private void Awake()
	{
		simple = ((Component)this).GetComponent<ProjectileSimple>();
		finder = ((Component)this).GetComponent<ProjectileDirectionalTargetFinder>();
		target = ((Component)this).GetComponent<ProjectileTargetComponent>();
		controller = ((Component)this).GetComponent<ProjectileController>();
	}

	private void FixedUpdate()
	{
		if (!Object.op_Implicit((Object)(object)owner))
		{
			owner = controller.owner;
			if (Object.op_Implicit((Object)(object)owner))
			{
				body = owner.GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)body))
				{
					duration /= body.attackSpeed;
				}
				((Component)this).transform.parent = owner.transform;
			}
		}
		stopwatch += Time.fixedDeltaTime;
		if (stopwatch >= duration)
		{
			((Component)this).transform.parent = null;
			target.target = null;
			finder.SearchForTarget();
			((Behaviour)simple).enabled = true;
		}
	}
}
internal class InstaKill : MonoBehaviour
{
}
internal class ShifterBehaviour : NetworkBehaviour
{
	public ShifterStatsHolder statHolder;

	public CharacterBody body;

	public bool pickedItem;

	public bool canceledPick;

	public bool castingOrbs;

	public float[] LRPositions = new float[2] { 0.5f, 1f };

	public float[] UpPositions = new float[3] { 0.1f, 0.35f, 1f };

	private static int kCmdCmdCreatePickup;

	[Command]
	public void CmdCreatePickup(int index)
	{
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: 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_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: 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_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: 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_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)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		if (MainPlugin.giveItem.Value)
		{
			PickupIndex val = Prefabs.allItems[index];
			PickupDef pickupDef = PickupCatalog.GetPickupDef(val);
			ItemDef itemDef = ItemCatalog.GetItemDef(pickupDef.itemIndex);
			if (Object.op_Implicit((Object)(object)itemDef))
			{
				body.inventory.GiveItem(itemDef, 1);
			}
			EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(pickupDef.equipmentIndex);
			if (Object.op_Implicit((Object)(object)equipmentDef))
			{
				body.inventory.GiveEquipmentString(((Object)equipmentDef).name);
			}
		}
		else
		{
			PickupDropletController.CreatePickupDroplet(Prefabs.allItems[index], ((Component)this).transform.position + Vector3.up * 1.5f, Vector3.up * 20f + body.characterDirection.forward * 2f);
		}
	}

	private void Awake()
	{
		body = ((Component)this).GetComponent<CharacterBody>();
	}

	private void Start()
	{
		if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.masterObject))
		{
			statHolder = body.masterObject.GetComponent<ShifterStatsHolder>();
			if (!Object.op_Implicit((Object)(object)statHolder))
			{
				statHolder = body.masterObject.AddComponent<ShifterStatsHolder>();
			}
		}
	}

	private void UNetVersion()
	{
	}

	protected static void InvokeCmdCmdCreatePickup(NetworkBehaviour obj, NetworkReader reader)
	{
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"Command CmdCreatePickup called on client.");
		}
		else
		{
			((ShifterBehaviour)(object)obj).CmdCreatePickup((int)reader.ReadPackedUInt32());
		}
	}

	public void CallCmdCreatePickup(int index)
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"Command function CmdCreatePickup called on server.");
			return;
		}
		if (((NetworkBehaviour)this).isServer)
		{
			CmdCreatePickup(index);
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)5);
		val.WritePackedUInt32((uint)kCmdCmdCreatePickup);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		val.WritePackedUInt32((uint)index);
		((NetworkBehaviour)this).SendCommandInternal(val, 0, "CmdCreatePickup");
	}

	static ShifterBehaviour()
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Expected O, but got Unknown
		kCmdCmdCreatePickup = -58455578;
		NetworkBehaviour.RegisterCommandDelegate(typeof(ShifterBehaviour), kCmdCmdCreatePickup, new CmdDelegate(InvokeCmdCmdCreatePickup));
		NetworkCRC.RegisterBehaviour("ShifterBehaviour", 0);
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		bool result = default(bool);
		return result;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
	}
}
internal class ShifterPanelBehaviour : MonoBehaviour
{
	public ShifterBehaviour behaviour;

	public GridLayoutGroup gridlayoutGroup;

	public RectTransform buttonContainer;

	public GameObject buttonPrefab;

	public Image[] coloredImages;

	public Image[] darkColoredImages;

	public int maxColumnCount = 6;

	public MPButton cancelButton;

	private UIElementAllocator<MPButton> buttonAllocator;

	private void Awake()
	{
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Expected O, but got Unknown
		buttonAllocator = new UIElementAllocator<MPButton>(buttonContainer, buttonPrefab, true, false);
		buttonAllocator.onCreateElement = OnCreateButton;
		((UnityEvent)((Button)cancelButton).onClick).AddListener((UnityAction)delegate
		{
			if (Object.op_Implicit((Object)(object)behaviour))
			{
				behaviour.canceledPick = true;
				GenericSkill special = ((Component)behaviour).GetComponent<SkillLocator>().special;
				special.RunRecharge(special.skillDef.baseRechargeInterval);
			}
		});
	}

	private void OnEnable()
	{
		if (RoR2Application.isInSinglePlayer)
		{
			Time.timeScale = 0f;
		}
	}

	private void OnDisable()
	{
		if (RoR2Application.isInSinglePlayer)
		{
			Time.timeScale = 1f;
		}
	}

	private void OnCreateButton(int index, MPButton button)
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Expected O, but got Unknown
		((UnityEvent)((Button)button).onClick).AddListener((UnityAction)delegate
		{
			behaviour.pickedItem = true;
			behaviour.CallCmdCreatePickup(index);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		});
	}

	public void SetPickupOptions(Option[] options)
	{
		//IL_0039: 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_004d: 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_005a: 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_00f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0232: Unknown result type (might be due to invalid IL or missing references)
		//IL_0202: Unknown result type (might be due to invalid IL or missing references)
		//IL_0252: Unknown result type (might be due to invalid IL or missing references)
		//IL_0260: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0306: Unknown result type (might be due to invalid IL or missing references)
		//IL_030b: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
		buttonAllocator.AllocateElements(options.Length);
		ReadOnlyCollection<MPButton> elements = buttonAllocator.elements;
		Sprite texUnlockIcon = Prefabs.texUnlockIcon;
		if (options.Length != 0)
		{
			PickupDef pickupDef = PickupCatalog.GetPickupDef(options[0].pickupIndex);
			Color baseColor = pickupDef.baseColor;
			Color darkColor = pickupDef.darkColor;
			EnumerableExtensions.ForEachTry<Image>((IEnumerable<Image>)coloredImages, (Action<Image>)delegate(Image x)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				((Graphic)x).color = ((Graphic)x).color * baseColor;
			}, (IDictionary<Image, Exception>)null);
			EnumerableExtensions.ForEachTry<Image>((IEnumerable<Image>)darkColoredImages, (Action<Image>)delegate(Image x)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				((Graphic)x).color = ((Graphic)x).color * darkColor;
			}, (IDictionary<Image, Exception>)null);
		}
		for (int i = 0; i < options.Length; i++)
		{
			PickupDef pickupDef2 = PickupCatalog.GetPickupDef(options[i].pickupIndex);
			MPButton val = elements[i];
			int num = i - i % maxColumnCount;
			int num2 = i % maxColumnCount;
			int num3 = num2 - maxColumnCount;
			int num4 = num2 - 1;
			int num5 = num2 + 1;
			int num6 = num2 + maxColumnCount;
			Navigation navigation = ((Selectable)val).navigation;
			((Navigation)(ref navigation)).mode = (Mode)4;
			if (num4 >= 0)
			{
				MPButton selectOnLeft = elements[num + num4];
				((Navigation)(ref navigation)).selectOnLeft = (Selectable)(object)selectOnLeft;
			}
			if (num5 < maxColumnCount && num + num5 < options.Length)
			{
				MPButton selectOnRight = elements[num + num5];
				((Navigation)(ref navigation)).selectOnRight = (Selectable)(object)selectOnRight;
			}
			if (num + num3 >= 0)
			{
				MPButton selectOnUp = elements[num + num3];
				((Navigation)(ref navigation)).selectOnUp = (Selectable)(object)selectOnUp;
			}
			if (num + num6 < options.Length)
			{
				MPButton selectOnDown = elements[num + num6];
				((Navigation)(ref navigation)).selectOnDown = (Selectable)(object)selectOnDown;
			}
			((Selectable)val).navigation = navigation;
			PickupDef pickupDef3 = PickupCatalog.GetPickupDef(options[i].pickupIndex);
			Image component = ((Component)((Component)val).GetComponent<ChildLocator>().FindChild("Icon")).GetComponent<Image>();
			if (options[i].available)
			{
				((Graphic)component).color = Color.white;
				component.sprite = pickupDef3?.iconSprite;
				((Selectable)val).interactable = true;
			}
			else
			{
				((Graphic)component).color = Color.gray;
				component.sprite = texUnlockIcon;
				((Selectable)val).interactable = false;
			}
			ItemDef itemDef = ItemCatalog.GetItemDef(pickupDef2.itemIndex);
			EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(pickupDef2.equipmentIndex);
			string titleToken = (Object.op_Implicit((Object)(object)itemDef) ? itemDef.nameToken : equipmentDef.nameToken);
			TooltipProvider val2 = ((Component)val).gameObject.AddComponent<TooltipProvider>();
			val2.titleToken = titleToken;
			val2.bodyToken = (Object.op_Implicit((Object)(object)itemDef) ? itemDef.descriptionToken : equipmentDef.descriptionToken);
			val2.titleColor = Color32.op_Implicit(Object.op_Implicit((Object)(object)itemDef) ? ColorCatalog.GetColor(((int)itemDef.colorIndex == 0) ? itemDef._itemTierDef.colorIndex : itemDef.colorIndex) : ColorCatalog.GetColor(equipmentDef.colorIndex));
			val2.bodyColor = Color.gray;
		}
	}
}
internal class ShifterStatsHolder : MonoBehaviour
{
	public float[] statGains = new float[4];
}
internal class ShifterTracker : HuntressTracker
{
	private float stopwatch;

	private void Awake()
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Expected O, but got Unknown
		((HuntressTracker)this).Awake();
		base.indicator = new Indicator(((Component)this).gameObject, Prefabs.aimIndicator);
	}

	private void Start()
	{
		base.maxTrackingDistance = 370f;
		base.search.viewer = null;
		base.search.filterByLoS = false;
		((HuntressTracker)this).Start();
	}

	private void FixedUpdate()
	{
		//IL_0062: 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_0078: Unknown result type (might be due to invalid IL or missing references)
		base.trackerUpdateStopwatch = 10f;
		stopwatch += Time.fixedDeltaTime;
		if (stopwatch >= 1f / base.trackerUpdateFrequency)
		{
			stopwatch -= 1f / base.trackerUpdateFrequency;
			HurtBox trackingTarget = base.trackingTarget;
			Ray aimRay = default(Ray);
			((Ray)(ref aimRay))..ctor(base.inputBank.aimOrigin, base.inputBank.aimDirection);
			SearchForTargetNoLos(aimRay);
			base.indicator.targetTransform = (Object.op_Implicit((Object)(object)base.trackingTarget) ? ((Component)base.trackingTarget).transform : null);
		}
	}

	private void SearchForTargetNoLos(Ray aimRay)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: 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)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: 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)
		base.search.teamMaskFilter = TeamMask.GetUnprotectedTeams(base.teamComponent.teamIndex);
		base.search.filterByLoS = false;
		base.search.searchOrigin = ((Ray)(ref aimRay)).origin;
		base.search.searchDirection = ((Ray)(ref aimRay)).direction;
		base.search.sortMode = (SortMode)1;
		base.search.maxDistanceFilter = base.maxTrackingDistance;
		base.search.maxAngleFilter = base.maxTrackingAngle;
		base.search.RefreshCandidates();
		base.search.FilterOutGameObject(((Component)this).gameObject);
		base.trackingTarget = base.search.GetResults().FirstOrDefault();
	}
}
internal class Hook
{
	internal static void Hooks()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Expected O, but got Unknown
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Expected O, but got Unknown
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Expected O, but got Unknown
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Expected O, but got Unknown
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Expected O, but got Unknown
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Expected O, but got Unknown
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Expected O, but got Unknown
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: Expected O, but got Unknown
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Expected O, but got Unknown
		RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
		HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
		CharacterBody.SetBuffCount += new hook_SetBuffCount(CharacterBody_SetBuffCount);
		CharacterBody.CallCmdAddTimedBuff += new hook_CallCmdAddTimedBuff(CharacterBody_CallCmdAddTimedBuff);
		CharacterBody.AddTimedBuff_BuffDef_float_int += new hook_AddTimedBuff_BuffDef_float_int(CharacterBody_AddTimedBuff_BuffDef_float_int);
		CharacterBody.AddTimedBuff_BuffDef_float += new hook_AddTimedBuff_BuffDef_float(CharacterBody_AddTimedBuff_BuffDef_float);
		CharacterBody.AddBuff_BuffIndex += new hook_AddBuff_BuffIndex(CharacterBody_AddBuff_BuffIndex);
		DotController.InflictDot_refInflictDotInfo += new hook_InflictDot_refInflictDotInfo(DotController_InflictDot_refInflictDotInfo);
		PurchaseInteraction.OnInteractionBegin += new hook_OnInteractionBegin(PurchaseInteraction_OnInteractionBegin);
		CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
	}

	private static void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
	{
		orig.Invoke(self);
		if (Object.op_Implicit((Object)(object)((Component)self).GetComponent<ShifterBehaviour>()))
		{
			if (Object.op_Implicit((Object)(object)self.skillLocator.secondary))
			{
				float cooldownScale = self.skillLocator.secondary.cooldownScale;
				cooldownScale *= Mathf.Clamp((float)Math.Pow(0.75, self.level - 1f), 0f, 1f);
				self.skillLocator.secondary.cooldownScale = cooldownScale;
			}
			if (Object.op_Implicit((Object)(object)self.skillLocator.utility))
			{
				float cooldownScale2 = self.skillLocator.utility.cooldownScale;
				cooldownScale2 *= Mathf.Clamp((float)Math.Pow(0.75, self.level - 1f), 0f, 1f);
				self.skillLocator.utility.cooldownScale = cooldownScale2;
			}
			if (Object.op_Implicit((Object)(object)self.skillLocator.special))
			{
				float cooldownScale3 = self.skillLocator.special.cooldownScale;
				cooldownScale3 *= Mathf.Clamp((float)Math.Pow(0.75, self.level - 1f), 0f, 1f);
				self.skillLocator.special.cooldownScale = cooldownScale3;
			}
		}
	}

	private static void PurchaseInteraction_OnInteractionBegin(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor activator)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Invalid comparison between Unknown and I4
		//IL_005f: 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_004f: Unknown result type (might be due to invalid IL or missing references)
		CostTypeIndex costType = self.costType;
		CharacterBody component = ((Component)activator).GetComponent<CharacterBody>();
		if (((int)self.costType == 2 && Object.op_Implicit((Object)(object)((Component)activator).GetComponent<ShifterBehaviour>()) && Object.op_Implicit((Object)(object)component) && component.HasBuff(Prefabs.gigaSpeedBuff)) || component.HasBuff(Prefabs.gigaSpeedBuffAlt))
		{
			self.costType = (CostTypeIndex)0;
		}
		orig.Invoke(self, activator);
		self.costType = costType;
	}

	private static void DotController_InflictDot_refInflictDotInfo(orig_InflictDot_refInflictDotInfo orig, ref InflictDotInfo inflictDotInfo)
	{
		if (!Object.op_Implicit((Object)(object)inflictDotInfo.victimObject.GetComponent<ShifterBehaviour>()))
		{
			orig.Invoke(ref inflictDotInfo);
		}
	}

	private static void CharacterBody_AddBuff_BuffIndex(orig_AddBuff_BuffIndex orig, CharacterBody self, BuffIndex buffType)
	{
		//IL_000e: 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)
		if (!Object.op_Implicit((Object)(object)((Component)self).GetComponent<ShifterBehaviour>()) || !BuffCatalog.GetBuffDef(buffType).isDebuff)
		{
			orig.Invoke(self, buffType);
		}
	}

	private static void CharacterBody_AddTimedBuff_BuffDef_float(orig_AddTimedBuff_BuffDef_float orig, CharacterBody self, BuffDef buffDef, float duration)
	{
		if ((!Object.op_Implicit((Object)(object)((Component)self).GetComponent<ShifterBehaviour>()) || !buffDef.isDebuff) && !((Object)(object)buffDef == (Object)(object)Buffs.VoidRaidCrabWardWipeFog))
		{
			orig.Invoke(self, buffDef, duration);
		}
	}

	private static void CharacterBody_AddTimedBuff_BuffDef_float_int(orig_AddTimedBuff_BuffDef_float_int orig, CharacterBody self, BuffDef buffDef, float duration, int maxStacks)
	{
		if (!Object.op_Implicit((Object)(object)((Component)self).GetComponent<ShifterBehaviour>()) || !buffDef.isDebuff)
		{
			orig.Invoke(self, buffDef, duration, maxStacks);
		}
	}

	private static void CharacterBody_CallCmdAddTimedBuff(orig_CallCmdAddTimedBuff orig, CharacterBody self, BuffIndex buffType, float duration)
	{
		//IL_000e: 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)
		if (!Object.op_Implicit((Object)(object)((Component)self).GetComponent<ShifterBehaviour>()) || !BuffCatalog.GetBuffDef(buffType).isDebuff)
		{
			orig.Invoke(self, buffType, duration);
		}
	}

	private static void CharacterBody_SetBuffCount(orig_SetBuffCount orig, CharacterBody self, BuffIndex buffType, int newCount)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		orig.Invoke(self, buffType, newCount);
	}

	private static void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
	{
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Invalid comparison between Unknown and I4
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_0139: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Invalid comparison between Unknown and I4
		//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d2: Invalid comparison between Unknown and I4
		SetStateOnHurt val = null;
		bool flag = false;
		if (Object.op_Implicit((Object)(object)damageInfo.attacker) && Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent<ShifterBehaviour>()) && (int)damageInfo.damageType == 256)
		{
			damageInfo.damageType = (DamageType)0;
			val = ((Component)self).GetComponent<SetStateOnHurt>();
			if (!Object.op_Implicit((Object)(object)val))
			{
				flag = true;
				val = ((Component)self).gameObject.AddComponent<SetStateOnHurt>();
				val.canBeFrozen = true;
				EntityStateMachine[] components = ((Component)self).GetComponents<EntityStateMachine>();
				val.targetStateMachine = components.First((EntityStateMachine x) => x.customName == "Body");
				val.idleStateMachine = components.Where((EntityStateMachine x) => x.customName != "Body").ToArray();
			}
			val.SetStun(1f);
			val.SetFrozen(5f);
		}
		if (damageInfo.force != Vector3.zero && Object.op_Implicit((Object)(object)((Component)self).GetComponent<ShifterBehaviour>()))
		{
			damageInfo.force = Vector3.zero;
		}
		if ((Object)(object)damageInfo.inflictor == (Object)null && (int)damageInfo.damageColorIndex == 9 && Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)((Component)self).GetComponent<ShifterBehaviour>()))
		{
			damageInfo.rejected = true;
		}
		orig.Invoke(self, damageInfo);
		ShifterBehaviour shifterBehaviour = (Object.op_Implicit((Object)(object)damageInfo.attacker) ? damageInfo.attacker.GetComponent<ShifterBehaviour>() : null);
		if (!Object.op_Implicit((Object)(object)shifterBehaviour))
		{
			return;
		}
		if (flag)
		{
			Object.Destroy((Object)(object)((Component)self).GetComponent<SetStateOnHurt>());
		}
		if (self.alive && Object.op_Implicit((Object)(object)self.body) && (int)damageInfo.dotIndex == -1 && damageInfo.procCoefficient > 0f)
		{
			DotController.InflictDot(((Component)self).gameObject, damageInfo.attacker, (DotIndex)6, 10f * damageInfo.procCoefficient, 1f, (uint?)null);
			DotController.InflictDot(((Component)self).gameObject, damageInfo.attacker, (DotIndex)4, 10f * damageInfo.procCoefficient, 1f, (uint?)null);
			self.body.AddTimedBuff(Buffs.HealingDisabled, 10f * damageInfo.procCoefficient);
			self.body.AddTimedBuff(Buffs.LunarSecondaryRoot, 10f * damageInfo.procCoefficient);
			if (!RoR2Application.rng.nextBool)
			{
			}
		}
		if (Object.op_Implicit((Object)(object)damageInfo.inflictor) && Object.op_Implicit((Object)(object)damageInfo.inflictor.GetComponent<InstaKill>()) && damageInfo.rejected)
		{
			self.Suicide(damageInfo.attacker, (GameObject)null, (DamageType)0);
		}
	}

	private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
	{
		ShifterBehaviour component = ((Component)sender).GetComponent<ShifterBehaviour>();
		if (Object.op_Implicit((Object)(object)component))
		{
			if (Object.op_Implicit((Object)(object)component.statHolder))
			{
				args.baseHealthAdd += component.statHolder.statGains[0];
				args.baseDamageAdd += component.statHolder.statGains[1];
				args.baseShieldAdd += component.statHolder.statGains[2];
				args.armorAdd += component.statHolder.statGains[3];
			}
			float level = sender.level;
			args.healthMultAdd += 0.05f * level;
			args.regenMultAdd += 0.05f * level;
			args.shieldMultAdd += 0.05f * level;
			args.moveSpeedMultAdd += 0.05f * level;
			args.damageMultAdd += 0.05f * level;
			args.attackSpeedMultAdd += 0.05f * level;
			args.critAdd += 0.05f * level;
			args.armorAdd += 0.05f * level;
		}
		if (sender.HasBuff(Prefabs.gigaSpeedBuff))
		{
			args.moveSpeedMultAdd += 10f;
		}
		if (sender.HasBuff(Prefabs.gigaSpeedBuffAlt))
		{
			args.moveSpeedMultAdd += MainPlugin.utilSpeed.Value;
		}
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Dragonyck.RealityShifter", "RealityShifter", "1.0.3")]
public class MainPlugin : BaseUnityPlugin
{
	public const string MODUID = "com.Dragonyck.RealityShifter";

	public const string MODNAME = "RealityShifter";

	public const string VERSION = "1.0.3";

	public const string SURVIVORNAME = "Reality Shifter";

	public const string SURVIVORNAMEKEY = "SHIFTER";

	public static GameObject characterPrefab;

	public static GameObject displayPrefab;

	public static GameObject masterPrefab;

	private static readonly Color characterColor = new Color(0.3773585f, 0f, 0f);

	public static ConfigEntry<bool> giveItem;

	public static ConfigEntry<bool> enablePP;

	public static ConfigEntry<float> utilSpeed;

	public static ConfigEntry<int> chain;

	public static ConfigEntry<Vector3> freezeProjectileHitboxSize;

	public static ConfigEntry<Vector3> freezeProjectileEffectSize;

	public static ConfigEntry<float> secondaryAltRadius;

	public static ConfigEntry<float> primarySpeed;

	public static ConfigEntry<float> secondarySpeed;

	public static ConfigEntry<float> secondaryAltSpeed;

	private void Awake()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Expected O, but got Unknown
		//IL_002c: Expected O, but got Unknown
		//IL_0041: 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_005c: Expected O, but got Unknown
		//IL_005c: Expected O, but got Unknown
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Expected O, but got Unknown
		//IL_0090: Expected O, but got Unknown
		//IL_00a5: 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_00c1: Expected O, but got Unknown
		//IL_00c1: Expected O, but got Unknown
		//IL_00d6: 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)
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: Expected O, but got Unknown
		//IL_0104: Expected O, but got Unknown
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_012d: Unknown result type (might be due to invalid IL or missing references)
		//IL_013d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0147: Expected O, but got Unknown
		//IL_0147: Expected O, but got Unknown
		//IL_015c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0171: Unknown result type (might be due to invalid IL or missing references)
		//IL_017b: Expected O, but got Unknown
		//IL_017b: Expected O, but got Unknown
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Expected O, but got Unknown
		//IL_01af: Expected O, but got Unknown
		//IL_01c4: 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_01e3: Expected O, but got Unknown
		//IL_01e3: Expected O, but got Unknown
		//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_020d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0217: Expected O, but got Unknown
		//IL_0217: Expected O, but got Unknown
		giveItem = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("Give Items", "Enable"), false, new ConfigDescription("Items received from Reality Warp will be added directly to the inventory instead.", (AcceptableValueBase)null, Array.Empty<object>()));
		enablePP = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("Enable Shift Post Processing For Alt Utility", "Enable"), false, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>()));
		utilSpeed = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Utilities Speed Mult", "Value"), 1f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>()));
		chain = ((BaseUnityPlugin)this).Config.Bind<int>(new ConfigDefinition("Chain Lv", "Value"), 10, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>()));
		freezeProjectileHitboxSize = ((BaseUnityPlugin)this).Config.Bind<Vector3>(new ConfigDefinition("Secondary Hitbox Size", "Value"), new Vector3(48f, 20f, 24f), new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>()));
		freezeProjectileEffectSize = ((BaseUnityPlugin)this).Config.Bind<Vector3>(new ConfigDefinition("Secondary Effect Size", "Value"), new Vector3(6f, 50f, 20f), new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>()));
		secondaryAltRadius = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Secondary Alt Explosion Radius", "Value"), 10f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>()));
		primarySpeed = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Primary Projectile Speed", "Value"), 50f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>()));
		secondarySpeed = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Secondary Projectile Speed", "Value"), 140f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>()));
		secondaryAltSpeed = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Secondary Alt Projectile Speed", "Value"), 70f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>()));
		Assets.PopulateAssets();
		Achievements.RegisterUnlockables();
		Prefabs.CreatePrefabs();
		CreatePrefab();
		RegisterStates();
		RegisterCharacter();
		Hook.Hooks();
	}

	internal static void CreatePrefab()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_014f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0170: Unknown result type (might be due to invalid IL or missing references)
		//IL_0175: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d4: 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)
		GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidSurvivor/VoidSurvivorBody.prefab").WaitForCompletion();
		characterPrefab = PrefabAPI.InstantiateClone(val, "ShifterBody", true);
		Object.Destroy((Object)(object)characterPrefab.GetComponent<VoidSurvivorController>());
		characterPrefab.GetComponent<NetworkIdentity>().localPlayerAuthority = true;
		characterPrefab.GetComponent<SetStateOnHurt>().canBeFrozen = false;
		characterPrefab.AddComponent<ShifterBehaviour>();
		characterPrefab.AddComponent<ShifterTracker>();
		CharacterBody component = characterPrefab.GetComponent<CharacterBody>();
		((Object)component).name = "ShifterBody";
		component.baseNameToken = "SHIFTER_NAME";
		component.subtitleNameToken = "SHIFTER_SUBTITLE";
		component._defaultCrosshairPrefab = Prefabs.crosshair;
		component.portraitIcon = (Texture)(object)Assets.MainAssetBundle.LoadAsset<Sprite>("portrait").texture;
		component.bodyColor = characterColor;
		ModelLocator component2 = characterPrefab.GetComponent<ModelLocator>();
		CharacterModel component3 = ((Component)component2.modelTransform).GetComponent<CharacterModel>();
		((Component)((Component)component3).GetComponentsInChildren<SkinnedMeshRenderer>()[3]).gameObject.SetActive(false);
		Renderer[] array = (Renderer[])(object)new Renderer[3];
		for (int i = 0; i < component3.baseRendererInfos.Length; i++)
		{
			array[i] = component3.baseRendererInfos[i].renderer;
		}
		component3.baseRendererInfos = (RendererInfo[])(object)new RendererInfo[3];
		for (int j = 0; j < array.Length; j++)
		{
			component3.baseRendererInfos[j] = new RendererInfo
			{
				renderer = array[j],
				defaultMaterial = Prefabs.redOverlayMat,
				defaultShadowCastingMode = (ShadowCastingMode)1
			};
		}
		((Component)component3).GetComponent<ModelSkinController>().skins = (SkinDef[])(object)new SkinDef[1] { LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(component3.baseRendererInfos, ((Component)component3).gameObject, "Default")) };
		EntityStateMachine component4 = ((Component)component).GetComponent<EntityStateMachine>();
		component4.mainStateType = new SerializableEntityStateType(typeof(GenericCharacterMain));
		Utils.NewStateMachine<Idle>(characterPrefab, "Pick");
		Utils.NewStateMachine<Idle>(characterPrefab, "NoClip");
		Utils.NewStateMachine<Idle>(characterPrefab, "Succ");
		Utils.NewStateMachine<Traverse>(characterPrefab, "Traverse");
		NetworkStateMachine component5 = ((Component)component).GetComponent<NetworkStateMachine>();
		component5.stateMachines = ((Component)component).GetComponents<EntityStateMachine>();
		ContentAddition.AddBody(characterPrefab);
	}

	private void RegisterCharacter()
	{
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Expected O, but got Unknown
		//IL_012d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0162: Unknown result type (might be due to invalid IL or missing references)
		//IL_0175: Unknown result type (might be due to invalid IL or missing references)
		//IL_018c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0191: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
		string text = "<style=cSub>\r\n\r\n< ! > " + Environment.NewLine + "<style=cSub>\r\n\r\n< ! > " + Environment.NewLine + "<style=cSub>\r\n\r\n< ! > " + Environment.NewLine + "<style=cSub>\r\n\r\n< ! > ";
		string text2 = "..and so it left.";
		string text3 = "..and so it vanished.";
		LanguageAPI.Add("SHIFTER_NAME", "Reality Shifter");
		LanguageAPI.Add("SHIFTER_DESCRIPTION", text);
		LanguageAPI.Add("SHIFTER_SUBTITLE", "");
		LanguageAPI.Add("SHIFTER_OUTRO", text2);
		LanguageAPI.Add("SHIFTER_FAIL", text3);
		displayPrefab = PrefabAPI.InstantiateClone(Prefabs.Load<GameObject>("RoR2/DLC1/VoidSurvivor/VoidSurvivorDisplay.prefab"), "ShifterDisplay", false);
		AnimateShaderAlpha[] componentsInChildren = displayPrefab.GetComponentsInChildren<AnimateShaderAlpha>();
		foreach (AnimateShaderAlpha val in componentsInChildren)
		{
			Object.Destroy((Object)(object)val);
		}
		ParticleSystemRenderer[] componentsInChildren2 = displayPrefab.GetComponentsInChildren<ParticleSystemRenderer>(true);
		foreach (ParticleSystemRenderer val2 in componentsInChildren2)
		{
			((Renderer)val2).material = new Material(((Renderer)val2).material);
			((Renderer)val2).material.DisableKeyword("VERTEXCOLOR");
			((Renderer)val2).material.SetColor("_TintColor", Color.red);
		}
		Light[] componentsInChildren3 = displayPrefab.GetComponentsInChildren<Light>(true);
		float num = default(float);
		float num2 = default(float);
		float num3 = default(float);
		float num4 = default(float);
		float num5 = default(float);
		float num6 = default(float);
		foreach (Light val3 in componentsInChildren3)
		{
			Color.RGBToHSV(Color.red, ref num, ref num2, ref num3);
			Color.RGBToHSV(val3.color, ref num4, ref num5, ref num6);
			Color color = Color.HSVToRGB(num, num5, num6);
			color.a = val3.color.a;
			val3.color = color;
		}
		SurvivorDef val4 = ScriptableObject.CreateInstance<SurvivorDef>();
		val4.cachedName = "SHIFTER_NAME";
		val4.unlockableDef = null;
		val4.descriptionToken = "SHIFTER_DESCRIPTION";
		val4.primaryColor = characterColor;
		val4.bodyPrefab = characterPrefab;
		val4.displayPrefab = displayPrefab;
		val4.outroFlavorToken = "SHIFTER_OUTRO";
		val4.desiredSortPosition = 0.2f;
		val4.mainEndingEscapeFailureFlavorToken = "SHIFTER_FAIL";
		ContentAddition.AddSurvivorDef(val4);
		SkillSetup();
		GameObject val5 = PrefabAPI.InstantiateClone(Prefabs.Load<GameObject>("RoR2/DLC1/VoidSurvivor/VoidSurvivorMonsterMaster.prefab"), "ShifterMaster", true);
		Object.Destroy((Object)(object)Array.Find(val5.GetComponents<AISkillDriver>(), (AISkillDriver x) => (int)x.skillSlot == 3));
		ContentAddition.AddMaster(val5);
		CharacterMaster component = val5.GetComponent<CharacterMaster>();
		component.bodyPrefab = characterPrefab;
	}

	private void RegisterStates()
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: 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_004b: 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)
		bool flag = default(bool);
		ContentAddition.AddEntityState<BaseShifterState>(ref flag);
		ContentAddition.AddEntityState<AltPrimary>(ref flag);
		ContentAddition.AddEntityState<Primary>(ref flag);
		ContentAddition.AddEntityState<PrimaryEnd>(ref flag);
		ContentAddition.AddEntityState<Secondary>(ref flag);
		ContentAddition.AddEntityState<AltSecondary>(ref flag);
		ContentAddition.AddEntityState<Utility>(ref flag);
		ContentAddition.AddEntityState<Special>(ref flag);
		ContentAddition.AddEntityState<AltSpecial>(ref flag);
		ContentAddition.AddEntityState<Traverse>(ref flag);
		ContentAddition.AddEntityState<FlyState>(ref flag);
	}

	private void SkillSetup()
	{
		GenericSkill[] componentsInChildren = characterPrefab.GetComponentsInChildren<GenericSkill>();
		foreach (GenericSkill val in componentsInChildren)
		{
			Object.DestroyImmediate((Object)(object)val);
		}
		PassiveSetup();
		PrimarySetup();
		SecondarySetup();
		UtilitySetup();
		SpecialSetup();
	}

	private void PassiveSetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("SHIFTER_PASSIVE_NAME", "Inevitable");
		LanguageAPI.Add("SHIFTER_PASSIVE_DESCRIPTION", "<style=cIsDamage>Immune</style> to <style=cIsUtility>fall damage</style>. All damage dealt applies a random <style=cIsDamage>debuff</style>." + Environment.NewLine + "Reality Shifter is <style=cIsDamage>immune</style> to debuffs." + Environment.NewLine + "Gain 5% <style=cIsHealth>Max HP</style>, <style=cIsHealing>health regen</style>, <style=cIsHealing>shield</style>, <style=cIsDamage>movement speed</style>, <style=cIsDamage>damage</style>, <style=cIsDamage>attack speed</style>, <style=cIsDamage>critical chance</style>, <style=cIsUtility>cooldown reduction</style> and <style=cIsHealing>0.05 armor</style> per level.");
		component.passiveSkill.enabled = true;
		component.passiveSkill.skillNameToken = "SHIFTER_PASSIVE_NAME";
		component.passiveSkill.skillDescriptionToken = "<style=cKeywordName>Inevitable</style><style=cSub>";
		component.passiveSkill.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("texVoidSurvivorSkillIcons_1");
		component.passiveSkill.keywordToken = "SHIFTER_PASSIVE_DESCRIPTION";
	}

	private void PrimarySetup()
	{
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("SHIFTER_M1", "Cosmic Shrapnel");
		LanguageAPI.Add("SHIFTER_M1_DESCRIPTION", "Fire tracking orbs that deal <style=cIsDamage>250% damage</style>.");
		SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(Primary));
		val.activationStateMachineName = "Weapon";
		val.baseMaxStock = 0;
		val.baseRechargeInterval = 0f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = true;
		val.interruptPriority = (InterruptPriority)0;
		val.isCombatSkill = true;
		val.mustKeyPress = false;
		val.cancelSprintingOnActivation = true;
		val.rechargeStock = 0;
		val.requiredStock = 0;
		val.stockToConsume = 0;
		val.icon = Prefabs.Load<SkillDef>("RoR2/DLC1/VoidSurvivor/FireCorruptDisk.asset").icon;
		val.skillDescriptionToken = "SHIFTER_M1_DESCRIPTION";
		val.skillName = "SHIFTER_M1";
		val.skillNameToken = "SHIFTER_M1";
		ContentAddition.AddSkillDef(val);
		component.primary = Utils.NewGenericSkill(characterPrefab, val);
		LanguageAPI.Add("SHIFTER_M1_ALT", "Assimilate");
		LanguageAPI.Add("SHIFTER_M1_ALT_DESCRIPTION", "Absorb an enemy, killing it <style=cIsDamage>instantly</style> and gaining its stats. This effect chains to an additional enemy for every <style=cIsUtility>10 levels</style>.");
		val = (SkillDef)(object)ScriptableObject.CreateInstance<HuntressTrackingSkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(AltPrimary));
		val.activationStateMachineName = "Succ";
		val.baseMaxStock = 0;
		val.baseRechargeInterval = 0f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = true;
		val.interruptPriority = (InterruptPriority)0;
		val.isCombatSkill = true;
		val.mustKeyPress = false;
		val.cancelSprintingOnActivation = true;
		val.rechargeStock = 0;
		val.requiredStock = 0;
		val.stockToConsume = 0;
		val.icon = Prefabs.Load<SkillDef>("RoR2/DLC1/VoidSurvivor/FireCorruptBeam.asset").icon;
		val.skillDescriptionToken = "SHIFTER_M1_ALT_DESCRIPTION";
		val.skillName = "SHIFTER_M1_ALT";
		val.skillNameToken = "SHIFTER_M1_ALT";
		ContentAddition.AddSkillDef(val);
		Utils.AddAlt(component.primary.skillFamily, val, Achievements.bossKillUnlock);
	}

	private void SecondarySetup()
	{
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("SHIFTER_M2", "Spacetime Blast");
		LanguageAPI.Add("SHIFTER_M2_DESCRIPTION", "Fire a wave attack that deals <style=cIsDamage>400% damage</style> and <style=cIsDamage>freezes</style>.");
		SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(Secondary));
		val.activationStateMachineName = "Weapon";
		val.baseMaxStock = 1;
		val.baseRechargeInterval = 5f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = false;
		val.interruptPriority = (InterruptPriority)1;
		val.isCombatSkill = true;
		val.mustKeyPress = false;
		val.cancelSprintingOnActivation = false;
		val.rechargeStock = 1;
		val.requiredStock = 1;
		val.stockToConsume = 1;
		val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("texVoidSurvivorSkillIcons_4");
		val.skillDescriptionToken = "SHIFTER_M2_DESCRIPTION";
		val.skillName = "SHIFTER_M2";
		val.skillNameToken = "SHIFTER_M2";
		ContentAddition.AddSkillDef(val);
		component.secondary = Utils.NewGenericSkill(characterPrefab, val);
		LanguageAPI.Add("SHIFTER_M2_ALT", "End of Fate");
		LanguageAPI.Add("SHIFTER_M2_ALT_DESCRIPTION", "Shoot out a void implosion that <style=cIsDamage>instantly kills</style> anything in its radius.");
		val = ScriptableObject.CreateInstance<SkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(AltSecondary));
		val.activationStateMachineName = "Weapon";
		val.baseMaxStock = 1;
		val.baseRechargeInterval = 5f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = false;
		val.interruptPriority = (InterruptPriority)1;
		val.isCombatSkill = true;
		val.mustKeyPress = false;
		val.cancelSprintingOnActivation = false;
		val.rechargeStock = 1;
		val.requiredStock = 1;
		val.stockToConsume = 1;
		val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("texVoidSurvivorSkillIcons_8");
		val.skillDescriptionToken = "SHIFTER_M2_ALT_DESCRIPTION";
		val.skillName = "SHIFTER_M2_ALT";
		val.skillNameToken = "SHIFTER_M2_ALT";
		ContentAddition.AddSkillDef(val);
		Utils.AddAlt(component.secondary.skillFamily, val, Achievements.billionDamageUnlock);
	}

	private void UtilitySetup()
	{
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("SHIFTER_UTIL", "Dimensional Ascension");
		LanguageAPI.Add("SHIFTER_UTIL_DESCRIPTION", "Gain <style=cIsDamage>1000% movement speed</style> for <style=cIsUtility>10s</style>. During this period, you may fly and travel through walls. You cannot be hit for the duration.");
		SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(Utility));
		val.activationStateMachineName = "NoClip";
		val.baseMaxStock = 1;
		val.baseRechargeInterval = 8f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = false;
		val.interruptPriority = (InterruptPriority)1;
		val.isCombatSkill = false;
		val.mustKeyPress = true;
		val.cancelSprintingOnActivation = false;
		val.rechargeStock = 1;
		val.requiredStock = 1;
		val.stockToConsume = 1;
		val.icon = Prefabs.Load<SkillDef>("RoR2/DLC1/VoidSurvivor/VoidBlinkDown.asset").icon;
		val.skillDescriptionToken = "SHIFTER_UTIL_DESCRIPTION";
		val.skillName = "SHIFTER_UTIL";
		val.skillNameToken = "SHIFTER_UTIL";
		ContentAddition.AddSkillDef(val);
		component.utility = Utils.NewGenericSkill(characterPrefab, val);
		LanguageAPI.Add("SHIFTER_UTIL_ALT", "Dimensional Transcendance");
		LanguageAPI.Add("SHIFTER_UTIL_ALT_DESCRIPTION", "<style=cIsDamage>Passive effect:</style> You may fly and travel though walls. You cannot be hit.");
		val = (SkillDef)(object)ScriptableObject.CreateInstance<MasterSpawnSlotSkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(Idle));
		val.activationStateMachineName = "Traverse";
		val.baseMaxStock = 0;
		val.baseRechargeInterval = 0f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = false;
		val.interruptPriority = (InterruptPriority)1;
		val.isCombatSkill = false;
		val.mustKeyPress = true;
		val.cancelSprintingOnActivation = false;
		val.rechargeStock = 0;
		val.requiredStock = 0;
		val.stockToConsume = 0;
		val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("texVoidSurvivorSkillIcons_2");
		val.skillDescriptionToken = "SHIFTER_UTIL_ALT_DESCRIPTION";
		val.skillName = "SHIFTER_UTIL_ALT";
		val.skillNameToken = "SHIFTER_UTIL_ALT";
		ContentAddition.AddSkillDef(val);
		Utils.AddAlt(component.utility.skillFamily, val, Achievements.endingUnlock);
	}

	private void SpecialSetup()
	{
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("SHIFTER_SPEC", "Reality Warp");
		LanguageAPI.Add("SHIFTER_SPEC_DESCRIPTION", "Choose any item or equipment to find.");
		SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(Special));
		val.activationStateMachineName = "Pick";
		val.baseMaxStock = 1;
		val.baseRechargeInterval = 60f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = false;
		val.interruptPriority = (InterruptPriority)0;
		val.isCombatSkill = true;
		val.mustKeyPress = true;
		val.cancelSprintingOnActivation = false;
		val.rechargeStock = 1;
		val.requiredStock = 1;
		val.stockToConsume = 1;
		val.icon = Prefabs.Load<SkillDef>("RoR2/DLC1/VoidSurvivor/CrushHealth.asset").icon;
		val.skillDescriptionToken = "SHIFTER_SPEC_DESCRIPTION";
		val.skillName = "SHIFTER_SPEC";
		val.skillNameToken = "SHIFTER_SPEC";
		ContentAddition.AddSkillDef(val);
		component.special = Utils.NewGenericSkill(characterPrefab, val);
		LanguageAPI.Add("SHIFTER_SPEC_ALT", "Singularity");
		LanguageAPI.Add("SHIFTER_SPEC_ALT_DESCRIPTION", "<style=cIsDamage>Instantly kills</style> all enemies. Enemies that spawn in the next <style=cIsUtility>10s</style> instantly die.");
		val = ScriptableObject.CreateInstance<SkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(AltSpecial));
		val.activationStateMachineName = "Pick";
		val.baseMaxStock = 0;
		val.baseRechargeInterval = 0f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = false;
		val.interruptPriority = (InterruptPriority)0;
		val.isCombatSkill = true;
		val.mustKeyPress = true;
		val.cancelSprintingOnActivation = false;
		val.rechargeStock = 0;
		val.requiredStock = 0;
		val.stockToConsume = 0;
		val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("texVoidSurvivorSkillIcons_3");
		val.skillDescriptionToken = "SHIFTER_SPEC_ALT_DESCRIPTION";
		val.skillName = "SHIFTER_SPEC_ALT";
		val.skillNameToken = "SHIFTER_SPEC_ALT";
		ContentAddition.AddSkillDef(val);
		Utils.AddAlt(component.special.skillFamily, val, Achievements.unlockAll);
	}
}
internal class Prefabs
{
	internal static GameObject crosshair;

	internal static GameObject trackingOrbProjectile;

	internal static GameObject trackingOrbProjectileGhost;

	internal static GameObject trackingOrbImpactEffect;

	internal static GameObject freezingWaveProjectile;

	internal static GameObject freezingWaveProjectileGhost;

	internal static GameObject itemPanelChargeEffect;

	internal static GameObject itemPanelMuzzleEffect;

	internal static GameObject executeLineEffect;

	internal static GameObject executeLineImpactEffect;

	internal static GameObject traversePP;

	internal static GameObject traversePPPermanent;

	internal static GameObject instaKillPP;

	internal static GameObject swingEffect;

	internal static GameObject itemSelectionPanel;

	internal static GameObject aimIndicator;

	internal static GameObject insteaDeathProjectile;

	internal static GameObject insteaDeathProjectileGhost;

	internal static GameObject insteaDeathProjectileImpactEffect;

	internal static BuffDef gigaSpeedBuff;

	internal static BuffDef gigaSpeedBuffAlt;

	internal static Material ghostEffectMat;

	internal static Material redOverlayMat;

	internal static Material instaKillMat;

	internal static Sprite texUnlockIcon;

	internal static List<PickupIndex> allItems = new List<PickupIndex>();

	internal static Option[] allOptions;

	internal static T Load<T>(string path)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		return Addressables.LoadAssetAsync<T>((object)path).WaitForCompletion();
	}

	[SystemInitializer(new Type[] { typeof(ItemCatalog) })]
	public unsafe static void SetAllAvailableItems()
	{
		//IL_0217: Unknown result type (might be due to invalid IL or missing references)
		//IL_021c: Unknown result type (might be due to invalid IL or missing references)
		//IL_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)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d7: Expected I4, but got Unknown
		//IL_0113: Unknown result type (might be due to invalid IL or missing references)
		//IL_0118: Unknown result type (might be due to invalid IL or missing references)
		//IL_011a: Unknown result type (might be due to invalid IL or missing references)
		//IL_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_011e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0151: Expected I4, but got Unknown
		//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0404: Unknown result type (might be due to invalid IL or missing references)
		//IL_040e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0413: Unknown result type (might be due to invalid IL or missing references)
		//IL_0420: Unknown result type (might be due to invalid IL or missing references)
		//IL_0430: Unknown result type (might be due to invalid IL or missing references)
		//IL_043a: Unknown result type (might be due to invalid IL or missing references)
		//IL_043f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01db: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02da: Unknown result type (might be due to invalid IL or missing references)
		//IL_02df: Unknown result type (might be due to invalid IL or missing references)
		//IL_0203: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
		List<PickupIndex> list = new List<PickupIndex>();
		List<PickupIndex> list2 = new List<PickupIndex>();
		List<PickupIndex> list3 = new List<PickupIndex>();
		List<PickupIndex> list4 = new List<PickupIndex>();
		List<PickupIndex> list5 = new List<PickupIndex>();
		List<PickupIndex> list6 = new List<PickupIndex>();
		List<PickupIndex> list7 = new List<PickupIndex>();
		List<PickupIndex> list8 = new List<PickupIndex>();
		List<PickupIndex> list9 = new List<PickupIndex>();
		List<PickupIndex> list10 = new List<PickupIndex>();
		List<PickupIndex> list11 = new List<PickupIndex>();
		List<PickupIndex> list12 = new List<PickupIndex>();
		List<PickupIndex> list13 = new List<PickupIndex>();
		Sprite val = Load<Sprite>("RoR2/Base/Core/texNullIcon.png");
		for (int i = 0; i < ItemCatalog.allItemDefs.Length; i++)
		{
			ItemDef val2 = (ItemDef)Unsafe.Read<object>((void*)ItemCatalog.allItemDefs[i]);
			if (val2.hidden)
			{
				continue;
			}
			List<PickupIndex> list14 = null;
			ItemTier tier = val2.tier;
			ItemTier val3 = tier;
			switch ((int)val3)
			{
			case 0:
				list14 = list;
				break;
			case 1:
				list14 = list3;
				break;
			case 2:
				list14 = list5;
				break;
			case 6:
				list14 = list2;
				break;
			case 7:
				list14 = list4;
				break;
			case 8:
				list14 = list6;
				break;
			case 3:
				list14 = list7;
				break;
			case 4:
				list14 = list8;
				break;
			case 9:
				list14 = list9;
				break;
			case 10:
				list14 = list10;
				break;
			}
			ItemTier deprecatedTier = val2.deprecatedTier;
			ItemTier val4 = deprecatedTier;
			switch ((int)val4)
			{
			case 0:
				list14 = list;
				break;
			case 1:
				list14 = list3;
				break;
			case 2:
				list14 = list5;
				break;
			case 6:
				list14 = list2;
				break;
			case 7:
				list14 = list4;
				break;
			case 8:
				list14 = list6;
				break;
			case 3:
				list14 = list7;
				break;
			case 4:
				list14 = list8;
				break;
			case 9:
				list14 = list9;
				break;
			case 10:
				list14 = list10;
				break;
			}
			string @string = Language.GetString(val2.nameToken);
			if (!Utility.IsNullOrWhiteSpace(@string) && @string != val2.nameToken && (Object)(object)val2.pickupIconSprite != (Object)(object)val && (Object)(object)val2.pickupIconSprite != (Object)null)
			{
				PickupIndex item = PickupCatalog.FindPickupIndex(val2.itemIndex);
				if (list14 != null && !list14.Contains(item))
				{
					list14.Add(item);
				}
			}
		}
		for (int j = 0; j < EquipmentCatalog.equipmentDefs.Length; j++)
		{
			EquipmentDef val5 = EquipmentCatalog.equipmentDefs[j];
			if (val5.canDrop)
			{
			}
			List<PickupIndex> list15 = null;
			list15 = (val5.isLunar ? list12 : ((!val5.isBoss) ? list11 : list13));
			string string2 = Language.GetString(val5.nameToken);
			if (!Utility.IsNullOrWhiteSpace(string2) && string2 != val5.nameToken && (Object)(object)val5.pickupIconSprite != (Object)(object)val && (Object)(object)val5.pickupIconSprite != (Object)null)
			{
				PickupIndex item2 = PickupCatalog.FindPickupIndex(val5.equipmentIndex);
				if (list15 != null && !list15.Contains(item2))
				{
					list15.Add(item2);
				}
			}
		}
		allItems.AddRange(list);
		allItems.AddRange(list3);
		allItems.AddRange(list5);
		allItems.AddRange(list7);
		allItems.AddRange(list8);
		allItems.AddRange(list2);
		allItems.AddRange(list4);
		allItems.AddRange(list6);
		allItems.AddRange(list9);
		allItems.AddRange(list10);
		allItems.AddRange(list11);
		allItems.AddRange(list12);
		allItems.AddRange(list13);
		allOptions = PickupPickerController.GenerateOptionsFromArray(allItems.ToArray());
		RectTransform component = ((Component)itemSelectionPanel.GetComponentInChildren<GridLayoutGroup>()).GetComponent<RectTransform>();
		component.sizeDelta += Vector2.up * (float)allItems.Count * 14.5f;
		((Transform)component).localPosition = Vector2.op_Implicit(Vector2.up * (float)allItems.Count * -25.7f);
		Object.Destroy((Object)(object)freezingWaveProjectileGhost.GetComponentInChildren<RotateAroundAxis>(true));
	}

	internal static void CreatePrefabs()
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Expected O, but got Unknown
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: 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_0130: 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_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_015f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0165: Unknown result type (might be due to invalid IL or missing references)
		//IL_0176: Unknown result type (might be due to invalid IL or missing references)
		//IL_0226: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Expected O, but got Unknown
		//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c8: Expected O, but got Unknown
		//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0420: Unknown result type (might be due to invalid IL or missing references)
		//IL_0427: Expected O, but got Unknown
		//IL_044e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0453: Unknown result type (might be due to invalid IL or missing references)
		//IL_048f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0495: Expected O, but got Unknown
		//IL_04b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ea: Expected O, but got Unknown
		//IL_0518: Unknown result type (might be due to invalid IL or missing references)
		//IL_056f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0579: Expected O, but got Unknown
		//IL_05a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0649: Unknown result type (might be due to invalid IL or missing references)
		//IL_0653: Unknown result type (might be due to invalid IL or missing references)
		//IL_0660: Unknown result type (might be due to invalid IL or missing references)
		//IL_066a: Unknown result type (might be due to invalid IL or missing references)
		//IL_066f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0686: Unknown result type (might be due to invalid IL or missing references)
		//IL_069d: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c7: Expected O, but got Unknown
		//IL_06fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_08ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_08ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0908: Unknown result type (might be due to invalid IL or missing references)
		//IL_0985: Unknown result type (might be due to invalid IL or missing references)
		//IL_07fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_07dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_07bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aa7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ab1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0add: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ae7: Expected O, but got Unknown
		//IL_0b0a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c74: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c90: Unknown result type (might be due to invalid IL or missing references)
		//IL_082e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d67: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d79: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d83: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dd3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0de5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0def: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e21: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e2b: Expected O, but got Unknown
		//IL_0e6c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e8f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e94: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eaf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eb4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ee8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f7c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fc2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fc9: Expected O, but got Unknown
		//IL_0fd0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fe5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fec: Expected O, but got Unknown
		//IL_0ff3: Unknown result type (might be due to invalid IL or missing references)
		//IL_084f: Unknown result type (might be due to invalid IL or missing references)
		//IL_09f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_09fa: Expected O, but got Unknown
		//IL_0a28: Unknown result type (might be due to invalid IL or missing references)
		//IL_1039: Unknown result type (might be due to invalid IL or missing references)
		//IL_1043: Expected O, but got Unknown
		//IL_1062: Unknown result type (might be due to invalid IL or missing references)
		//IL_1254: Unknown result type (might be due to invalid IL or missing references)
		//IL_125e: Expected O, but got Unknown
		//IL_128c: Unknown result type (might be due to invalid IL or missing references)
		//IL_1192: Unknown result type (might be due to invalid IL or missing references)
		//IL_119c: Unknown result type (might be due to invalid IL or missing references)
		//IL_11c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_11ce: Expected O, but got Unknown
		//IL_11fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_12d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_12e3: Expected O, but got Unknown
		//IL_12ff: Unknown result type (might be due to invalid IL or missing references)
		texUnlockIcon = Load<Sprite>("RoR2/Base/Common/MiscIcons/texUnlockIcon.png");
		redOverlayMat = Load<Material>("RoR2/DLC1/VoidSurvivor/matVoidSurvivorCorruptOverlay.mat");
		ghostEffectMat = new Material(Load<Material>("RoR2/Base/Common/VFX/matGhostEffect.mat"));
		ghostEffectMat.SetColor("_TintColor", new Color(0.31372f, 0f, 0f));
		ghostEffectMat.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampParentFire.png"));
		instaKillMat = new Material(Load<Material>("RoR2/Base/Parent/matParentBlink.mat"));
		instaKillMat.SetColor("_TintColor", Color.red);
		instaKillMat.SetTexture("_MainTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/texCloudWaterFoam1.jpg"));
		instaKillMat.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampGolem.png"));
		gigaSpeedBuff = Utils.NewBuffDef("Dimensional Ascension", stack: false, hidden: true, null, Color.white);
		gigaSpeedBuffAlt = Utils.NewBuffDef("Dimensional Ascension", stack: false, hidden: true, null, Color.white);
		aimIndicator = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Huntress/HuntressTrackingIndicator.prefab"), "ShifterAimIndicator", false);
		SpriteRenderer[] componentsInChildren = aimIndicator.GetComponentsInChildren<SpriteRenderer>();
		float num = default(float);
		float num2 = default(float);
		float num3 = default(float);
		float num4 = default(float);
		float num5 = default(float);
		float num6 = default(float);
		foreach (SpriteRenderer val in componentsInChildren)
		{
			Color.RGBToHSV(Color.red, ref num, ref num2, ref num3);
			Color.RGBToHSV(val.color, ref num4, ref num5, ref num6);
			Color color = Color.HSVToRGB(num, num5, num6);
			color.a = val.color.a;
			val.color = color;
		}
		swingEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/DLC1/VoidSurvivor/VoidSurvivorMeleeSlash2.prefab"), "ShifterSwingEffect", false);
		ParticleSystemRenderer componentInChildren = swingEffect.GetComponentInChildren<ParticleSystemRenderer>();
		((Renderer)componentInChildren).material = Load<Material>("RoR2/DLC1/VoidSurvivor/matVoidSurvivorLightningCorrupted.mat");
		swingEffect.GetComponentInChildren<DestroyOnTimer>().duration = 0.8f;
		crosshair = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/DLC1/VoidSurvivor/VoidSurvivorCrosshair.prefab"), "ShifterCrosshair", false);
		EnumerableExtensions.ForEachTry<Image>((IEnumerable<Image>)crosshair.GetComponentsInChildren<Image>(), (Action<Image>)delegate(Image x)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			((Graphic)x).color = new Color(0.8745f, 0f, 0f);
		}, (IDictionary<Image, Exception>)null);
		traversePP = new GameObject("ShifterPP");
		traversePP.layer = 20;
		traversePP.AddComponent<NetworkIdentity>();
		traversePP.transform.parent = crosshair.transform.parent;
		PostProcessVolume val2 = traversePP.AddComponent<PostProcessVolume>();
		val2.profile = Object.Instantiate<PostProcessProfile>(Load<PostProcessProfile>("RoR2/Base/title/ppLocalDoppelganger.asset"));
		val2.sharedProfile = val2.profile;
		val2.weight = 1f;
		val2.priority = 99f;
		val2.isGlobal = true;
		ColorGrading val3 = (ColorGrading)val2.profile.settings[1];
		((ParameterOverride)val3.tint).overrideState = false;
		((ParameterOverride)val3.colorFilter).overrideState = true;
		((ParameterOverride<Color>)(object)val3.colorFilter).value = new Color(0.38039f, 0.11764f, 0.1098f);
		((ParameterOverride<float>)(object)val3.mixerRedOutRedIn).value = 300f;
		PostProcessDuration val4 = traversePP.AddComponent<PostProcessDuration>();
		val4.ppVolume = val2;
		val4.ppWeightCurve = AnimationCurve.Linear(0f, 1f, 1f, 0f);
		val4.ppWeightCurve.AddKey(0.85f, 1f);
		val4.maxDuration = 11f;
		val4.destroyOnEnd = true;
		PrefabAPI.RegisterNetworkPrefab(traversePP);
		traversePPPermanent = PrefabAPI.InstantiateClone(traversePP, "ShifterPPPermanent", false);
		Object.Destroy((Object)(object)traversePPPermanent.GetComponent<PostProcessDuration>());
		instaKillPP = PrefabAPI.InstantiateClone(traversePP, "ShifterPPPInstakill", false);
		Object.Destroy((Object)(object)instaKillPP.GetComponent<PostProcessDuration>());
		PostProcessVolume val5 = instaKillPP.AddComponent<PostProcessVolume>();
		val5.profile = Object.Instantiate<PostProcessProfile>(Load<PostProcessProfile>("RoR2/Base/title/ppLocalElectricWorm.asset"));
		val5.sharedProfile = val5.profile;
		val5.weight = 1f;
		val5.priority = 99f;
		val5.isGlobal = true;
		ColorGrading val6 = (ColorGrading)val5.profile.settings[1];
		((ParameterOverride<float>)(object)val6.temperature).value = 130f;
		((ParameterOverride<Color>)(object)val6.colorFilter).value = new Color(1f, 0.29803f, 0.33333f);
		itemPanelChargeEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/DLC1/VoidSurvivor/VoidSurvivorChargeMegaBlaster.prefab"), "ShifterItemPanelChargeEffect", false);
		MeshRenderer componentInChildren2 = itemPanelChargeEffect.GetComponentInChildren<MeshRenderer>();
		((Renderer)componentInChildren2).sharedMaterials[1] = new Material(((Renderer)componentInChildren2).sharedMaterials[1]);
		((Renderer)componentInChildren2).sharedMaterials[1].SetColor("_TintColor", new Color(0.78431f, 0f, 0f));
		ParticleSystemRenderer[] componentsInChildren2 = itemPanelChargeEffect.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val7 in componentsInChildren2)
		{
			((Renderer)val7).material = new Material(((Renderer)val7).material);
			((Renderer)val7).material.DisableKeyword("VERTEXCOLOR");
			((Renderer)val7).material.SetColor("_TintColor", new Color(0.78431f, 0f, 0f));
		}
		itemPanelMuzzleEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/DLC1/VoidSurvivor/VoidSurvivorCrushHealthMuzzleflash.prefab"), "ShifterItemPanelMuzzleEffect", false);
		ParticleSystemRenderer[] componentsInChildren3 = itemPanelMuzzleEffect.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val8 in componentsInChildren3)
		{
			((Renderer)val8).material = new Material(((Renderer)val8).material);
			((Renderer)val8).material.DisableKeyword("VERTEXCOLOR");
			((Renderer)val8).material.SetColor("_TintColor", new Color(0.78431f, 0f, 0f));
		}
		Utils.RegisterEffect(itemPanelMuzzleEffect, -1f);
		itemSelectionPanel = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Command/CommandPickerPanel.prefab"), "ShifterPickerPanel", false);
		((Component)itemSelectionPanel.GetComponentInChildren<LanguageTextMeshController>()).gameObject.SetActive(false);
		GridLayoutGroup componentInChildren3 = itemSelectionPanel.GetComponentInChildren<GridLayoutGroup>();
		componentInChildren3.constraint = (Constraint)1;
		componentInChildren3.constraintCount = 6;
		((LayoutGroup)componentInChildren3).childAlignment = (TextAnchor)1;
		RectTransform component = ((Component)componentInChildren3).GetComponent<RectTransform>();
		((Behaviour)((Component)component).GetComponent<RawImage>()).enabled = false;
		component.sizeDelta = Vector2.right * 444f;
		((Transform)component).localPosition = Vector2.op_Implicit(Vector2.up * 100f);
		component.anchorMin = new Vector2(0.5f, 1f);
		component.anchorMax = new Vector2(0.5f, 1f);
		GameObject val9 = new GameObject("Scroll", new Type[1] { typeof(RectTransform) });
		val9.gameObject.layer = 5;
		val9.transform.SetParent(((Component)componentInChildren3).transform.parent);
		val9.transform.localPosition = ((Component)componentInChildren3).transform.localPosition;
		((Component)componentInChildren3).transform.parent = val9.transform;
		ScrollRect val10 = val9.AddComponent<ScrollRect>();
		val10.horizontal = false;
		val10.content = component;
		val10.scrollSensitivity = 30f;
		PickupPickerPanel component2 = itemSelectionPanel.GetComponent<PickupPickerPanel>();
		ShifterPanelBehaviour shifterPanelBehaviour = itemSelectionPanel.AddComponent<ShifterPanelBehaviour>();
		Image[] componentsInChildren4 = itemSelectionPanel.GetComponentsInChildren<Image>();
		foreach (Image val11 in componentsInChildren4)
		{
			string name = ((Object)val11).name;
			if (name == "SpinnyOutlines")
			{
				if (((Component)val11).transform.childCount == 0)
				{
					((Graphic)val11).color = new Color(0.43529f, 0f, 0.05098f);
				}
				else
				{
					((Graphic)val11).color = new Color(0.63529f, 0f, 0.0745f);
				}
			}
			if (name == "BG")
			{
				((Graphic)val11).color = Color.red;
			}
			if (name == "ColoredOverlay")
			{
				((Graphic)val11).color = new Color(0.63529f, 0f, 0.0745f);
			}
			if (name == "ColoredOverlay, Subtle")
			{
				((Graphic)val11).color = Color.clear;
			}
			if (name == "CancelButton")
			{
				shifterPanelBehaviour.cancelButton = ((Component)val11).GetComponent<MPButton>();
			}
		}
		Image val12 = val9.gameObject.AddComponent<Image>();
		((Graphic)val12).color = new Color(0.12549f, 0f, 0f);
		val12.sprite = Load<Sprite>("RoR2/Base/UI/texUIHighlightBoxOutlineThickIcon.png");
		val12.type = (Type)2;
		val9.gameObject.AddComponent<Mask>();
		RectTransform component3 = ((Component)val10).GetComponent<RectTransform>();
		((Transform)component3).localPosition = Vector2.op_Implicit(Vector2.zero);
		component3.sizeDelta = new Vector2(500f, 510f);
		shifterPanelBehaviour.gridlayoutGroup = component2.gridlayoutGroup;
		shifterPanelBehaviour.buttonContainer = component2.buttonContainer;
		shifterPanelBehaviour.buttonPrefab = component2.buttonPrefab;
		shifterPanelBehaviour.coloredImages = component2.coloredImages;
		shifterPanelBehaviour.darkColoredImages = component2.darkColoredImages;
		Object.Destroy((Object)(object)component2);
		trackingOrbImpactEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/DLC1/VoidBarnacle/VoidBarnacleImpactExplosion.prefab"), "ShifterTrackingOrbImpactEffect", false);
		trackingOrbImpactEffect.GetComponentInChildren<Light>().color = Color.red;
		ParticleSystemRenderer[] componentsInChildren5 = trackingOrbImpactEffect.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val13 in componentsInChildren5)
		{
			string name2 = ((Object)val13).name;
			if (name2 == "BillboardFire" || name2 == "Flames")
			{
				((Renderer)val13).enabled = false;
				continue;
			}
			((Renderer)val13).material = new Material(((Renderer)val13).material);
			((Renderer)val13).material.DisableKeyword("VERTEXCOLOR");
			((Renderer)val13).material.SetColor("_TintColor", new Color(0.78431f, 0f, 0f));
		}
		Utils.RegisterEffect(trackingOrbImpactEffect, -1f, "Play_item_void_chainLightning", parentToReferencedTransform: false, positionAtReferencedTransform: false, applyScale: true);
		trackingOrbProjectileGhost = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/LunarSkillReplacements/LunarNeedleGhost.prefab"), "ShifterTrackingOrbProjectileGhost", false);
		((Renderer)trackingOrbProjectileGhost.GetComponentInChildren<TrailRenderer>()).material = Load<Material>("RoR2/DLC1/VoidSurvivor/matVoidBlinkTrailCorrupted.mat");
		ParticleSystemRenderer[] componentsInChildren6 = trackingOrbProjectileGhost.GetComponentsInChildren<ParticleSystemRenderer>();
		((Component)componentsInChildren6[0]).transform.localScale = Vector3.one * 3f;
		((Renderer)componentsInChildren6[0]).material = Load<Material>("RoR2/DLC1/VoidSurvivor/matVoidSurvivorBlasterCoreCorrupted.mat");
		((Renderer)componentsInChildren6[1]).material = new Material(((Renderer)componentsInChildren6[1]).material);
		((Renderer)componentsInChildren6[1]).material.DisableKeyword("VERTEXCOLOR");
		((Renderer)componentsInChildren6[1]).material.SetColor("_TintColor", Color.red);
		trackingOrbProjectile = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/LunarSkillReplacements/LunarNeedleProjectile.prefab"), "ShifterTrackingOrbProjectile", true);
		Object.Destroy((Object)(object)trackingOrbProjectile.GetComponent<ProjectileSingleTargetImpact>());
		Object.Destroy((Object)(object)trackingOrbProjectile.GetComponent<ProjectileStickOnImpact>());
		ProjectileController component4 = trackingOrbProjectile.GetComponent<ProjectileController>();
		component4.ghostPrefab = trackingOrbProjectileGhost;
		component4.flightSoundLoop = Load<LoopSoundDef>("RoR2/DLC1/VoidSurvivor/lsdVoidMegaBlasterFlight.asset");
		component4.canImpactOnTrigger = true;
		trackingOrbProjectile.GetComponent<ProjectileSteerTowardTarget>().rotationSpeed = 315f;
		ProjectileSimple component5 = trackingOrbProjectile.GetComponent<ProjectileSimple>();
		((Behaviour)component5).enabled = false;
		component5.desiredForwardSpeed = MainPlugin.primarySpeed.Value;
		component5.lifetime = 12f;
		trackingOrbProjectile.AddComponent<DelayedProjectile>();
		ProjectileImpactExplosion component6 = trackingOrbProjectile.GetComponent<ProjectileImpactExplosion>();
		component6.impactEffect = trackingOrbImpactEffect;
		((ProjectileExplosion)component6).blastRadius = 2f;
		((ProjectileExplosion)component6).blastDamageCoefficient = 1f;
		component6.timerAfterImpact = false;
		component6.destroyOnEnemy = true;
		component6.destroyOnWorld = false;
		component6.lifetime = 12f;
		((Collider)trackingOrbProjectile.GetComponent<SphereCollider>()).isTrigger = true;
		ContentAddition.AddProjectile(trackingOrbProjectile);
		freezingWaveProjectileGhost = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/DLC1/PrimarySkillShuriken/ShurikenGhost.prefab"), "ShifterFreezingWaveGhost", false);
		Transform child = freezingWaveProjectileGhost.transform.GetChild(0);
		child.localScale = MainPlugin.freezeProjectileEffectSize.Value;
		child.localRotation = Quaternion.Euler(0f, -90f, 0f);
		Object.Destroy((Object)(object)freezingWaveProjectileGhost.GetComponentInChildren<SetRandomRotation>());
		Object.Destroy((Object)(object)freezingWaveProjectileGhost.GetComponentInChildren<RotateAroundAxis>(true));
		EnumerableExtensions.ForEachTry<MeshRenderer>((IEnumerable<MeshRenderer>)freezingWaveProjectileGhost.GetComponentsInChildren<MeshRenderer>(), (Action<MeshRenderer>)delegate(MeshRenderer x)
		{
			((Renderer)x).enabled = false;
		}, (IDictionary<MeshRenderer, Exception>)null);
		TrailRenderer componentInChildren4 = freezingWaveProjectileGhost.GetComponentInChildren<TrailRenderer>(true);
		((Component)componentInChildren4).gameObject.SetActive(true);
		((Renderer)componentInChildren4).material = Load<Material>("RoR2/DLC1/VoidSurvivor/matVoidBlinkTrailCorrupted.mat");
		componentInChildren4.textureMode = (LineTextureMode)0;
		componentInChildren4.widthMultiplier = 0f;
		TrailRenderer val14 = Object.Instantiate<TrailRenderer>(componentInChildren4);
		((Component)val14).transform.parent = ((Component)componentInChildren4).transform.parent;
		((Component)val14).transform.localRotation = Quaternion.Euler(90f, 0f, 0f);
		((Component)val14).transform.localPosition = Vector3.up * 2f;
		val14.widthMultiplier = 14f;
		TrailRenderer val15 = Object.Instantiate<TrailRenderer>(componentInChildren4);
		((Component)val15).transform.parent = ((Component)componentInChildren4).transform.parent;
		((Component)val15).transform.localRotation = Quaternion.Euler(90f, 0f, 0f);
		((Component)val15).transform.localPosition = Vector3.up * -2f;
		val15.widthMultiplier = 14f;
		ParticleSystemRenderer[] componentsInChildren7 = freezingWaveProjectileGhost.GetComponentsInChildren<ParticleSystemRenderer>();
		((Renderer)componentsInChildren7[0]).material = new Material(Load<Material>("RoR2/DLC1/VoidMegaCrab/matVoidCrabAntiMatterParticleBillboard.mat"));
		((Renderer)componentsInChildren7[0]).material.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampImp2.png"));
		((Renderer)componentsInChildren7[0]).material.DisableKeyword("VERTEXCOLOR");
		((Renderer)componentsInChildren7[0]).material.SetColor("_TintColor", Color.red);
		((Renderer)componentsInChildren7[1]).enabled = false;
		ParticleSystem component7 = ((Component)componentsInChildren7[0]).GetComponent<ParticleSystem>();
		Vector3 startRotation3D = component7.startRotation3D;
		((Vector3)(ref startRotation3D)).Set(0f, 0f, 0f);
		RotationOverLifetimeModule rotationOverLifetime = component7.rotationOverLifetime;
		((RotationOverLifetimeModule)(ref rotationOverLifetime)).enabled = false;
		freezingWaveProjectile = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Commando/FMJRamping.prefab"), "ShifterFreezingWaveProjectile", true);
		freezingWaveProjectile.GetComponent<ProjectileDamage>().damageType = (DamageType)256;
		ProjectileSimple component8 = freezingWaveProjectile.GetComponent<ProjectileSimple>();
		component8.desiredForwardSpeed = MainPlugin.secondarySpeed.Value;
		component8.lifetime = 15f;
		ProjectileController component9 = freezingWaveProjectile.GetComponent<ProjectileController>();
		component9.ghostPrefab = freezingWaveProjectileGhost;
		component9.flightSoundLoop = Load<LoopSoundDef>("RoR2/DLC1/VoidJailer/lsdJailerDart.asset");
		ProjectileOverlapAttack component10 = freezingWaveProjectile.GetComponent<ProjectileOverlapAttack>();
		component10.impactEffect = Load<GameObject>("RoR2/Base/Mage/MageIceExplosion.prefab");
		((Component)freezingWaveProjectile.GetComponent<HitBoxGroup>().hitBoxes[0]).gameObject.transform.localScale = MainPlugin.freezeProjectileHitboxSize.Value;
		ContentAddition.AddProjectile(freezingWaveProjectile);
		executeLineImpactEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Nullifier/NullifierExplosion.prefab"), "ShifterExecuteLineImpactEffect", false);
		MeshRenderer componentInChildren5 = executeLineImpactEffect.GetComponentInChildren<MeshRenderer>();
		Material val16 = new Material(Load<Material>("RoR2/Base/Nullifier/matNullifierGemPortal.mat"));
		val16.SetColor("_Color", Color.red);
		Material val17 = new Material(Load<Material>("RoR2/Base/Common/VFX/matGravsphereCore.mat"));
		val17.SetColor("_TintColor", Color.red);
		((Renderer)componentInChildren5).sharedMaterials = (Material[])(object)new Material[2] { val16, val17 };
		ParticleSystemRenderer[] componentsInChildren8 = executeLineImpactEffect.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val18 in componentsInChildren8)
		{
			((Renderer)val18).material = new Material(((Renderer)val18).material);
			((Renderer)val18).material.DisableKeyword("VERTEXCOLOR");
			((Renderer)val18).material.SetColor("_TintColor", Color.red);
		}
		Utils.RegisterEff