Decompiled source of MoreArtifacts v1.0.0

MoreArtifacts.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using EntityStates;
using EntityStates.Merc;
using On.RoR2;
using On.RoR2.Items;
using On.RoR2.Skills;
using R2API;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Items;
using RoR2.Navigation;
using RoR2.Skills;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.UI;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: CompilationRelaxations(8)]
[assembly: AssemblyCompany("MoreArtifacts")]
[assembly: AssemblyProduct("MoreArtifacts")]
[assembly: AssemblyTitle("MoreArtifacts")]
[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 MoreArtifacts;

internal class Artifacts
{
	internal static ArtifactDef xpGain;

	internal static ArtifactDef goldGain;

	internal static ArtifactDef noLevelCap;

	internal static ArtifactDef monsterDrops;

	internal static ArtifactDef diffPauseOnTeleporterCharge;

	internal static ArtifactDef diffPauseWhileNoInteraction;

	internal static ArtifactDef preventOutOfCombat;

	internal static ArtifactDef shieldHealing;

	internal static ArtifactDef freeLunarInteraction;

	internal static ArtifactDef killsHeal;

	internal static ArtifactDef freeVoidItems;

	internal static ArtifactDef enemyHitsBleed;

	internal static ArtifactDef enemyHitsBurn;

	internal static ArtifactDef enemyHitsCollapse;

	internal static ArtifactDef enemyHitsSlow;

	internal static ArtifactDef enemyHitsRoot;

	internal static ArtifactDef enemyHitsPoison;

	internal static ArtifactDef lunarItemOnStageStart;

	internal static ArtifactDef enablePVP;

	internal static ArtifactDef playersAreVoid;

	internal static ArtifactDef itemsGetCorrupted;

	internal static ArtifactDef itemsCostHP;

	internal static ArtifactDef voidSeedSpawns;

	internal static ArtifactDef permanentVoidFog;

	internal static ArtifactDef consumedItemsRestore;

	internal static ArtifactDef survivorPicks;

	internal static void CreateArtifacts()
	{
		//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)
		xpGain = NewArtifact("XPGAIN", "Growth", "Doubles XP received.");
		goldGain = NewArtifact("GOLDGAIN", "Wealth", "Doubles gold received.");
		noLevelCap = NewArtifact("NOLEVELCAP", "Potential", "Removes level cap.");
		monsterDrops = NewArtifact("MONSTERDROPS", "Gain", "Monsters drop items on death.");
		diffPauseOnTeleporterCharge = NewArtifact("DIFFPAUSETELEPORTER", "Seeker", "Time stops after fully charging the Teleporter.");
		diffPauseWhileNoInteraction = NewArtifact("DIFFPAUSEOMTERACTION", "Rest", "Time and enemy spawns stop at the start of the stage. Resumes after interaction or using skills.");
		preventOutOfCombat = NewArtifact("PREVENTOUTOFCOMBAT", "Rejuvenation", "Damage no longer puts you out of combat or danger.");
		shieldHealing = NewArtifact("SHIELDHEALING", "Heal Shield", "Shields can be healed.");
		freeLunarInteraction = NewArtifact("FREELUNAR", "Lunar Deflate", "Lunar interactables have no cost, but enemies no longer drop Lunar Coins.");
		killsHeal = NewArtifact("KILLSHEAL", "Vampire", "Kills heal " + MainPlugin.killsHealPercentage.Value * 100f + "% + " + MainPlugin.killsHealFlat.Value + " health.");
		freeVoidItems = NewArtifact("FREEVOIDITEMS", "Incorruptible", "Items no longer get corrupted.");
		enemyHitsBleed = NewArtifact("ENEMYHITBLEED", "Suffering", "Enemy attacks bleed.");
		enemyHitsBurn = NewArtifact("ENEMYHITBURN", "Burning", "Enemy attacks burn.");
		enemyHitsCollapse = NewArtifact("ENEMYHITCOLLAPSE", "Fading", "Enemy attacks collapse.");
		enemyHitsSlow = NewArtifact("ENEMYHITSLOW", "Staying", "Enemy attacks slow.");
		enemyHitsRoot = NewArtifact("ENEMYHITROOT", "Detaining", "Enemy attacks root.");
		enemyHitsPoison = NewArtifact("ENEMYHITPOISON", "Decaying", "Enemy attacks poison.");
		lunarItemOnStageStart = NewArtifact("LUNARITEMONSTAGESTART", "Lunar Cycle", "Gain 1 Lunar item at the start of the stage.");
		enablePVP = NewArtifact("ENABLEPVP", "Combat", "Enables PVP.");
		playersAreVoid = NewArtifact("VOIDPLAYERS", "Void", "Player characters are Void.");
		itemsGetCorrupted = NewArtifact("CORRUPTITEMS", "Corruption", "Items are corrupted automatically.");
		itemsCostHP = NewArtifact("ITEMSCOSTHP", "Blood Money", "Interactables that reward items cost health instead.");
		voidSeedSpawns = NewArtifact("VOIDSEEDSPAWNS", "Void Flood", "Void seed spawns are guaranteed on every stage.");
		permanentVoidFog = NewArtifact("PERMANENTFOG", "Void Fog", "All stages are affected by the Void Fog.");
		consumedItemsRestore = NewArtifact("CONSUMEDITEMSRESTORE", "Restore", "Consumed items are restored to their original state at the start of the stage.");
		KeyCode value = MainPlugin.survivorPickKey.Value;
		survivorPicks = NewArtifact("SURVIVORPICKS", "Militia", "Press " + ((object)(KeyCode)(ref value)).ToString() + " to open a survivor selection menu, allowing you to swap to another survivor. Allows you to pick another survivor on death, but locks the ones you have died with.");
	}

	internal static ArtifactDef NewArtifact(string token, string name, string description, Sprite smallIconSelectedSprite = null, Sprite smallIconDeselectedSprite = null)
	{
		LanguageAPI.Add("MOREARTIFACTS_" + token + "_NAME", "Artifact of " + name);
		LanguageAPI.Add("MOREARTIFACTS_" + token + "_DESCRIPTION", description);
		ArtifactDef val = ScriptableObject.CreateInstance<ArtifactDef>();
		val.cachedName = "MOREARTIFACTS_" + token;
		val.nameToken = "MOREARTIFACTS_" + token + "_NAME";
		val.descriptionToken = "MOREARTIFACTS_" + token + "_DESCRIPTION";
		string text = name.Replace(" ", "").ToLower();
		Sprite val2 = Assets.Load<Sprite>(text);
		val.smallIconSelectedSprite = (Object.op_Implicit((Object)(object)val2) ? val2 : Prefabs.Load<Sprite>("RoR2/Junk/Misc/texHandSelect.png"));
		val.smallIconDeselectedSprite = (Object.op_Implicit((Object)(object)val2) ? Assets.Load<Sprite>(text + "Disabled") : Prefabs.Load<Sprite>("RoR2/Junk/Misc/texHandSelectDisabled.png"));
		ContentAddition.AddArtifactDef(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("MoreArtifacts.AssetBundle." + "MoreArtifacts".ToLower() + "assets"))
			{
				MainAssetBundle = AssetBundle.LoadFromStream(stream);
			}
		}
	}
}
internal class Behaviour : MonoBehaviour
{
	private CharacterBody body;

	private void Awake()
	{
		body = ((Component)this).GetComponent<CharacterBody>();
	}
}
internal class SurvivorPanelBehaviour : MonoBehaviour
{
	public SurvivorPickBehaviour 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()
	{
		buttonAllocator = new UIElementAllocator<MPButton>(buttonContainer, buttonPrefab, true, false);
		buttonAllocator.onCreateElement = OnCreateButton;
	}

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

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

	private void Respawn(int index)
	{
		if (Object.op_Implicit((Object)(object)behaviour))
		{
			behaviour.CallCmdRespawn(index);
		}
	}

	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
		{
			Respawn(index);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		});
	}

	public void SetPickupOptions(ref Dictionary<SurvivorDef, bool> picks)
	{
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0196: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: 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_0289: Unknown result type (might be due to invalid IL or missing references)
		//IL_028e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0295: Unknown result type (might be due to invalid IL or missing references)
		//IL_029a: Unknown result type (might be due to invalid IL or missing references)
		int count = picks.Count;
		buttonAllocator.AllocateElements(count);
		ReadOnlyCollection<MPButton> elements = buttonAllocator.elements;
		Sprite texUnlockIcon = Prefabs.texUnlockIcon;
		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_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			((Graphic)x).color = ((Graphic)x).color * Color32.op_Implicit(new Color32((byte)148, (byte)174, (byte)240, byte.MaxValue));
		}, (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_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_001c: Unknown result type (might be due to invalid IL or missing references)
			((Graphic)x).color = ((Graphic)x).color * Color32.op_Implicit(new Color32((byte)70, (byte)82, (byte)112, byte.MaxValue));
		}, (IDictionary<Image, Exception>)null);
		for (int i = 0; i < count; i++)
		{
			SurvivorDef val = Prefabs.survivors[i];
			MPButton val2 = 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)val2).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 < count)
			{
				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 < count)
			{
				MPButton selectOnDown = elements[num + num6];
				((Navigation)(ref navigation)).selectOnDown = (Selectable)(object)selectOnDown;
			}
			((Selectable)val2).navigation = navigation;
			Image component = ((Component)((Component)val2).GetComponent<ChildLocator>().FindChild("Icon")).GetComponent<Image>();
			bool flag = val.CheckRequiredExpansionEnabled((NetworkUser)null);
			bool flag2 = !Object.op_Implicit((Object)(object)val.unlockableDef) || Run.instance.IsUnlockableUnlocked(val.unlockableDef);
			if (flag && flag2 && !picks[val])
			{
				((Graphic)component).color = Color.white;
				component.sprite = Prefabs.survivorSprites[i];
				((Selectable)val2).interactable = true;
			}
			else
			{
				((Graphic)component).color = Color.gray;
				component.sprite = texUnlockIcon;
				((Selectable)val2).interactable = false;
				picks[val] = true;
			}
			string displayNameToken = val.displayNameToken;
			TooltipProvider val3 = ((Component)val2).gameObject.AddComponent<TooltipProvider>();
			val3.titleToken = displayNameToken;
			val3.bodyToken = "";
			val3.titleColor = val.primaryColor;
			val3.bodyColor = Color.gray;
		}
	}
}
internal class SurvivorPickBehaviour : NetworkBehaviour
{
	private bool initialized;

	public Dictionary<SurvivorDef, bool> survivorPicks = new Dictionary<SurvivorDef, bool>();

	public CharacterMaster master;

	private bool enabled;

	private GameObject panelInstance;

	private static int kCmdCmdRespawn;

	public bool hasPicksLeft
	{
		get
		{
			if (!initialized)
			{
				Init();
			}
			return survivorPicks.ContainsValue(value: false);
		}
	}

	private void Awake()
	{
		Init();
		master = ((Component)this).GetComponent<CharacterMaster>();
	}

	private void Start()
	{
		enabled = Utils.isArtifactEnabled(Artifacts.survivorPicks);
	}

	[Command]
	public void CmdRespawn(int index)
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)master))
		{
			Vector3 val = ((master.deathFootPosition != Vector3.zero) ? master.deathFootPosition : Utils.FindNearestNodePosition(Vector3.zero, (GraphType)0));
			master.bodyPrefab = Prefabs.survivors[index].bodyPrefab;
			master.Respawn(val, Quaternion.identity, true);
		}
	}

	private void Init()
	{
		if (initialized)
		{
			return;
		}
		initialized = true;
		foreach (SurvivorDef survivor in Prefabs.survivors)
		{
			survivorPicks.Add(survivor, value: false);
		}
	}

	public void AddPick(SurvivorDef s)
	{
		if (survivorPicks.ContainsKey(s))
		{
			survivorPicks[s] = true;
		}
	}

	public void SpawnPanel()
	{
		if (((NetworkBehaviour)master).hasAuthority && !Object.op_Implicit((Object)(object)panelInstance))
		{
			HUD val = HUD.instancesList.Find((HUD x) => (Object)(object)x.targetMaster == (Object)(object)master);
			if (Object.op_Implicit((Object)(object)val))
			{
				panelInstance = Object.Instantiate<GameObject>(Prefabs.survivorSelectionPanel, val.mainContainer.transform);
				SurvivorPanelBehaviour component = panelInstance.GetComponent<SurvivorPanelBehaviour>();
				component.behaviour = this;
				component.SetPickupOptions(ref survivorPicks);
			}
		}
	}

	private void FixedUpdate()
	{
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		if (enabled && Object.op_Implicit((Object)(object)master) && ((NetworkBehaviour)master).hasAuthority && Input.GetKeyDown(MainPlugin.survivorPickKey.Value))
		{
			SpawnPanel();
		}
	}

	private void UNetVersion()
	{
	}

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

	public void CallCmdRespawn(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 CmdRespawn called on server.");
			return;
		}
		if (((NetworkBehaviour)this).isServer)
		{
			CmdRespawn(index);
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)5);
		val.WritePackedUInt32((uint)kCmdCmdRespawn);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		val.WritePackedUInt32((uint)index);
		((NetworkBehaviour)this).SendCommandInternal(val, 0, "CmdRespawn");
	}

	static SurvivorPickBehaviour()
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Expected O, but got Unknown
		kCmdCmdRespawn = 935522018;
		NetworkBehaviour.RegisterCommandDelegate(typeof(SurvivorPickBehaviour), kCmdCmdRespawn, new CmdDelegate(InvokeCmdCmdRespawn));
		NetworkCRC.RegisterBehaviour("SurvivorPickBehaviour", 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 TimeStopBehaviour : NetworkBehaviour
{
	[SyncVar]
	public bool interaction;

	public static TimeStopBehaviour instance;

	public bool give;

	public ulong exp = 20uL;

	public bool Networkinteraction
	{
		get
		{
			return interaction;
		}
		[param: In]
		set
		{
			((NetworkBehaviour)this).SetSyncVar<bool>(value, ref interaction, 1u);
		}
	}

	private void OnEnable()
	{
		if (Object.op_Implicit((Object)(object)instance))
		{
			Object.Destroy((Object)(object)((Component)instance).gameObject);
		}
		instance = this;
	}

	public void Destroy()
	{
		instance = null;
		Object.Destroy((Object)(object)((Component)this).gameObject);
	}

	private void FixedUpdate()
	{
		if (give)
		{
			give = false;
			TeamManager.instance.GiveTeamExperience((TeamIndex)1, exp);
		}
	}

	private void UNetVersion()
	{
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		if (forceAll)
		{
			writer.Write(interaction);
			return true;
		}
		bool flag = false;
		if ((((NetworkBehaviour)this).syncVarDirtyBits & (true ? 1u : 0u)) != 0)
		{
			if (!flag)
			{
				writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits);
				flag = true;
			}
			writer.Write(interaction);
		}
		if (!flag)
		{
			writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits);
		}
		return flag;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
		if (initialState)
		{
			interaction = reader.ReadBoolean();
			return;
		}
		int num = (int)reader.ReadPackedUInt32();
		if (((uint)num & (true ? 1u : 0u)) != 0)
		{
			interaction = reader.ReadBoolean();
		}
	}
}
internal class VoidCampTracker : MonoBehaviour
{
	private void OnEnable()
	{
		InstanceTracker.Add<VoidCampTracker>(this);
	}

	private void OnDisable()
	{
		InstanceTracker.Remove<VoidCampTracker>(this);
	}
}
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_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
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Expected O, but got Unknown
		//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Expected O, but got Unknown
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Expected O, but got Unknown
		//IL_0128: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Expected O, but got Unknown
		//IL_013a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0144: Expected O, but got Unknown
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0156: Expected O, but got Unknown
		//IL_015e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: Expected O, but got Unknown
		//IL_0182: Unknown result type (might be due to invalid IL or missing references)
		//IL_018c: Expected O, but got Unknown
		//IL_0194: Unknown result type (might be due to invalid IL or missing references)
		//IL_019e: Expected O, but got Unknown
		//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b0: Expected O, but got Unknown
		TeamManager.GiveTeamExperience += new hook_GiveTeamExperience(TeamManager_GiveTeamExperience);
		CharacterMaster.GiveMoney += new hook_GiveMoney(CharacterMaster_GiveMoney);
		Stage.onServerStageBegin += Stage_onServerStageBegin;
		TeleporterInteraction.onTeleporterChargedGlobal += TeleporterInteraction_onTeleporterChargedGlobal;
		GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal;
		CharacterBody.OnTakeDamageServer += new hook_OnTakeDamageServer(CharacterBody_OnTakeDamageServer);
		FriendlyFireManager.ShouldDirectHitProceed += new hook_ShouldDirectHitProceed(FriendlyFireManager_ShouldDirectHitProceed);
		FriendlyFireManager.ShouldSeekingProceed += new hook_ShouldSeekingProceed(FriendlyFireManager_ShouldSeekingProceed);
		FriendlyFireManager.ShouldSplashHitProceed += new hook_ShouldSplashHitProceed(FriendlyFireManager_ShouldSplashHitProceed);
		CombatDirector.FixedUpdate += new hook_FixedUpdate(CombatDirector_FixedUpdate);
		GlobalEventManager.OnInteractionsGlobal += GlobalEventManager_OnInteractionsGlobal;
		SkillDef.OnExecute += new hook_OnExecute(SkillDef_OnExecute);
		Run.ShouldUpdateRunStopwatch += new hook_ShouldUpdateRunStopwatch(Run_ShouldUpdateRunStopwatch);
		HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
		CharacterBody.onBodyStartGlobal += CharacterBody_onBodyStartGlobal;
		HealthComponent.onCharacterHealServer += HealthComponent_onCharacterHealServer;
		PurchaseInteraction.Start += new hook_Start(PurchaseInteraction_Start);
		GenericPickupController.Start += new hook_Start(GenericPickupController_Start);
		ContagiousItemManager.OnInventoryChangedGlobal += new hook_OnInventoryChangedGlobal(ContagiousItemManager_OnInventoryChangedGlobal);
		ContagiousItemManager.TryForceReplacement += new hook_TryForceReplacement(ContagiousItemManager_TryForceReplacement);
		Inventory.onServerItemGiven += Inventory_onServerItemGiven;
		TeamManager.SetTeamExperience += new hook_SetTeamExperience(TeamManager_SetTeamExperience);
		SurvivorCatalog.Init += new hook_Init(SurvivorCatalog_Init);
		CharacterMaster.OnBodyDeath += new hook_OnBodyDeath(CharacterMaster_OnBodyDeath);
	}

	private static void CharacterMaster_OnBodyDeath(orig_OnBodyDeath orig, CharacterMaster self, CharacterBody body)
	{
		if (Object.op_Implicit((Object)(object)self.playerCharacterMasterController) && Utils.isArtifactEnabled(Artifacts.survivorPicks) && self.IsDeadAndOutOfLivesServer())
		{
			SurvivorPickBehaviour survivorPickBehaviour = ((Component)self).GetComponent<SurvivorPickBehaviour>();
			if (!Object.op_Implicit((Object)(object)survivorPickBehaviour))
			{
				survivorPickBehaviour = ((Component)self).gameObject.AddComponent<SurvivorPickBehaviour>();
			}
			SurvivorDef val = SurvivorCatalog.FindSurvivorDefFromBody(self.bodyPrefab);
			if (Object.op_Implicit((Object)(object)val))
			{
				survivorPickBehaviour.AddPick(val);
			}
			if (survivorPickBehaviour.hasPicksLeft)
			{
				survivorPickBehaviour.SpawnPanel();
				return;
			}
		}
		orig.Invoke(self, body);
	}

	private static void SurvivorCatalog_Init(orig_Init orig)
	{
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Expected O, but got Unknown
		orig.Invoke();
		SurvivorDef[] survivorDefs = SurvivorCatalog.survivorDefs;
		foreach (SurvivorDef val in survivorDefs)
		{
			if (!val.hidden && Object.op_Implicit((Object)(object)val.bodyPrefab))
			{
				Prefabs.survivors.Add(val);
				CharacterBody component = val.bodyPrefab.GetComponent<CharacterBody>();
				Prefabs.survivorSprites.Add(Object.op_Implicit((Object)(object)component.portraitIcon) ? Utils.CreateSprite((Texture2D)component.portraitIcon) : null);
			}
		}
		int count = Prefabs.survivors.Count;
		RectTransform component2 = ((Component)Prefabs.survivorSelectionPanel.GetComponentInChildren<GridLayoutGroup>()).GetComponent<RectTransform>();
		component2.sizeDelta += Vector2.up * (float)count * 14.5f;
		((Transform)component2).localPosition = Vector2.op_Implicit(Vector2.up * (float)count * -25.7f);
	}

	private static void TeamManager_SetTeamExperience(orig_SetTeamExperience orig, TeamManager self, TeamIndex teamIndex, ulong newExperience)
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0112: 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_004b: 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_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: 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_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
		if (Utils.isArtifactEnabled(Artifacts.noLevelCap) && self.teamLevels[teamIndex] >= 94)
		{
			if (newExperience > TeamManager.hardExpCap)
			{
				newExperience = TeamManager.hardExpCap;
			}
			self.teamExperience[teamIndex] = newExperience;
			uint num = self.teamLevels[teamIndex];
			ulong experienceForLevel = TeamManager.GetExperienceForLevel(94u);
			if (newExperience >= experienceForLevel)
			{
				self.teamExperience[teamIndex] = TeamManager.GetExperienceForLevel(93u);
				self.teamLevels[teamIndex] = num + 1;
				ReadOnlyCollection<TeamComponent> teamMembers = TeamComponent.GetTeamMembers(teamIndex);
				for (int i = 0; i < teamMembers.Count; i++)
				{
					CharacterBody component = ((Component)teamMembers[i]).GetComponent<CharacterBody>();
					if (Object.op_Implicit((Object)(object)component))
					{
						component.OnTeamLevelChanged();
					}
				}
				self.teamCurrentLevelExperience[teamIndex] = TeamManager.GetExperienceForLevel(93u);
				self.teamNextLevelExperience[teamIndex] = TeamManager.GetExperienceForLevel(94u);
				GlobalEventManager.OnTeamLevelUp(teamIndex);
			}
			if (NetworkServer.active)
			{
				((NetworkBehaviour)self).SetDirtyBit((uint)(1 << (int)teamIndex));
			}
		}
		else
		{
			orig.Invoke(self, teamIndex, newExperience);
		}
	}

	private static void ContagiousItemManager_TryForceReplacement(orig_TryForceReplacement orig, Inventory inventory, ItemIndex originalItemIndex)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		if (!Utils.isArtifactEnabled(Artifacts.freeVoidItems))
		{
			orig.Invoke(inventory, originalItemIndex);
		}
	}

	private static void Inventory_onServerItemGiven(Inventory inventory, ItemIndex itemIndex, int count)
	{
		//IL_0035: 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)
		if (!Utils.isArtifactEnabled(Artifacts.itemsGetCorrupted) || Utils.isArtifactEnabled(Artifacts.freeVoidItems))
		{
			return;
		}
		for (int i = 0; i < ContagiousItemManager._transformationInfos.Length; i++)
		{
			if (inventory.GetItemCount(ContagiousItemManager._transformationInfos[i].originalItem) > 0)
			{
				ContagiousItemManager.TryForceReplacement(inventory, itemIndex);
			}
		}
	}

	private static void ContagiousItemManager_OnInventoryChangedGlobal(orig_OnInventoryChangedGlobal orig, Inventory inventory)
	{
		if (!Utils.isArtifactEnabled(Artifacts.freeVoidItems))
		{
			orig.Invoke(inventory);
		}
	}

	private static void GenericPickupController_Start(orig_Start orig, GenericPickupController self)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		orig.Invoke(self);
		if (self.pickupIndex == PickupCatalog.FindPickupIndex("LunarCoin.Coin0") && Utils.isArtifactEnabled(Artifacts.freeLunarInteraction))
		{
			Object.Destroy((Object)(object)((Component)self).gameObject);
		}
	}

	private static void PurchaseInteraction_Start(orig_Start orig, PurchaseInteraction self)
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Invalid comparison between Unknown and I4
		//IL_02be: 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_0279: Unknown result type (might be due to invalid IL or missing references)
		//IL_0300: Unknown result type (might be due to invalid IL or missing references)
		//IL_0255: Unknown result type (might be due to invalid IL or missing references)
		//IL_029d: Unknown result type (might be due to invalid IL or missing references)
		orig.Invoke(self);
		if (!NetworkServer.active)
		{
			return;
		}
		if ((int)self.costType == 3 && Utils.isArtifactEnabled(Artifacts.freeLunarInteraction))
		{
			self.Networkcost = 0;
		}
		if (Utils.isArtifactEnabled(Artifacts.itemsCostHP))
		{
			switch (self.displayNameToken)
			{
			case "CHEST1_NAME":
			case "EQUIPMENTBARREL_NAME":
			case "MULTISHOP_TERMINAL_NAME":
				self.costType = (CostTypeIndex)2;
				self.Networkcost = MainPlugin.itemCostTier1.Value;
				self.automaticallyScaleCostWithDifficulty = false;
				break;
			case "CHEST2_NAME":
			case "CASINOCHEST_NAME":
				self.costType = (CostTypeIndex)2;
				self.Networkcost = MainPlugin.itemCostTier2.Value;
				self.automaticallyScaleCostWithDifficulty = false;
				break;
			case "GOLDCHEST_NAME":
				self.costType = (CostTypeIndex)2;
				self.Networkcost = MainPlugin.itemCostTier3.Value;
				self.automaticallyScaleCostWithDifficulty = false;
				break;
			case "SHRINE_CHANCE_NAME":
				self.costType = (CostTypeIndex)2;
				self.Networkcost = MainPlugin.itemCostChance.Value;
				self.automaticallyScaleCostWithDifficulty = false;
				break;
			case "CATEGORYCHEST_HEALING_NAME":
			case "CATEGORYCHEST_DAMAGE_NAME":
			case "CATEGORYCHEST_UTILITY_NAME":
				self.costType = (CostTypeIndex)2;
				self.Networkcost = MainPlugin.itemCostCategory.Value;
				self.automaticallyScaleCostWithDifficulty = false;
				break;
			case "CATEGORYCHEST2_HEALING_NAME":
			case "CATEGORYCHEST2_DAMAGE_NAME":
			case "CATEGORYCHEST2_UTILITY_NAME":
				self.costType = (CostTypeIndex)2;
				self.Networkcost = MainPlugin.itemCostCategory2.Value;
				self.automaticallyScaleCostWithDifficulty = false;
				break;
			}
		}
	}

	private static void HealthComponent_onCharacterHealServer(HealthComponent health, float amount, ProcChainMask proc)
	{
		if (health.body.isPlayerControlled && Utils.isArtifactEnabled(Artifacts.shieldHealing))
		{
			health.RechargeShield(amount);
		}
	}

	private static void CharacterBody_onBodyStartGlobal(CharacterBody body)
	{
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: 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)
		if (!body.isPlayerControlled || !Utils.isArtifactEnabled(Artifacts.playersAreVoid))
		{
			return;
		}
		if (MainPlugin.enableVoidElite.Value)
		{
			body.AddBuff(Buffs.EliteVoid);
			return;
		}
		body.bodyFlags = (BodyFlags)(body.bodyFlags | 0x400);
		if (MainPlugin.enableVoidTeam.Value)
		{
			body.teamComponent.teamIndex = (TeamIndex)4;
			body.master.teamIndex = (TeamIndex)4;
		}
	}

	private static void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: 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_0123: Invalid comparison between Unknown and I4
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: 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_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: 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_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0184: Unknown result type (might be due to invalid IL or missing references)
		CharacterBody val = (Object.op_Implicit((Object)(object)damageInfo.attacker) ? damageInfo.attacker.GetComponent<CharacterBody>() : null);
		int num;
		if (!Object.op_Implicit((Object)(object)val))
		{
			num = 0;
		}
		else
		{
			TeamMask enemyTeams = TeamMask.GetEnemyTeams((TeamIndex)1);
			num = (((TeamMask)(ref enemyTeams)).HasTeam(val.teamComponent.teamIndex) ? 1 : 0);
		}
		bool flag = (byte)num != 0;
		bool flag2 = damageInfo.procCoefficient > 0f;
		if (flag && flag2)
		{
			if (Utils.isArtifactEnabled(Artifacts.enemyHitsBleed))
			{
				damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)1024);
			}
			if (Utils.isArtifactEnabled(Artifacts.enemyHitsBurn))
			{
				damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)128);
			}
			if (Utils.isArtifactEnabled(Artifacts.enemyHitsPoison))
			{
				damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)4096);
			}
			if (Utils.isArtifactEnabled(Artifacts.enemyHitsSlow))
			{
				damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)8);
			}
		}
		if (self.body.isPlayerControlled && (int)damageInfo.damageColorIndex == 9 && Utils.isArtifactEnabled(Artifacts.playersAreVoid))
		{
			damageInfo.rejected = true;
			damageInfo.damage = 0f;
		}
		orig.Invoke(self, damageInfo);
		if (flag && !damageInfo.rejected && flag2)
		{
			if (Utils.isArtifactEnabled(Artifacts.enemyHitsCollapse))
			{
				ProcChainMask procChainMask = damageInfo.procChainMask;
				((ProcChainMask)(ref procChainMask)).AddProc((ProcType)19);
				DotDef dotDef = DotController.GetDotDef((DotIndex)8);
				DotController.InflictDot(((Component)self).gameObject, damageInfo.attacker, (DotIndex)8, dotDef.interval, 1f, (uint?)uint.MaxValue);
			}
			if (Utils.isArtifactEnabled(Artifacts.enemyHitsRoot))
			{
				self.body.AddTimedBuff(Buffs.Entangle, 0.5f);
			}
		}
	}

	private static bool Run_ShouldUpdateRunStopwatch(orig_ShouldUpdateRunStopwatch orig, Run self)
	{
		if (Object.op_Implicit((Object)(object)TimeStopBehaviour.instance))
		{
			return false;
		}
		return orig.Invoke(self);
	}

	private static void SkillDef_OnExecute(orig_OnExecute orig, SkillDef self, GenericSkill skillSlot)
	{
		orig.Invoke(self, skillSlot);
		if (Utils.isArtifactEnabled(Artifacts.diffPauseWhileNoInteraction) && Object.op_Implicit((Object)(object)TimeStopBehaviour.instance) && TimeStopBehaviour.instance.interaction && Object.op_Implicit((Object)(object)skillSlot.characterBody) && skillSlot.characterBody.isPlayerControlled)
		{
			TimeStopBehaviour.instance.Destroy();
		}
	}

	private static void CombatDirector_FixedUpdate(orig_FixedUpdate orig, CombatDirector self)
	{
		if (!Object.op_Implicit((Object)(object)TimeStopBehaviour.instance))
		{
			orig.Invoke(self);
		}
	}

	private static void GlobalEventManager_OnInteractionsGlobal(Interactor interactor, IInteractable interactable, GameObject interactableObject)
	{
		if (Utils.isArtifactEnabled(Artifacts.diffPauseWhileNoInteraction) && Object.op_Implicit((Object)(object)TimeStopBehaviour.instance) && TimeStopBehaviour.instance.interaction && !Object.op_Implicit((Object)(object)interactableObject.GetComponent<SurvivorPodController>()))
		{
			CharacterBody component = ((Component)interactor).GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component) && component.isPlayerControlled)
			{
				TimeStopBehaviour.instance.Destroy();
			}
		}
	}

	private static void TeamManager_GiveTeamExperience(orig_GiveTeamExperience orig, TeamManager self, TeamIndex teamIndex, ulong experience)
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)RunArtifactManager.instance) && Utils.isArtifactEnabled(Artifacts.xpGain))
		{
			experience *= 2;
		}
		orig.Invoke(self, teamIndex, experience);
	}

	private static bool FriendlyFireManager_ShouldSplashHitProceed(orig_ShouldSplashHitProceed orig, HealthComponent victim, TeamIndex attackerTeamIndex)
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Invalid comparison between Unknown and I4
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		if (Utils.isArtifactEnabled(Artifacts.enablePVP) && victim.body.isPlayerControlled && (int)attackerTeamIndex == 1)
		{
			return true;
		}
		return orig.Invoke(victim, attackerTeamIndex);
	}

	private static bool FriendlyFireManager_ShouldSeekingProceed(orig_ShouldSeekingProceed orig, HealthComponent victim, TeamIndex attackerTeamIndex)
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Invalid comparison between Unknown and I4
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		if (Utils.isArtifactEnabled(Artifacts.enablePVP) && victim.body.isPlayerControlled && (int)attackerTeamIndex == 1)
		{
			return true;
		}
		return orig.Invoke(victim, attackerTeamIndex);
	}

	private static bool FriendlyFireManager_ShouldDirectHitProceed(orig_ShouldDirectHitProceed orig, HealthComponent victim, TeamIndex attackerTeamIndex)
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Invalid comparison between Unknown and I4
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		if (Utils.isArtifactEnabled(Artifacts.enablePVP) && victim.body.isPlayerControlled && (int)attackerTeamIndex == 1)
		{
			return true;
		}
		return orig.Invoke(victim, attackerTeamIndex);
	}

	private static void CharacterBody_OnTakeDamageServer(orig_OnTakeDamageServer orig, CharacterBody self, DamageReport damageReport)
	{
		orig.Invoke(self, damageReport);
		if (self.isPlayerControlled && Utils.isArtifactEnabled(Artifacts.preventOutOfCombat))
		{
			self.outOfDangerStopwatch = float.PositiveInfinity;
		}
	}

	private static void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport)
	{
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0248: Unknown result type (might be due to invalid IL or missing references)
		//IL_024e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_011e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_015e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_016d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: 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_0184: Unknown result type (might be due to invalid IL or missing references)
		//IL_0189: Unknown result type (might be due to invalid IL or missing references)
		//IL_019b: 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_01aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02de: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0308: 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_01de: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e8: 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)
		//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)damageReport.attackerBody) && damageReport.attackerBody.isPlayerControlled && Utils.isArtifactEnabled(Artifacts.killsHeal))
		{
			HealthComponent healthComponent = damageReport.attackerBody.healthComponent;
			healthComponent.Heal(healthComponent.fullHealth * MainPlugin.killsHealPercentage.Value + MainPlugin.killsHealFlat.Value, default(ProcChainMask), true);
		}
		if (MainPlugin.pvpItemDrop.Value && Utils.isArtifactEnabled(Artifacts.enablePVP) && Object.op_Implicit((Object)(object)damageReport.victimBody) && damageReport.victimBody.isPlayerControlled && Object.op_Implicit((Object)(object)damageReport.attackerBody) && damageReport.attackerBody.isPlayerControlled && Object.op_Implicit((Object)(object)damageReport.victimBody.master) && damageReport.victimBody.master.IsDeadAndOutOfLivesServer() && Object.op_Implicit((Object)(object)damageReport.victimBody.inventory))
		{
			Inventory inventory = damageReport.victimBody.inventory;
			List<ItemIndex> list = new List<ItemIndex>();
			foreach (ItemIndex item in inventory.itemAcquisitionOrder)
			{
				if (RoR2Application.rng.nextBool)
				{
					list.Add(item);
				}
			}
			Vector3 val = damageReport.victimBody.footPosition + Vector3.up * 1.5f;
			Vector3 forward = damageReport.victimBody.transform.forward;
			float num = 360f / (float)list.Count;
			Vector3 val2 = Vector3.up * 20f + forward * 2f;
			Quaternion val3 = Quaternion.AngleAxis(num, Vector3.up);
			foreach (ItemIndex item2 in list)
			{
				PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(item2), val, val2);
				val2 = val3 * val2;
			}
		}
		if (!Utils.isArtifactEnabled(Artifacts.monsterDrops) || !Object.op_Implicit((Object)(object)damageReport.victimMaster) || (damageReport.attackerTeamIndex == damageReport.victimTeamIndex && Object.op_Implicit((Object)(object)damageReport.victimMaster.minionOwnership.ownerMaster)))
		{
			return;
		}
		float expAdjustedDropChancePercent = Util.GetExpAdjustedDropChancePercent(5f, ((Component)damageReport.victim).gameObject);
		Debug.LogFormat("Drop chance from {0}: {1}", new object[2] { damageReport.victimBody, expAdjustedDropChancePercent });
		if (Util.CheckRoll(expAdjustedDropChancePercent, 0f, (CharacterMaster)null))
		{
			PickupIndex val4 = ((PickupDropTable)Prefabs.Load<BasicPickupDropTable>("RoR2/Base/Sacrifice/dtSacrificeArtifact.asset")).GenerateDrop(RoR2Application.rng);
			if (val4 != PickupIndex.none)
			{
				PickupDropletController.CreatePickupDroplet(val4, damageReport.victimBody.corePosition, Vector3.up * 20f);
			}
		}
	}

	private static void TeleporterInteraction_onTeleporterChargedGlobal(TeleporterInteraction teleporter)
	{
		if (NetworkServer.active && Utils.isArtifactEnabled(Artifacts.diffPauseOnTeleporterCharge))
		{
			GameObject val = Object.Instantiate<GameObject>(Prefabs.timeStopper);
			NetworkServer.Spawn(val);
		}
	}

	private static void Stage_onServerStageBegin(Stage stage)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Invalid comparison between Unknown and I4
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Expected O, but got Unknown
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Expected O, but got Unknown
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0284: Unknown result type (might be due to invalid IL or missing references)
		//IL_0289: Unknown result type (might be due to invalid IL or missing references)
		//IL_028b: Unknown result type (might be due to invalid IL or missing references)
		//IL_012c: 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_02ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_0128: 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_0167: Unknown result type (might be due to invalid IL or missing references)
		//IL_016c: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: 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_017a: Invalid comparison between Unknown and I4
		if ((int)stage.sceneDef.sceneType != 2)
		{
			if (Utils.isArtifactEnabled(Artifacts.permanentVoidFog))
			{
				NetworkServer.Spawn(Object.Instantiate<GameObject>(Prefabs.fogDamager));
			}
			if (Utils.isArtifactEnabled(Artifacts.voidSeedSpawns))
			{
				List<VoidCampTracker> instancesList = InstanceTracker.GetInstancesList<VoidCampTracker>();
				if (instancesList == null || instancesList.Count == 0)
				{
					DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(Prefabs.Load<SpawnCard>("RoR2/DLC1/VoidCamp/iscVoidCamp.asset"), new DirectorPlacementRule
					{
						placementMode = (PlacementMode)4
					}, RoR2Application.rng));
				}
			}
		}
		if (Utils.isArtifactEnabled(Artifacts.consumedItemsRestore))
		{
			foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
			{
				if (!Object.op_Implicit((Object)(object)instance.master) || !Object.op_Implicit((Object)(object)instance.master.inventory))
				{
					continue;
				}
				List<ItemDef> list = new List<ItemDef>();
				ItemIndex val = (ItemIndex)0;
				ItemIndex val2 = (ItemIndex)ItemCatalog.itemCount;
				ItemDef val3 = null;
				for (; val < val2; val = (ItemIndex)(val + 1))
				{
					ItemDef itemDef = ItemCatalog.GetItemDef(val);
					if (itemDef.isConsumed)
					{
						list.Add(itemDef);
					}
				}
				foreach (ItemDef item in list)
				{
					val = ItemCatalog.FindItemIndex(((Object)item).name.Replace("Consumed", ""));
					val3 = ItemCatalog.GetItemDef(val);
					if ((int)val != -1 && Object.op_Implicit((Object)(object)val3))
					{
						int itemCount = instance.master.inventory.GetItemCount(item);
						instance.master.inventory.RemoveItem(item, itemCount);
						instance.master.inventory.GiveItem(val3, itemCount);
					}
				}
			}
		}
		if (Utils.isArtifactEnabled(Artifacts.lunarItemOnStageStart))
		{
			foreach (PlayerCharacterMasterController instance2 in PlayerCharacterMasterController.instances)
			{
				if (Object.op_Implicit((Object)(object)instance2.master) && Object.op_Implicit((Object)(object)instance2.master.inventory))
				{
					List<PickupIndex> availableLunarItemDropList = Run.instance.availableLunarItemDropList;
					PickupIndex val4 = availableLunarItemDropList[RoR2Application.rng.RangeInt(0, availableLunarItemDropList.Count)];
					PickupDef pickupDef = PickupCatalog.GetPickupDef(val4);
					if (pickupDef != null)
					{
						instance2.master.inventory.GiveItem(pickupDef.itemIndex, 1);
					}
				}
			}
		}
		if (Utils.isArtifactEnabled(Artifacts.diffPauseWhileNoInteraction))
		{
			GameObject val5 = Object.Instantiate<GameObject>(Prefabs.timeStopper);
			val5.GetComponent<TimeStopBehaviour>().Networkinteraction = true;
			NetworkServer.Spawn(val5);
		}
	}

	private static void CharacterMaster_GiveMoney(orig_GiveMoney orig, CharacterMaster self, uint amount)
	{
		if (Object.op_Implicit((Object)(object)RunArtifactManager.instance) && Utils.isArtifactEnabled(Artifacts.goldGain))
		{
			amount *= 2;
		}
		orig.Invoke(self, amount);
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Dragonyck.MoreArtifacts", "MoreArtifacts", "1.0.0")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class MainPlugin : BaseUnityPlugin
{
	public const string MODUID = "com.Dragonyck.MoreArtifacts";

	public const string MODNAME = "MoreArtifacts";

	public const string VERSION = "1.0.0";

	internal const string MODKEY = "MOREARTIFACTS_";

	internal const bool debugMode = false;

	internal static ConfigEntry<bool> pvpItemDrop;

	internal static ConfigEntry<float> killsHealPercentage;

	internal static ConfigEntry<float> killsHealFlat;

	internal static ConfigEntry<bool> enableVoidTeam;

	internal static ConfigEntry<bool> enableVoidElite;

	internal static ConfigEntry<int> itemCostChance;

	internal static ConfigEntry<int> itemCostTier1;

	internal static ConfigEntry<int> itemCostTier2;

	internal static ConfigEntry<int> itemCostTier3;

	internal static ConfigEntry<int> itemCostCategory;

	internal static ConfigEntry<int> itemCostCategory2;

	internal static ConfigEntry<KeyCode> survivorPickKey;

	private void Awake()
	{
		bool flag = false;
		pvpItemDrop = ((BaseUnityPlugin)this).Config.Bind<bool>("Combat", "Drop Items", true, "Players drop their items at random if killed by asnother player.");
		killsHealPercentage = ((BaseUnityPlugin)this).Config.Bind<float>("Vampire", "Heal Percentage", 0.01f, (ConfigDescription)null);
		killsHealFlat = ((BaseUnityPlugin)this).Config.Bind<float>("Vampire", "Flat Heal", 15f, (ConfigDescription)null);
		enableVoidTeam = ((BaseUnityPlugin)this).Config.Bind<bool>("Void", "Players Are Void Team", false, "May softlock the game if the boss is also a memeber of the Void team.");
		enableVoidElite = ((BaseUnityPlugin)this).Config.Bind<bool>("Void", "Players Are Voidtouched", false, (ConfigDescription)null);
		itemCostChance = ((BaseUnityPlugin)this).Config.Bind<int>("Blood Money", "Health Cost Shrine Chance", 9, (ConfigDescription)null);
		itemCostTier1 = ((BaseUnityPlugin)this).Config.Bind<int>("Blood Money", "Health Cost Tier1", 12, (ConfigDescription)null);
		itemCostTier2 = ((BaseUnityPlugin)this).Config.Bind<int>("Blood Money", "Health Cost Tier2", 25, (ConfigDescription)null);
		itemCostTier3 = ((BaseUnityPlugin)this).Config.Bind<int>("Blood Money", "Health Cost Tier3", 50, (ConfigDescription)null);
		itemCostCategory = ((BaseUnityPlugin)this).Config.Bind<int>("Blood Money", "Health Cost Category Chests", 15, (ConfigDescription)null);
		itemCostCategory2 = ((BaseUnityPlugin)this).Config.Bind<int>("Blood Money", "Health Cost Large Category Chests", 30, (ConfigDescription)null);
		survivorPickKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Militia", "Survivor Panel Key", (KeyCode)112, (ConfigDescription)null);
		Assets.PopulateAssets();
		Prefabs.CreatePrefabs();
		Artifacts.CreateArtifacts();
		Hook.Hooks();
	}
}
internal class Prefabs
{
	internal static GameObject timeStopper;

	internal static GameObject fogDamager;

	internal static GameObject survivorSelectionPanel;

	internal static Sprite texUnlockIcon;

	internal static Material baseMaterial = Load<Material>("RoR2/Base/Commando/matCommandoDualies.mat");

	internal static List<SurvivorDef> survivors = new List<SurvivorDef>();

	internal static List<Sprite> survivorSprites = new List<Sprite>();

	internal static void CreatePrefabs()
	{
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: 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_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Expected O, but got Unknown
		//IL_0132: Unknown result type (might be due to invalid IL or missing references)
		//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_031d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0322: Unknown result type (might be due to invalid IL or missing references)
		//IL_0339: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d7: Expected O, but got Unknown
		//IL_0411: Unknown result type (might be due to invalid IL or missing references)
		//IL_0421: Expected O, but got Unknown
		//IL_0210: Unknown result type (might be due to invalid IL or missing references)
		//IL_0215: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_025c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0261: Unknown result type (might be due to invalid IL or missing references)
		//IL_0282: Unknown result type (might be due to invalid IL or missing references)
		texUnlockIcon = Load<Sprite>("RoR2/Base/Common/MiscIcons/texUnlockIcon.png");
		Load<GameObject>("RoR2/Base/Core/PlayerMaster.prefab").AddComponent<SurvivorPickBehaviour>();
		survivorSelectionPanel = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Command/CommandPickerPanel.prefab"), "SurvivorPickerPanel", false);
		((Component)survivorSelectionPanel.GetComponentInChildren<LanguageTextMeshController>()).gameObject.SetActive(false);
		GridLayoutGroup componentInChildren = survivorSelectionPanel.GetComponentInChildren<GridLayoutGroup>();
		componentInChildren.constraint = (Constraint)1;
		componentInChildren.constraintCount = 6;
		((LayoutGroup)componentInChildren).childAlignment = (TextAnchor)1;
		RectTransform component = ((Component)componentInChildren).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 val = new GameObject("Scroll", new Type[1] { typeof(RectTransform) });
		val.gameObject.layer = 5;
		val.transform.SetParent(((Component)componentInChildren).transform.parent);
		val.transform.localPosition = ((Component)componentInChildren).transform.localPosition;
		((Component)componentInChildren).transform.parent = val.transform;
		ScrollRect val2 = val.AddComponent<ScrollRect>();
		val2.horizontal = false;
		val2.content = component;
		val2.scrollSensitivity = 30f;
		PickupPickerPanel component2 = survivorSelectionPanel.GetComponent<PickupPickerPanel>();
		SurvivorPanelBehaviour survivorPanelBehaviour = survivorSelectionPanel.AddComponent<SurvivorPanelBehaviour>();
		Image[] componentsInChildren = survivorSelectionPanel.GetComponentsInChildren<Image>();
		foreach (Image val3 in componentsInChildren)
		{
			string name = ((Object)val3).name;
			if (name == "SpinnyOutlines")
			{
				if (((Component)val3).transform.childCount == 0)
				{
					((Graphic)val3).color = Color32.op_Implicit(new Color32((byte)70, (byte)82, (byte)112, byte.MaxValue));
				}
				else
				{
					((Graphic)val3).color = Color32.op_Implicit(new Color32((byte)148, (byte)174, (byte)240, byte.MaxValue));
				}
			}
			if (name == "ColoredOverlay" || name == "BG")
			{
				((Graphic)val3).color = Color32.op_Implicit(new Color32((byte)148, (byte)174, (byte)240, byte.MaxValue));
			}
			if (name == "ColoredOverlay, Subtle")
			{
				((Graphic)val3).color = Color.clear;
			}
			if (name == "CancelButton")
			{
				survivorPanelBehaviour.cancelButton = ((Component)val3).GetComponent<MPButton>();
			}
		}
		Image val4 = val.gameObject.AddComponent<Image>();
		((Graphic)val4).color = Color32.op_Implicit(new Color32((byte)11, (byte)19, (byte)42, byte.MaxValue));
		val4.sprite = Load<Sprite>("RoR2/Base/UI/texUIHighlightBoxOutlineThickIcon.png");
		val4.type = (Type)2;
		val.gameObject.AddComponent<Mask>();
		RectTransform component3 = ((Component)val2).GetComponent<RectTransform>();
		((Transform)component3).localPosition = Vector2.op_Implicit(Vector2.zero);
		component3.sizeDelta = new Vector2(500f, 510f);
		survivorPanelBehaviour.gridlayoutGroup = component2.gridlayoutGroup;
		survivorPanelBehaviour.buttonContainer = component2.buttonContainer;
		survivorPanelBehaviour.buttonPrefab = component2.buttonPrefab;
		survivorPanelBehaviour.coloredImages = component2.coloredImages;
		survivorPanelBehaviour.darkColoredImages = component2.darkColoredImages;
		Object.Destroy((Object)(object)component2);
		Object.Destroy((Object)(object)survivorSelectionPanel.GetComponent<PickerPanelSizeAdjuster>());
		timeStopper = Instantiate(new GameObject("TimeStopper", new Type[2]
		{
			typeof(NetworkIdentity),
			typeof(TimeStopBehaviour)
		}), "TimeStopper", registerNetwork: true);
		Load<GameObject>("RoR2/DLC1/VoidCamp/VoidCamp.prefab").AddComponent<VoidCampTracker>();
		fogDamager = Instantiate(new GameObject("TimeStopper", new Type[2]
		{
			typeof(NetworkIdentity),
			typeof(TeamFilter)
		}), "FogDamager", registerNetwork: true);
		fogDamager.GetComponent<TeamFilter>().teamIndex = (TeamIndex)1;
		FogDamageController val5 = fogDamager.AddComponent<FogDamageController>();
		val5.tickPeriodSeconds = 0.2f;
		val5.healthFractionPerSecond = 0.01f;
		val5.healthFractionRampCoefficientPerSecond = 0.1f;
		val5.healthFractionRampIncreaseCooldown = 5f;
		val5.dangerBuffDef = Load<BuffDef>("RoR2/DLC1/VoidRaidCrab/bdVoidRaidCrabWardWipeFog.asset");
		val5.dangerBuffDuration = 0.5f;
	}

	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();
	}

	internal static GameObject Instantiate(string path, string name, bool registerNetwork = false)
	{
		return PrefabAPI.InstantiateClone(Load<GameObject>(path), name, registerNetwork);
	}

	internal static GameObject Instantiate(GameObject obj, string name, bool registerNetwork = false)
	{
		return PrefabAPI.InstantiateClone(obj, name, registerNetwork);
	}

	public static Material InstantiateDefaultSurvivorMaterial(Texture tex)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		//IL_001d: 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)
		Material val = new Material(baseMaterial);
		if (Object.op_Implicit((Object)(object)val))
		{
			val.SetColor("_Color", Color.white);
			val.SetTexture("_MainTex", tex);
			val.SetColor("_EmColor", Color.black);
			val.SetFloat("_EmPower", 0f);
			val.SetTexture("_EmTex", (Texture)null);
			val.SetFloat("_NormalStrength", 1f);
			val.SetTexture("_NormalTex", (Texture)null);
			return val;
		}
		return val;
	}

	public static Material InstantiateDefaultSurvivorMaterial(Color color, Texture tex, Color emColor, float emPower, Texture emTex, float normStr, Texture normTex)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		Material val = new Material(baseMaterial);
		if (Object.op_Implicit((Object)(object)val))
		{
			val.SetColor("_Color", color);
			val.SetTexture("_MainTex", tex);
			val.SetColor("_EmColor", emColor);
			val.SetFloat("_EmPower", emPower);
			val.SetTexture("_EmTex", emTex);
			val.SetFloat("_NormalStrength", 1f);
			val.SetTexture("_NormalTex", normTex);
			return val;
		}
		return val;
	}
}
internal class BasicMeleeSkillState : BaseSkillState
{
	private float duration = 0.2f;

	private Vector3 dir;

	private OverlapAttack attack;

	private float damageCoefficient = 4.2f;

	private GameObject hitEffectPrefab = null;

	private bool parried;

	public Animator animator;

	private uint ID;

	private string hitboxGroupName = "";

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		animator = ((EntityState)this).GetModelAnimator();
		if (!animator.GetBool("slide"))
		{
			((BaseState)this).StartAimMode(1f, true);
		}
		((EntityState)this).PlayAnimation("LeftArm, Override", "MeleeAttack");
		AkSoundEngine.PostEvent(ID, ((EntityState)this).gameObject);
		attack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, hitEffectPrefab, ((EntityState)this).GetModelTransform(), hitboxGroupName);
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			attack.Fire((List<HurtBox>)null);
		}
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)1;
	}
}
internal class CharacterMain : GenericCharacterMain
{
}
internal class MeleeSkillState : BaseSkillState
{
	public float attackDuration;

	private bool hopped;

	private bool hasSwung;

	public bool isInHitPause;

	public float hitPauseDuration;

	public float hopVelocity;

	public float hitPauseTimer;

	public float stopwatch;

	public HitStopCachedState hitStopCachedState;

	public OverlapAttack overlapAttack;

	public bool hasHit;

	private bool hasAnimParameter;

	private float attackSpeedScaling;

	public Animator animator;

	public int attackIndex = 1;

	public virtual float baseAttackDuration => 0f;

	public virtual float earlyExitDurationPercentage => 0f;

	public virtual float damageCoefficient => 0f;

	public virtual float forceMagnitude => 440f;

	public virtual float rootMotionSpeed => 25f;

	public virtual float baseHopVelocity => 4f;

	public virtual string layerName => "Gesture, Override";

	public virtual string animationStateName => "";

	public virtual string animParameter => "M1";

	public virtual string hitBoxGroupName => "";

	public virtual string hitBoxActiveParameter => "Curve";

	public virtual string swingMuzzle => "";

	public virtual GameObject swingEffectPrefab => null;

	public virtual bool hopOnHit => true;

	public virtual bool rootMotion => false;

	public virtual bool rootMotionWhileHitting => false;

	public virtual string swingSound => "";

	public virtual DamageType damageType => (DamageType)0;

	public virtual DamageColorIndex damageColor => (DamageColorIndex)0;

	public virtual Vector3 bonusForce => Vector3.zero;

	public virtual GameObject hitEffectPrefab => null;

	public bool finisher => attackIndex == 2;

	public override void OnSerialize(NetworkWriter writer)
	{
		((BaseSkillState)this).OnSerialize(writer);
		writer.Write(attackIndex);
	}

	public override void OnDeserialize(NetworkReader reader)
	{
		((BaseSkillState)this).OnDeserialize(reader);
		attackIndex = reader.ReadInt32();
	}

	public override void OnEnter()
	{
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		attackSpeedScaling = Math.Min(((BaseState)this).attackSpeedStat, 6f);
		attackDuration = baseAttackDuration / attackSpeedScaling;
		hitPauseDuration = GroundLight.hitPauseDuration / attackSpeedScaling;
		hopVelocity = baseHopVelocity / attackSpeedScaling;
		animator = ((EntityState)this).GetModelAnimator();
		animator.SetFloat(hitBoxActiveParameter, 0f);
		overlapAttack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, hitEffectPrefab, ((EntityState)this).GetModelTransform(), hitBoxGroupName);
		overlapAttack.pushAwayForce = 1f;
		overlapAttack.damageType = DamageTypeCombo.op_Implicit(damageType);
		hasAnimParameter = !Utility.IsNullOrWhiteSpace(animParameter);
		if (hasAnimParameter && !Utility.IsNullOrWhiteSpace(animationStateName))
		{
			((EntityState)this).PlayAnimation(layerName, animationStateName, animParameter, attackDuration, 0f);
		}
	}

	public virtual Vector3 rootMotionDirection()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		return ((EntityState)this).characterDirection.forward;
	}

	public override void FixedUpdate()
	{
		//IL_0030: 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_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a0: 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)
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			bool flag = FireMeleeAttack(overlapAttack, animator, hitBoxActiveParameter, forceMagnitude, bonusForce);
			hasHit = flag || hasHit;
			if (hasHit)
			{
				if (hopOnHit && !((EntityState)this).characterMotor.isGrounded && !hopped)
				{
					((BaseState)this).SmallHop(((EntityState)this).characterMotor, hopVelocity);
					hopped = true;
				}
				if (!rootMotionWhileHitting && !isInHitPause && hasAnimParameter)
				{
					isInHitPause = true;
				}
			}
			if (animator.GetFloat(hitBoxActiveParameter) > 0.1f && rootMotion && !isInHitPause)
			{
				Vector3 val = rootMotionDirection();
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += val * rootMotionSpeed * Time.fixedDeltaTime;
			}
			if (hitPauseTimer >= hitPauseDuration && isInHitPause)
			{
				isInHitPause = false;
				animator.speed = 1f;
			}
			if (!isInHitPause)
			{
				stopwatch += Time.fixedDeltaTime;
			}
			else
			{
				hitPauseTimer += Time.fixedDeltaTime;
				((EntityState)this).characterMotor.velocity = Vector3.zero;
				animator.speed = 0f;
			}
			if (stopwatch >= attackDuration * earlyExitDurationPercentage)
			{
				if (((EntityState)this).inputBank.skill1.down)
				{
					SetState();
				}
				if (stopwatch >= attackDuration)
				{
					BaseSkillState val2 = StateOverride();
					if (val2 != null)
					{
						((EntityState)this).outer.SetNextState((EntityState)(object)val2);
					}
					else
					{
						((EntityState)this).outer.SetNextStateToMain();
					}
					return;
				}
			}
		}
		if (animator.GetFloat(hitBoxActiveParameter) >= 0.11f && !hasSwung)
		{
			hasSwung = true;
			AkSoundEngine.PostEvent(swingSound, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)swingEffectPrefab) && !Utility.IsNullOrWhiteSpace(swingMuzzle))
			{
				EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, swingMuzzle, false);
			}
		}
	}

	public bool FireMeleeAttack(OverlapAttack attack, Animator animator, string mecanimHitboxActiveParameter, float forceMagnitude, Vector3 bonusForce)
	{
		//IL_0042: 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_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		bool result = false;
		if (Object.op_Implicit((Object)(object)animator) && animator.GetFloat(mecanimHitboxActiveParameter) > 0.1f)
		{
			attack.forceVector = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).transform.forward) * forceMagnitude + bonusForce;
			result = attack.Fire((List<HurtBox>)null);
		}
		return result;
	}

	public virtual void SetState()
	{
	}

	public virtual BaseSkillState StateOverride()
	{
		return null;
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)1;
	}
}
internal class Primary : BaseSkillState
{
	private float duration;

	private float baseDuration = 0.35f;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)2;
	}
}
internal class Secondary : BaseSkillState
{
	private float duration;

	private float baseDuration = 0.35f;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)1;
	}
}
internal class Special : BaseSkillState
{
	private float duration;

	private float baseDuration = 0.35f;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)1;
	}
}
internal class Utility : BaseSkillState
{
	private float duration;

	private float baseDuration = 0.35f;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)1;
	}
}
internal static class Extensions
{
	public static GameObject NewSyringe(this GameObject g, params Material[] m)
	{
		((Renderer)g.GetComponentsInChildren<MeshRenderer>(false)[0]).material = m[0];
		((Renderer)g.GetComponent<TrailRenderer>()).material = m[1];
		((Renderer)g.GetComponent<ParticleSystemRenderer>()).material = m[2];
		return g;
	}

	public static Material SwapTexture(this Material m, Texture2D t)
	{
		m.mainTexture = (Texture)(object)t;
		return m;
	}

	public static GameObject SwapMaterials(this GameObject g, Material[] m)
	{
		Renderer[] componentsInChildren = g.GetComponentsInChildren<Renderer>();
		for (int i = 0; i < componentsInChildren.Length; i++)
		{
			if (Object.op_Implicit((Object)(object)m[i]))
			{
				componentsInChildren[i].material = m[i];
			}
		}
		return g;
	}

	public static float Mult(this float f, float mult = 100f)
	{
		return f * mult;
	}

	public static Color ToRGB255(this Color c, string title, string body)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		return new Color(c.r / 255f, c.g / 255f, c.b / 255f);
	}

	public static void SetStrings(this TooltipProvider t, string title, string body)
	{
		t.overrideTitleText = title;
		t.overrideBodyText = body;
	}
}
internal class Utils
{
	internal static bool isArtifactEnabled(ArtifactDef artifact)
	{
		if (!Object.op_Implicit((Object)(object)artifact) || !Object.op_Implicit((Object)(object)RunArtifactManager.instance))
		{
			return false;
		}
		return RunArtifactManager.instance.IsArtifactEnabled(artifact);
	}

	internal static void RecolorEffect(GameObject obj, Color color)
	{
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)obj))
		{
			return;
		}
		OmniEffect component = obj.GetComponent<OmniEffect>();
		if (Object.op_Implicit((Object)(object)component))
		{
			Object.DestroyImmediate((Object)(object)obj.GetComponent<OmniEffect>());
		}
		Renderer[] componentsInChildren = obj.GetComponentsInChildren<Renderer>(Object.op_Implicit((Object)(object)component));
		for (int i = 0; i < componentsInChildren.Length; i++)
		{
			((Component)componentsInChildren[i]).gameObject.SetActive(true);
			if (Object.op_Implicit((Object)(object)componentsInChildren[i].material) && componentsInChildren[i].material.HasProperty("_TintColor"))
			{
				componentsInChildren[i].material.SetColor("_TintColor", color);
			}
		}
	}

	public static Vector3 FindNearestNodePosition(Vector3 targetPosition, GraphType nodeGraphType)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: 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_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Expected O, but got Unknown
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Expected O, but got Unknown
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		SpawnCard val = ScriptableObject.CreateInstance<SpawnCard>();
		val.hullSize = (HullClassification)0;
		val.nodeGraphType = nodeGraphType;
		val.prefab = Prefabs.Load<GameObject>("RoR2/Base/Common/DirectorSpawnProbeHelperPrefab.prefab");
		Vector3 result = targetPosition;
		GameObject val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val, new DirectorPlacementRule
		{
			placementMode = (PlacementMode)((targetPosition != Vector3.zero) ? 3 : 4),
			position = targetPosition
		}, RoR2Application.rng));
		if (Object.op_Implicit((Object)(object)val2))
		{
			result = val2.transform.position;
		}
		if (Object.op_Implicit((Object)(object)val2))
		{
			Object.Destroy((Object)(object)val2);
		}
		Object.Destroy((Object)(object)val);
		return result;
	}

	public static Vector3 GetForwardDirection(Vector3 dir)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//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_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: 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_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		Vector2 val = Util.Vector3XZToVector2XY(dir);
		if (val != Vector2.zero)
		{
			((Vector2)(ref val)).Normalize();
			Vector3 val2 = new Vector3(val.x, 0f, val.y);
			return ((Vector3)(ref val2)).normalized;
		}
		return dir;
	}

	public static void PlayAnimation(GameObject g, string layerName, string animationStateName)
	{
		Animator component = g.GetComponent<Animator>();
		if (Object.op_Implicit((Object)(object)component))
		{
			int layerIndex = component.GetLayerIndex(layerName);
			component.speed = 1f;
			component.Update(0f);
			component.PlayInFixedTime(animationStateName, layerIndex, 0f);
		}
	}

	public static void PlayAnimation(GameObject g, string layerName, string animationStateName, string playbackRateParam, float duration)
	{
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		Animator component = g.GetComponent<Animator>();
		if (Object.op_Implicit((Object)(object)component))
		{
			component.speed = 1f;
			component.Update(0f);
			int layerIndex = component.GetLayerIndex(layerName);
			component.SetFloat(playbackRateParam, 1f);
			component.PlayInFixedTime(animationStateName, layerIndex, 0f);
			component.Update(0f);
			AnimatorStateInfo currentAnimatorStateInfo = component.GetCurrentAnimatorStateInfo(layerIndex);
			float length = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).length;
			component.SetFloat(playbackRateParam, length / duration);
		}
	}

	public static void AnimatorPlayAnimation(Animator modelAnimator, string layerName, string animationStateName)
	{
		int layerIndex = modelAnimator.GetLayerIndex(layerName);
		modelAnimator.speed = 1f;
		modelAnimator.Update(0f);
		modelAnimator.PlayInFixedTime(animationStateName, layerIndex, 0f);
	}

	public static void AnimatorPlayAnimation(Animator modelAnimator, string layerName, string animationStateName, string playbackRateParam, float duration)
	{
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		modelAnimator.speed = 1f;
		modelAnimator.Update(0f);
		int layerIndex = modelAnimator.GetLayerIndex(layerName);
		modelAnimator.SetFloat(playbackRateParam, 1f);
		modelAnimator.PlayInFixedTime(animationStateName, layerIndex, 0f);
		modelAnimator.Update(0f);
		AnimatorStateInfo currentAnimatorStateInfo = modelAnimator.GetCurrentAnimatorStateInfo(layerIndex);
		float length = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).length;
		modelAnimator.SetFloat(playbackRateParam, length / duration);
	}

	public static SkillDef NewSkillDef<T>(Type activationState, string activationStateMachineName, int baseMaxStock, float baseRechargeInterval, bool beginSkillCooldownOnSkillEnd, bool canceledFromSprinting, bool fullRestockOnAssign, InterruptPriority interruptPriority, bool isCombatSkill, bool mustKeyPress, bool cancelSprintingOnActivation, int rechargeStock, int requiredStock, int stockToConsume, Sprite icon, string skillDescriptionToken, string skillName, params string[] keywordTokens) where T : SkillDef
	{
		//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)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		T val = ScriptableObject.CreateInstance<T>();
		((SkillDef)val).activationState = new SerializableEntityStateType(activationState);
		((SkillDef)val).activationStateMachineName = activationStateMachineName;
		((SkillDef)val).baseMaxStock = baseMaxStock;
		((SkillDef)val).baseRechargeInterval = baseRechargeInterval;
		((SkillDef)val).beginSkillCooldownOnSkillEnd = beginSkillCooldownOnSkillEnd;
		((SkillDef)val).canceledFromSprinting = canceledFromSprinting;
		((SkillDef)val).fullRestockOnAssign = fullRestockOnAssign;
		((SkillDef)val).interruptPriority = interruptPriority;
		((SkillDef)val).isCombatSkill = isCombatSkill;
		((SkillDef)val).mustKeyPress = mustKeyPress;
		((SkillDef)val).cancelSprintingOnActivation = cancelSprintingOnActivation;
		((SkillDef)val).rechargeStock = rechargeStock;
		((SkillDef)val).requiredStock = requiredStock;
		((SkillDef)val).stockToConsume = stockToConsume;
		((SkillDef)val).icon = icon;
		((SkillDef)val).skillDescriptionToken = skillDescriptionToken;
		((SkillDef)val).skillName = skillName;
		((SkillDef)val).skillNameToken = ((SkillDef)val).skillName;
		((SkillDef)val).keywordTokens = keywordTokens;
		ContentAddition.AddSkillDef((SkillDef)(object)val);
		return (SkillDef)(object)val;
	}

	public static Color HexTo10(string hexColor)
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: 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_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		char[] array = hexColor.ToCharArray();
		return new Color((float)(array[0] + array[1]), (float)(array[2] + array[3]), (float)(array[4] + array[5]), 255f) / 255f;
	}

	public static EntityStateMachine NewStateMachine<T>(GameObject obj, string customName) where T : EntityState
	{
		//IL_0021: 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_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		SerializableEntityStateType val = default(SerializableEntityStateType);
		((SerializableEntityStateType)(ref val))..ctor(typeof(T));
		EntityStateMachine val2 = obj.AddComponent<EntityStateMachine>();
		val2.customName = customName;
		val2.initialStateType = val;
		val2.mainStateType = val;
		return val2;
	}

	public static GenericSkill NewGenericSkill(GameObject obj, SkillDef skill)
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Expected O, but got Unknown
		//IL_0054: 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)
		GenericSkill val = obj.AddComponent<GenericSkill>();
		SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>();
		val2.variants = (Variant[])(object)new Variant[1];
		val._skillFamily = val2;
		SkillFamily skillFamily = val.skillFamily;
		Variant[] variants = skillFamily.variants;
		Variant val3 = new Variant
		{
			skillDef = skill
		};
		((Variant)(ref val3)).viewableNode = new Node(skill.skillNameToken, false, (Node)null);
		variants[0] = val3;
		ContentAddition.AddSkillFamily(skillFamily);
		return val;
	}

	public static void AddAlt(SkillFamily skillFamily, SkillDef SkillDef)
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Expected O, but got Unknown
		//IL_004c: 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)
		Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
		Variant[] variants = skillFamily.variants;
		int num = skillFamily.variants.Length - 1;
		Variant val = new Variant
		{
			skillDef = SkillDef
		};
		((Variant)(ref val)).viewableNode = new Node(SkillDef.skillNameToken, false, (Node)null);
		variants[num] = val;
	}

	public static BuffDef NewBuffDef(string name, bool stack, bool hidden, Sprite sprite, Color color)
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
		((Object)val).name = name;
		val.canStack = stack;
		val.isHidden = hidden;
		val.iconSprite = sprite;
		val.buffColor = color;
		ContentAddition.AddBuffDef(val);
		return val;
	}

	public static ObjectScaleCurve AddScaleComponent(GameObject target, float timeMax)
	{
		ObjectScaleCurve val = target.AddComponent<ObjectScaleCurve>();
		val.useOverallCurveOnly = true;
		val.timeMax = timeMax;
		val.overallCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f);
		return val;
	}

	public static RotateAroundAxis AddRotationComponent(GameObject target, float speed, RotationAxis axis)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		RotateAroundAxis val = target.AddComponent<RotateAroundAxis>();
		val.speed = (Speed)2;
		val.fastRotationSpeed = speed;
		val.rotateAroundAxis = axis;
		return val;
	}

	public static AnimateShaderAlpha AddShaderAlphaComponent(GameObject target, float timeMax, AnimationCurve curve, bool destroyOnEnd = true, bool disableOnEnd = false)
	{
		AnimateShaderAlpha val = target.AddComponent<AnimateShaderAlpha>();
		val.timeMax = timeMax;
		val.alphaCurve = curve;
		val.destroyOnEnd = destroyOnEnd;
		val.disableOnEnd = disableOnEnd;
		return val;
	}

	internal static Sprite CreateSprite(Texture2D tex)
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		return Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f), 128f);
	}

	internal static SkinDefInfo CreateNewSkinDefInfo(SkinnedMeshRenderer[] childList, GameObject rootObject, string skinName, string objectToEnable, RendererInfo[] rendererInfos, UnlockableDef unlockableDef = null)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		SkinDefInfo result = default(SkinDefInfo);
		result.BaseSkins = Array.Empty<SkinDef>();
		result.MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0];
		result.ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0];
		List<GameObjectActivation> list = new List<GameObjectActivation>();
		foreach (SkinnedMeshRenderer val in childList)
		{
			GameObjectActivation val2 = default(GameObjectActivation);
			val2.gameObject = ((Component)val).gameObject;
			val2.shouldActivate = ((Object)val).name.Contains(objectToEnable);
			GameObjectActivation item = val2;
			list.Add(item);
		}
		result.GameObjectActivations = list.ToArray();
		result.Icon = Assets.MainAssetBundle.LoadAsset<Sprite>(objectToEnable);
		result.MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[0];
		result.Name = skinName;
		result.NameToken = skinName;
		result.RendererInfos = rendererInfos;
		result.RootObject = rootObject;
		result.UnlockableDef = unlockableDef;
		return result;
	}

	internal static T CopyComponent<T>(T original, GameObject destination) where T : Component
	{
		Type type = ((object)original).GetType();
		Component val = destination.AddComponent(type);
		FieldInfo[] fields = type.GetFields();
		FieldInfo[] array = fields;
		foreach (FieldInfo fieldInfo in array)
		{
			fieldInfo.SetValue(val, fieldInfo.GetValue(original));
		}
		return (T)(object)((val is T) ? val : null);
	}

	public static Sprite CreateSpriteFromTexture(Texture2D texture)
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)texture))
		{
			return Sprite.Create(texture, new Rect(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height), new Vector2(0.5f, 0.5f));
		}
		return null;
	}

	public static GameObject FindInActiveObjectByName(string name)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Invalid comparison between Unknown and I4
		Transform[] array = Resources.FindObjectsOfTypeAll<Transform>();
		for (int i = 0; i < array.Length; i++)
		{
			if ((int)((Object)array[i]).hideFlags == 0 && ((Object)array[i]).name == name)
			{
				return ((Component)array[i]).gameObject;
			}
		}
		return null;
	}

	public static void CreateHitboxes(string name, Transform parent, Vector3[] sizes, Vector3[] positions)
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Expected O, but got Unknown
		//IL_004f: 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_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_0082: Unknown result type (might be due to invalid IL or missing references)
		HitBoxGroup val = ((Component)parent).gameObject.AddComponent<HitBoxGroup>();
		val.groupName = name;
		List<HitBox> list = new List<HitBox>();
		for (int i = 0; i < sizes.Length; i++)
		{
			GameObject val2 = new GameObject(name + (i + 1));
			val2.transform.SetParent(parent);
			val2.transform.localPosition = positions[i];
			val2.transform.localRotation = Quaternion.Euler(Vector3.forward * 45f);
			val2.transform.localScale = sizes[i];
			HitBox item = val2.AddComponent<HitBox>();
			val2.layer = LayerIndex.projectile.intVal;
			list.Add(item);
		}
		val.hitBoxes = list.ToArray();
	}

	public static GameObject CreateHitbox(string name, Transform parent, Vector3 scale, Vector3 localPosition)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Expected O, but got Unknown
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = new GameObject(name);
		val.transform.SetParent(parent);
		val.transform.localPosition = localPosition;
		val.transform.localRotation = Quaternion.Euler(Vector3.forward * 45f);
		val.transform.localScale = scale;
		HitBoxGroup val2 = ((Component)parent).gameObject.AddComponent<HitBoxGroup>();
		HitBox val3 = val.AddComponent<HitBox>();
		val.layer = LayerIndex.projectile.intVal;
		val2.hitBoxes = (HitBox[])(object)new HitBox[1] { val3 };
		val2.groupName = name;
		return val;
	}

	internal static EffectComponent RegisterEffect(GameObject effect, float duration, string soundName = "", bool applyScale = false, bool parentToReferencedTransform = true, bool positionAtReferencedTransform = true)
	{
		//IL_00a6: 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)
		EffectComponent val = effect.GetComponent<EffectComponent>();
		if (!Object.op_Implicit((Object)(object)val))
		{
			val = effect.AddComponent<EffectComponent>();
		}
		if (duration != -1f)
		{
			DestroyOnTimer component = effect.GetComponent<DestroyOnTimer>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				effect.AddComponent<DestroyOnTimer>().duration = duration;
			}
			else
			{
				component.duration = duration;
			}
		}
		if (!Object.op_Implicit((Object)(object)effect.GetComponent<NetworkIdentity>()))
		{
			effect.AddComponent<NetworkIdentity>();
		}
		if (!Object.op_Implicit((Object)(object)effect.GetComponent<VFXAttributes>()))
		{
			effect.AddCompon