Decompiled source of RPGworld v1.0.2

plugins/RPGworldMod.dll

Decompiled 4 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using Alexandria.CharacterAPI;
using Alexandria.ItemAPI;
using Alexandria.Misc;
using BepInEx;
using Dungeonator;
using Gungeon;
using Microsoft.CodeAnalysis;
using SGUI;
using UnityEngine;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Mod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Mod")]
[assembly: AssemblyCopyright("Copyright ©  2020")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("d6d7a494-722e-4763-959b-c2d6b6a42b01")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace RPGworldMod
{
	public class Gruv_machine_gun : GunBehaviour
	{
		public static int ID;

		public static void Add()
		{
			//IL_00b2: 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)
			//IL_0104: 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_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			Gun val = Databases.Items.NewGun("GRUV Machine gun", "gruv_machine_gun");
			Game.Items.Rename("outdated_gun_mods:gruv_machine_gun", "rpgworld:gruv_machine_gun");
			((Component)val).gameObject.AddComponent<Gruv_machine_gun>();
			GunExt.SetShortDescription((PickupObject)(object)val, "Infinite");
			GunExt.SetLongDescription((PickupObject)(object)val, "Accelerates over time if there are enemies in the room. Resets after dodgerolling.\n\nThe once active GRUV corporation produced affordable and high-quality variations of weapons. This machine gun belongs to this product line, having infinite amounts of ammunition. But after the death of the planet Gruv, this untique item is good for nothing.");
			GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, "gruv_machine_gun_idle_001", 8);
			GunExt.SetAnimationFPS(val, val.shootAnimation, 10);
			GunExt.SetAnimationFPS(val, val.reloadAnimation, 0);
			PickupObject byId = PickupObjectDatabase.GetById(84);
			GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
			val.DefaultModule.ammoCost = 1;
			val.DefaultModule.angleVariance = 6f;
			val.DefaultModule.shootStyle = (ShootStyle)1;
			val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
			val.reloadTime = -1f;
			val.DefaultModule.cooldownTime = 0.4f;
			val.DefaultModule.numberOfShotsInClip = 1;
			((Component)val.barrelOffset).transform.localPosition = new Vector3(2.0625f, 0.375f, 0f);
			val.InfiniteAmmo = true;
			((PickupObject)val).quality = (ItemQuality)4;
			((PickupObject)val).ShouldBeExcludedFromShops = true;
			((PickupObject)val).CanBeDropped = false;
			Projectile val2 = ProjectileUtility.SetupProjectile(86);
			val.DefaultModule.projectiles[0] = val2;
			val2.baseData.damage = 5f;
			ProjectileData baseData = val2.baseData;
			baseData.speed *= 1f;
			val2.baseData.range = 18f;
			val2.AdditionalScaleMultiplier = 0.8f;
			val2.ignoreDamageCaps = true;
			((Component)val2).gameObject.SetActive(false);
			val.gunClass = (GunClass)55;
			val.usesContinuousFireAnimation = true;
			((Component)val).GetComponent<tk2dSpriteAnimator>().GetClipByName(val.shootAnimation).wrapMode = (WrapMode)1;
			((Component)val).GetComponent<tk2dSpriteAnimator>().GetClipByName(val.shootAnimation).loopStart = 1;
			Databases.Items.Add(val, (tk2dSpriteCollectionData)null, "ANY");
			ID = ((PickupObject)val).PickupObjectId;
		}

		public override void PostProcessProjectile(Projectile projectile)
		{
			GameActor currentOwner = base.gun.CurrentOwner;
			PlayerController val = (PlayerController)(object)((currentOwner is PlayerController) ? currentOwner : null);
			if ((Object)(object)val == (Object)null)
			{
				base.gun.ammo = base.gun.GetBaseMaxAmmo();
			}
			base.gun.ClipShotsRemaining = 2;
			base.gun.GainAmmo(2);
		}

		public override void OnPostFired(PlayerController player, Gun gun)
		{
			AkSoundEngine.PostEvent("Play_WPN_minigun_shot_01", ((Component)this).gameObject);
			gun.ClearReloadData();
		}

		public override void Update()
		{
			GameActor currentOwner = base.gun.CurrentOwner;
			PlayerController val = (PlayerController)(object)((currentOwner is PlayerController) ? currentOwner : null);
			if (base.gun.IsFiring && !val.IsDodgeRolling && (val.CurrentRoom == null || val.CurrentRoom.GetActiveEnemiesCount((ActiveEnemyType)0) != 0))
			{
				if (base.gun.DefaultModule.cooldownTime > 0.015f)
				{
					ProjectileModule defaultModule = base.gun.DefaultModule;
					defaultModule.cooldownTime -= 0.002f;
				}
				if (base.gun.DefaultModule.cooldownTime == 0.4f)
				{
					GunExt.SetAnimationFPS(base.gun, base.gun.shootAnimation, 10);
				}
				if (base.gun.DefaultModule.cooldownTime <= 0.365f)
				{
					GunExt.SetAnimationFPS(base.gun, base.gun.shootAnimation, 11);
				}
				if (base.gun.DefaultModule.cooldownTime <= 0.33f)
				{
					GunExt.SetAnimationFPS(base.gun, base.gun.shootAnimation, 12);
				}
				if (base.gun.DefaultModule.cooldownTime <= 0.295f)
				{
					GunExt.SetAnimationFPS(base.gun, base.gun.shootAnimation, 13);
				}
				if (base.gun.DefaultModule.cooldownTime <= 0.26f)
				{
					GunExt.SetAnimationFPS(base.gun, base.gun.shootAnimation, 14);
				}
				if (base.gun.DefaultModule.cooldownTime <= 0.225f)
				{
					GunExt.SetAnimationFPS(base.gun, base.gun.shootAnimation, 15);
				}
				if (base.gun.DefaultModule.cooldownTime <= 0.19f)
				{
					GunExt.SetAnimationFPS(base.gun, base.gun.shootAnimation, 16);
				}
				if (base.gun.DefaultModule.cooldownTime <= 0.155f)
				{
					GunExt.SetAnimationFPS(base.gun, base.gun.shootAnimation, 17);
				}
				if (base.gun.DefaultModule.cooldownTime <= 0.12f)
				{
					GunExt.SetAnimationFPS(base.gun, base.gun.shootAnimation, 18);
				}
				if (base.gun.DefaultModule.cooldownTime <= 0.085f)
				{
					GunExt.SetAnimationFPS(base.gun, base.gun.shootAnimation, 19);
				}
				if (base.gun.DefaultModule.cooldownTime <= 0.05f)
				{
					GunExt.SetAnimationFPS(base.gun, base.gun.shootAnimation, 20);
				}
				if (base.gun.DefaultModule.cooldownTime <= 0.015f)
				{
					GunExt.SetAnimationFPS(base.gun, base.gun.shootAnimation, 21);
				}
			}
			else
			{
				base.gun.DefaultModule.cooldownTime = 0.4f;
			}
			if (base.gun.DefaultModule.cooldownTime == 0.4f)
			{
				GunExt.SetAnimationFPS(base.gun, base.gun.shootAnimation, 10);
			}
			if (!((GunBehaviour)this).PlayerOwner.PlayerHasActiveSynergy("King of the fourth floor") && ((GunBehaviour)this).PlayerOwner.HasPickupID(ID))
			{
				base.gun.m_owner = null;
				PlayerUtility.RemoveItemFromInventory(((GunBehaviour)this).PlayerOwner, (PickupObject)(object)base.gun);
			}
			if (Object.op_Implicit((Object)(object)base.gun.CurrentOwner) && !base.gun.PreventNormalFireAudio)
			{
				base.gun.PreventNormalFireAudio = true;
			}
		}
	}
	internal class Gruv_crown : PassiveItem
	{
		public static void Init()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			string text = "GRUV Crown";
			string text2 = "RPGworldMod/Resources/gruv_crown_sprite";
			GameObject val = new GameObject(text);
			Gruv_crown gruv_crown = val.AddComponent<Gruv_crown>();
			ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
			string text3 = "You are in power";
			string text4 = "Grants weapons worthy of a king to those who have proven themselves worthy of them.\n\nSymbol of power of the great water-powered planet Gruv. It has a built-in water generator connected to Gruv's core, but is currently not working.";
			ItemBuilder.SetupItem((PickupObject)(object)gruv_crown, text3, text4, "rpgworld");
			((PickupObject)gruv_crown).quality = (ItemQuality)2;
			((PickupObject)gruv_crown).ShouldBeExcludedFromShops = true;
		}

		public override void Update()
		{
			if (base.m_owner.PlayerHasActiveSynergy("King of the first floor") && !base.m_owner.HasPickupID(Gruv_shotgun.ID))
			{
				LootEngine.GivePrefabToPlayer(((Component)PickupObjectDatabase.GetById(Gruv_shotgun.ID)).gameObject, base.m_owner);
			}
			if (base.m_owner.PlayerHasActiveSynergy("King of the second floor") && !base.m_owner.HasPickupID(Gruv_assault_rifle.ID))
			{
				LootEngine.GivePrefabToPlayer(((Component)PickupObjectDatabase.GetById(Gruv_assault_rifle.ID)).gameObject, base.m_owner);
			}
			if (base.m_owner.PlayerHasActiveSynergy("King of the third floor") && !base.m_owner.HasPickupID(Gruv_sniper_rifle.ID))
			{
				LootEngine.GivePrefabToPlayer(((Component)PickupObjectDatabase.GetById(Gruv_sniper_rifle.ID)).gameObject, base.m_owner);
			}
			if (base.m_owner.PlayerHasActiveSynergy("King of the fourth floor") && !base.m_owner.HasPickupID(Gruv_machine_gun.ID))
			{
				LootEngine.GivePrefabToPlayer(((Component)PickupObjectDatabase.GetById(Gruv_machine_gun.ID)).gameObject, base.m_owner);
			}
			if (base.m_owner.PlayerHasActiveSynergy("King of the fifth floor") && !base.m_owner.HasPickupID(Gruv_rocket_launcher.ID))
			{
				LootEngine.GivePrefabToPlayer(((Component)PickupObjectDatabase.GetById(Gruv_rocket_launcher.ID)).gameObject, base.m_owner);
			}
			((PassiveItem)this).Update();
		}

		public override void Pickup(PlayerController player)
		{
			((PassiveItem)this).Pickup(player);
		}

		public override DebrisObject Drop(PlayerController player)
		{
			return ((PassiveItem)this).Drop(player);
		}
	}
	public class Gruv_assault_rifle : GunBehaviour
	{
		public static int ID;

		private bool HasReloaded;

		public static void Add()
		{
			//IL_00b3: 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_0106: 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_019b: Unknown result type (might be due to invalid IL or missing references)
			Gun val = Databases.Items.NewGun("GRUV Assault Rifle", "gruv_assault_rifle");
			Game.Items.Rename("outdated_gun_mods:gruv_assault_rifle", "rpgworld:gruv_assault_rifle");
			((Component)val).gameObject.AddComponent<Gruv_assault_rifle>();
			GunExt.SetShortDescription((PickupObject)(object)val, "Quick reload");
			GunExt.SetLongDescription((PickupObject)(object)val, "Reloading is instant if the magazine is empty.\n\nThe once active GRUV corporation produced affordable and high-quality variations of weapons. This assault rifle belongs to this product line, having a distinctive reload speed. But after the death of the planet Gruv, this untique item is good for nothing.");
			GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, "gruv_assault_rifle_idle_001", 8);
			GunExt.SetAnimationFPS(val, val.shootAnimation, 12);
			GunExt.SetAnimationFPS(val, val.reloadAnimation, 11);
			PickupObject byId = PickupObjectDatabase.GetById(86);
			GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
			val.DefaultModule.ammoCost = 1;
			val.DefaultModule.angleVariance = 3f;
			val.DefaultModule.shootStyle = (ShootStyle)1;
			val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
			val.reloadTime = 1.4f;
			val.DefaultModule.cooldownTime = 0.1f;
			val.DefaultModule.numberOfShotsInClip = 30;
			((Component)val.barrelOffset).transform.localPosition = new Vector3(1.8125f, 0.5f, 0f);
			val.InfiniteAmmo = true;
			((PickupObject)val).quality = (ItemQuality)2;
			((PickupObject)val).ShouldBeExcludedFromShops = true;
			((PickupObject)val).CanBeDropped = false;
			Projectile val2 = ProjectileUtility.SetupProjectile(86);
			val.DefaultModule.projectiles[0] = val2;
			val2.baseData.damage = 5f;
			ProjectileData baseData = val2.baseData;
			baseData.speed *= 1.2f;
			val2.baseData.range = 18f;
			val2.AdditionalScaleMultiplier = 0.8f;
			((Component)val2).gameObject.SetActive(false);
			val.gunClass = (GunClass)55;
			Databases.Items.Add(val, (tk2dSpriteCollectionData)null, "ANY");
			ID = ((PickupObject)val).PickupObjectId;
		}

		public override void OnPostFired(PlayerController player, Gun gun)
		{
			AkSoundEngine.PostEvent("Play_WPN_thompson_shot_01", ((Component)this).gameObject);
		}

		public override void Update()
		{
			if (base.gun.ClipShotsRemaining <= 0)
			{
				base.gun.reloadTime = 0f;
			}
			else
			{
				base.gun.reloadTime = 1.4f;
			}
			if (!((GunBehaviour)this).PlayerOwner.PlayerHasActiveSynergy("King of the second floor") && ((GunBehaviour)this).PlayerOwner.HasPickupID(ID))
			{
				base.gun.m_owner = null;
				PlayerUtility.RemoveItemFromInventory(((GunBehaviour)this).PlayerOwner, (PickupObject)(object)base.gun);
			}
			if (Object.op_Implicit((Object)(object)base.gun.CurrentOwner))
			{
				if (!base.gun.PreventNormalFireAudio)
				{
					base.gun.PreventNormalFireAudio = true;
				}
				if (!base.gun.IsReloading && !HasReloaded)
				{
					HasReloaded = true;
				}
			}
		}

		public override void OnReloadPressed(PlayerController player, Gun gun, bool bSOMETHING)
		{
			if (gun.IsReloading && HasReloaded)
			{
				HasReloaded = false;
				AkSoundEngine.PostEvent("Stop_WPN_All", ((Component)this).gameObject);
				((GunBehaviour)this).OnReloadPressed(player, gun, bSOMETHING);
				AkSoundEngine.PostEvent("SND_WPN_ak47_reload_01", ((Component)this).gameObject);
			}
		}
	}
	public class Gruv_rocket_launcher : GunBehaviour
	{
		public static int ID;

		private bool HasReloaded;

		public static void Add()
		{
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: 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_019a: Unknown result type (might be due to invalid IL or missing references)
			Gun val = Databases.Items.NewGun("GRUV Rocket Launcher", "gruv_rocket_launcher");
			Game.Items.Rename("outdated_gun_mods:gruv_rocket_launcher", "rpgworld:gruv_rocket_launcher");
			((Component)val).gameObject.AddComponent<Gruv_rocket_launcher>();
			GunExt.SetShortDescription((PickupObject)(object)val, "Single shot");
			GunExt.SetLongDescription((PickupObject)(object)val, "The once active GRUV corporation produced affordable and high-quality variations of weapons. This rocket launcher belongs to this line of products, having such a simple but worthwhile improvement as double the damage. But after the death of the planet Gruv, this untique item is good for nothing.");
			GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, "gruv_rocket_launcher_idle_001", 8);
			GunExt.SetAnimationFPS(val, val.shootAnimation, 10);
			GunExt.SetAnimationFPS(val, val.reloadAnimation, 11);
			PickupObject byId = PickupObjectDatabase.GetById(39);
			GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
			val.DefaultModule.ammoCost = 1;
			val.DefaultModule.shootStyle = (ShootStyle)0;
			val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
			val.reloadTime = 1.2f;
			val.DefaultModule.numberOfShotsInClip = 1;
			val.InfiniteAmmo = true;
			((PickupObject)val).quality = (ItemQuality)5;
			((PickupObject)val).ShouldBeExcludedFromShops = true;
			((Component)val.barrelOffset).transform.localPosition = new Vector3(2.0625f, 0.4375f, 0f);
			((PickupObject)val).CanBeDropped = false;
			Projectile val2 = Object.Instantiate<Projectile>(val.DefaultModule.projectiles[0]);
			((Component)val2).gameObject.SetActive(false);
			FakePrefab.MarkAsFakePrefab(((Component)val2).gameObject);
			Object.DontDestroyOnLoad((Object)(object)val2);
			val.DefaultModule.projectiles[0] = val2;
			val2.baseData.damage = 40f;
			val2.baseData.speed = 50f;
			val2.ignoreDamageCaps = true;
			val2.pierceMinorBreakables = true;
			((BraveBehaviour)val2).transform.parent = val.barrelOffset;
			val.gunClass = (GunClass)55;
			Databases.Items.Add(val, (tk2dSpriteCollectionData)null, "ANY");
			ID = ((PickupObject)val).PickupObjectId;
		}

		public override void OnPostFired(PlayerController player, Gun gun)
		{
			AkSoundEngine.PostEvent("Play_WPN_RPG_shot_01", ((Component)this).gameObject);
		}

		public override void Update()
		{
			if (!((GunBehaviour)this).PlayerOwner.PlayerHasActiveSynergy("King of the fifth floor") && ((GunBehaviour)this).PlayerOwner.HasPickupID(ID))
			{
				base.gun.m_owner = null;
				PlayerUtility.RemoveItemFromInventory(((GunBehaviour)this).PlayerOwner, (PickupObject)(object)base.gun);
			}
			if (Object.op_Implicit((Object)(object)base.gun.CurrentOwner))
			{
				if (!base.gun.PreventNormalFireAudio)
				{
					base.gun.PreventNormalFireAudio = true;
				}
				if (!base.gun.IsReloading && !HasReloaded)
				{
					HasReloaded = true;
				}
			}
		}

		public override void OnReloadPressed(PlayerController player, Gun gun, bool bSOMETHING)
		{
			if (gun.IsReloading && HasReloaded)
			{
				HasReloaded = false;
				AkSoundEngine.PostEvent("Stop_WPN_All", ((Component)this).gameObject);
				((GunBehaviour)this).OnReloadPressed(player, gun, bSOMETHING);
				AkSoundEngine.PostEvent("Play_WPN_rpg_reload_01", ((Component)this).gameObject);
			}
		}
	}
	public class Gruv_sniper_rifle : GunBehaviour
	{
		public static int ID;

		public static void Add()
		{
			//IL_00b3: 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_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			Gun val = Databases.Items.NewGun("GRUV Sniper Rifle", "gruv_sniper_rifle");
			Game.Items.Rename("outdated_gun_mods:gruv_sniper_rifle", "rpgworld:gruv_sniper_rifle");
			((Component)val).gameObject.AddComponent<Gruv_sniper_rifle>();
			GunExt.SetShortDescription((PickupObject)(object)val, "Shoots in bursts");
			GunExt.SetLongDescription((PickupObject)(object)val, "The once active GRUV corporation produced affordable and high-quality variations of weapons. This sniper rifle belongs to this product line, with improvements such as a larger magazine and shooting versatility. But after the death of the planet Gruv, this untique item is good for nothing.");
			GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, "gruv_sniper_rifle_idle_001", 8);
			GunExt.SetAnimationFPS(val, val.shootAnimation, 10);
			GunExt.SetAnimationFPS(val, val.reloadAnimation, 11);
			PickupObject byId = PickupObjectDatabase.GetById(49);
			GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
			val.DefaultModule.ammoCost = 1;
			val.DefaultModule.angleVariance = 1f;
			val.DefaultModule.shootStyle = (ShootStyle)4;
			val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
			val.reloadTime = 2f;
			val.DefaultModule.cooldownTime = 1f;
			val.DefaultModule.numberOfShotsInClip = 40;
			((Component)val.barrelOffset).transform.localPosition = new Vector3(2.125f, 0.375f, 0f);
			val.DefaultModule.burstShotCount = 5;
			val.DefaultModule.burstCooldownTime = 0.15f;
			val.InfiniteAmmo = true;
			((PickupObject)val).quality = (ItemQuality)3;
			((PickupObject)val).ShouldBeExcludedFromShops = true;
			((PickupObject)val).CanBeDropped = false;
			Projectile val2 = Object.Instantiate<Projectile>(val.DefaultModule.projectiles[0]);
			((Component)val2).gameObject.SetActive(false);
			FakePrefab.MarkAsFakePrefab(((Component)val2).gameObject);
			Object.DontDestroyOnLoad((Object)(object)val2);
			val.DefaultModule.projectiles[0] = val2;
			val2.baseData.damage = 9f;
			val.gunClass = (GunClass)55;
			Databases.Items.Add(val, (tk2dSpriteCollectionData)null, "ANY");
			ID = ((PickupObject)val).PickupObjectId;
		}

		public override void OnPostFired(PlayerController player, Gun gun)
		{
			AkSoundEngine.PostEvent("Play_WPN_sniperrifle_shot_01", ((Component)this).gameObject);
		}

		public override void Update()
		{
			if (!((GunBehaviour)this).PlayerOwner.PlayerHasActiveSynergy("King of the third floor") && ((GunBehaviour)this).PlayerOwner.HasPickupID(ID))
			{
				base.gun.m_owner = null;
				PlayerUtility.RemoveItemFromInventory(((GunBehaviour)this).PlayerOwner, (PickupObject)(object)base.gun);
			}
			if (Object.op_Implicit((Object)(object)base.gun.CurrentOwner) && !base.gun.PreventNormalFireAudio)
			{
				base.gun.PreventNormalFireAudio = true;
			}
		}
	}
	public class Gruv_shotgun : GunBehaviour
	{
		public static int ID;

		public static void Add()
		{
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			Gun val = Databases.Items.NewGun("GRUV Shotgun", "gruv_shotgun");
			Game.Items.Rename("outdated_gun_mods:gruv_shotgun", "rpgworld:gruv_shotgun");
			((Component)val).gameObject.AddComponent<Gruv_shotgun>();
			GunExt.SetShortDescription((PickupObject)(object)val, "Single shot");
			GunExt.SetLongDescription((PickupObject)(object)val, "The once active GRUV corporation produced affordable and high-quality variations of weapons. This shotgun belongs to this product line, having a distinctive lethality. But after the death of the planet Gruv, this untique item is good for nothing.");
			GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, "gruv_shotgun_idle_001", 8);
			GunExt.SetAnimationFPS(val, val.shootAnimation, 10);
			GunExt.SetAnimationFPS(val, val.reloadAnimation, 5);
			ref string gunSwitchGroup = ref val.gunSwitchGroup;
			PickupObject byId = PickupObjectDatabase.GetById(51);
			gunSwitchGroup = ((Gun)((byId is Gun) ? byId : null)).gunSwitchGroup;
			for (int i = 0; i < 12; i++)
			{
				PickupObject byId2 = PickupObjectDatabase.GetById(51);
				GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId2 is Gun) ? byId2 : null), true, false);
			}
			int num = 0;
			foreach (ProjectileModule projectile in val.Volley.projectiles)
			{
				projectile.ammoCost = 1;
				projectile.shootStyle = (ShootStyle)0;
				projectile.sequenceStyle = (ProjectileSequenceStyle)0;
				projectile.cooldownTime = 1.2f;
				projectile.angleVariance = 14f;
				projectile.numberOfShotsInClip = 1;
				Projectile val2 = Object.Instantiate<Projectile>(projectile.projectiles[0]);
				projectile.projectiles[0] = val2;
				((Component)val2).gameObject.SetActive(false);
				FakePrefab.MarkAsFakePrefab(((Component)val2).gameObject);
				Object.DontDestroyOnLoad((Object)(object)val2);
				ProjectileData baseData = val2.baseData;
				baseData.range *= 0.5f;
				val2.baseData.damage = 4f;
				num++;
			}
			val.reloadTime = 1.6f;
			val.InfiniteAmmo = true;
			((PickupObject)val).quality = (ItemQuality)2;
			((PickupObject)val).ShouldBeExcludedFromShops = true;
			val.gunClass = (GunClass)55;
			val.Volley.UsesShotgunStyleVelocityRandomizer = true;
			((PickupObject)val).CanBeDropped = false;
			Databases.Items.Add(val, (tk2dSpriteCollectionData)null, "ANY");
			ID = ((PickupObject)val).PickupObjectId;
		}

		public override void Update()
		{
			if (!((GunBehaviour)this).PlayerOwner.PlayerHasActiveSynergy("King of the first floor") && ((GunBehaviour)this).PlayerOwner.HasPickupID(ID))
			{
				base.gun.m_owner = null;
				PlayerUtility.RemoveItemFromInventory(((GunBehaviour)this).PlayerOwner, (PickupObject)(object)base.gun);
			}
			((GunBehaviour)this).Update();
		}
	}
	public class Gruv_pistol : GunBehaviour
	{
		public static int ID;

		private bool HasReloaded;

		public static void Add()
		{
			//IL_00b3: 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_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			Gun val = Databases.Items.NewGun("GRUV Pistol", "gruv_pistol");
			Game.Items.Rename("outdated_gun_mods:gruv_pistol", "rpgworld:gruv_pistol");
			((Component)val).gameObject.AddComponent<Gruv_pistol>();
			GunExt.SetShortDescription((PickupObject)(object)val, "Shoots in bursts");
			GunExt.SetLongDescription((PickupObject)(object)val, "The once active GRUV corporation produced affordable and high-quality variations of weapons. This pistol belongs to this product line, with improvements such as a larger magazine and shooting versatility. But after the death of the planet Gruv, this untique item is good for nothing.");
			GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, "gruv_pistol_idle_001", 8);
			GunExt.SetAnimationFPS(val, val.shootAnimation, 10);
			GunExt.SetAnimationFPS(val, val.reloadAnimation, 11);
			PickupObject byId = PickupObjectDatabase.GetById(86);
			GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
			val.DefaultModule.ammoCost = 1;
			val.DefaultModule.angleVariance = 3f;
			val.DefaultModule.shootStyle = (ShootStyle)4;
			val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
			val.reloadTime = 1.4f;
			val.DefaultModule.cooldownTime = 0.35f;
			val.DefaultModule.numberOfShotsInClip = 12;
			val.DefaultModule.burstShotCount = 3;
			val.DefaultModule.burstCooldownTime = 0.15f;
			val.InfiniteAmmo = true;
			((PickupObject)val).quality = (ItemQuality)1;
			((PickupObject)val).ShouldBeExcludedFromShops = true;
			Projectile val2 = Object.Instantiate<Projectile>(val.DefaultModule.projectiles[0]);
			((Component)val2).gameObject.SetActive(false);
			FakePrefab.MarkAsFakePrefab(((Component)val2).gameObject);
			Object.DontDestroyOnLoad((Object)(object)val2);
			val.DefaultModule.projectiles[0] = val2;
			val2.baseData.damage = 5f;
			ProjectileData baseData = val2.baseData;
			baseData.speed *= 1f;
			val2.baseData.range = 14f;
			val.gunClass = (GunClass)55;
			Databases.Items.Add(val, (tk2dSpriteCollectionData)null, "ANY");
			ID = ((PickupObject)val).PickupObjectId;
		}

		public override void OnPostFired(PlayerController player, Gun gun)
		{
			AkSoundEngine.PostEvent("Play_WPN_smileyrevolver_shot_01", ((Component)this).gameObject);
		}

		public override void Update()
		{
			if (Object.op_Implicit((Object)(object)base.gun.CurrentOwner))
			{
				if (!base.gun.PreventNormalFireAudio)
				{
					base.gun.PreventNormalFireAudio = true;
				}
				if (!base.gun.IsReloading && !HasReloaded)
				{
					HasReloaded = true;
				}
			}
		}

		public override void OnReloadPressed(PlayerController player, Gun gun, bool bSOMETHING)
		{
			if (gun.IsReloading && HasReloaded)
			{
				HasReloaded = false;
				AkSoundEngine.PostEvent("Stop_WPN_All", ((Component)this).gameObject);
				((GunBehaviour)this).OnReloadPressed(player, gun, bSOMETHING);
				AkSoundEngine.PostEvent("Play_WPN_SAA_reload_01", ((Component)this).gameObject);
			}
		}
	}
	internal class InitialiseSynergies
	{
		public static void DoInitialisation()
		{
			List<string> list = new List<string> { "rpgworld:gruv_crown", "master_round_1" };
			CustomSynergies.Add("King of the first floor", list, (List<string>)null, true);
			List<string> list2 = new List<string> { "rpgworld:gruv_crown", "master_round_2" };
			CustomSynergies.Add("King of the second floor", list2, (List<string>)null, true);
			List<string> list3 = new List<string> { "rpgworld:gruv_crown", "master_round_3" };
			CustomSynergies.Add("King of the third floor", list3, (List<string>)null, true);
			List<string> list4 = new List<string> { "rpgworld:gruv_crown", "master_round_4" };
			CustomSynergies.Add("King of the fourth floor", list4, (List<string>)null, true);
			List<string> list5 = new List<string> { "rpgworld:gruv_crown", "master_round_5" };
			CustomSynergies.Add("King of the fifth floor", list5, (List<string>)null, true);
		}
	}
	internal class InitialiseCharacters
	{
		public static void Charactersetup()
		{
			SetupKKoRRoLL();
		}

		public static void SetupKKoRRoLL()
		{
			//IL_001a: 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_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: 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_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Expected O, but got Unknown
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Expected O, but got Unknown
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Expected O, but got Unknown
			CustomCharacterData val = Loader.BuildCharacter("RPGworldMod/Characters/KKoRRoLL", "rpgworld:KKoRRoLL", new Vector3(31f, 27f, 27.1f), false, new Vector3(21.8f, 29.5f, 25.3f), true, false, false, true, false, (GlowMatDoer)null, (GlowMatDoer)null, 0, false, "");
			PlayableCharacters val2 = ETGModCompatibility.ExtendEnum<PlayableCharacters>("rpgworld:KKoRRoLL", "kkorroll");
			StringHandler.AddStringDefinition("#PLAYER_NICK_" + ((object)(PlayableCharacters)(ref val2)).ToString().ToUpperInvariant(), "Green eyed");
			StringHandler.AddStringDefinition("#PLAYER_NICK_" + ((object)(PlayableCharacters)(ref val2)).ToString().ToUpperInvariant(), "King");
			StringHandler.AddStringDefinition("#PLAYER_NICK_" + ((object)(PlayableCharacters)(ref val2)).ToString().ToUpperInvariant(), "Smokey");
			StringHandler.AddStringDefinition("#PLAYER_NICK_GREEN_EYED", "Green eyed");
			StringHandler.AddStringDefinition("#PLAYER_NICK_KING", "King");
			StringHandler.AddStringDefinition("#PLAYER_NICK_SMOKEY", "Smokey");
			CharacterSelectIdleDoer idleDoer = val.idleDoer;
			idleDoer.coreIdleAnimation = "select_idle";
			idleDoer.phases = (CharacterSelectIdlePhase[])(object)new CharacterSelectIdlePhase[3]
			{
				new CharacterSelectIdlePhase
				{
					inAnimation = "crossarms",
					holdAnimation = "crossarms_hold",
					holdMin = 3f,
					holdMax = 5f,
					outAnimation = "crossarms_out"
				},
				new CharacterSelectIdlePhase
				{
					outAnimation = "hair"
				},
				new CharacterSelectIdlePhase
				{
					outAnimation = "trash"
				}
			};
		}
	}
	internal class An_item : SpawnObjectPlayerItem
	{
		public GameObject teleportObject;

		private int duration = 10;

		public static void Init()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			string text = "An Item";
			string text2 = "RPGworldMod/Resources/item_sprite";
			GameObject val = new GameObject(text);
			An_item an_item = val.AddComponent<An_item>();
			ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
			string text3 = "Drops a shadow";
			string text4 = "Can be thrown. At any point it can drop a shadow very similar to you! Exact match even.\n\nJust an item with a shadow. In its place there really could be anything else besides glass.";
			ItemBuilder.SetupItem((PickupObject)(object)an_item, text3, text4, "rpgworld");
			((PickupObject)an_item).quality = (ItemQuality)2;
			ItemBuilder.SetCooldownType((PlayerItem)(object)an_item, (CooldownType)0, 5f);
			((PlayerItem)an_item).consumable = false;
			((SpawnObjectPlayerItem)an_item).objectToSpawn = BuildPrefab();
			((SpawnObjectPlayerItem)an_item).tossForce = 24f;
			((SpawnObjectPlayerItem)an_item).canBounce = false;
			((SpawnObjectPlayerItem)an_item).IsCigarettes = false;
			((SpawnObjectPlayerItem)an_item).RequireEnemiesInRoom = false;
			((SpawnObjectPlayerItem)an_item).SpawnRadialCopies = false;
			((SpawnObjectPlayerItem)an_item).RadialCopiesToSpawn = 0;
			((SpawnObjectPlayerItem)an_item).AudioEvent = null;
			((SpawnObjectPlayerItem)an_item).IsKageBunshinItem = false;
			((PlayerItem)an_item).usableDuringDodgeRoll = true;
		}

		public override void Pickup(PlayerController player)
		{
			((PlayerItem)this).Pickup(player);
		}

		public override bool CanBeUsed(PlayerController user)
		{
			return true;
		}

		public override void DoEffect(PlayerController user)
		{
			((MonoBehaviour)this).StartCoroutine(ItemBuilder.HandleDuration((PlayerItem)(object)this, (float)duration, user, (Action<PlayerController>)EndEffect));
			DoSpavn(user, 0f);
		}

		public void DoSpavn(PlayerController user, float angleFromAim)
		{
			//IL_0043: 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_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: 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_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: 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_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: 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)
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d5: 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_02e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_031c: 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_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0375: Unknown result type (might be due to invalid IL or missing references)
			if (!string.IsNullOrEmpty(base.enemyGuidToSpawn))
			{
				base.objectToSpawn = ((Component)EnemyDatabase.GetOrLoadByGuid(base.enemyGuidToSpawn)).gameObject;
			}
			GameObject val = (teleportObject = base.objectToSpawn);
			if (base.HasOverrideSynergyItem && user.HasActiveBonusSynergy(base.RequiredSynergy, false))
			{
				val = base.SynergyObjectToSpawn;
			}
			Projectile component = val.GetComponent<Projectile>();
			base.m_elapsedCooldownWhileExtantTimer = 0f;
			if ((Object)(object)component != (Object)null)
			{
				Vector2 val2 = Vector2.op_Implicit(user.unadjustedAimPoint - user.LockedApproximateSpriteCenter);
				base.spawnedPlayerObject = Object.Instantiate<GameObject>(val, Vector2.op_Implicit(((BraveBehaviour)user).specRigidbody.UnitCenter), Quaternion.Euler(0f, 0f, BraveMathCollege.Atan2Degrees(val2)));
				teleportObject = base.spawnedPlayerObject;
			}
			else if (base.tossForce == 0f)
			{
				GameObject val3 = (base.spawnedPlayerObject = Object.Instantiate<GameObject>(val, Vector2.op_Implicit(((BraveBehaviour)user).specRigidbody.UnitCenter), Quaternion.identity));
				teleportObject = base.spawnedPlayerObject;
				tk2dBaseSprite component2 = val3.GetComponent<tk2dBaseSprite>();
				if ((Object)(object)component2 != (Object)null)
				{
					component2.PlaceAtPositionByAnchor(Vector2Extensions.ToVector3ZUp(((BraveBehaviour)user).specRigidbody.UnitCenter, ((BraveBehaviour)component2).transform.position.z), (Anchor)4);
					if ((Object)(object)((BraveBehaviour)component2).specRigidbody != (Object)null)
					{
						((BraveBehaviour)component2).specRigidbody.RegisterGhostCollisionException(((BraveBehaviour)user).specRigidbody);
					}
				}
				KageBunshinController component3 = val3.GetComponent<KageBunshinController>();
				if (Object.op_Implicit((Object)(object)component3))
				{
					component3.InitializeOwner(user);
				}
				if (base.IsKageBunshinItem && user.HasActiveBonusSynergy((CustomSynergyType)387, false))
				{
					component3.UsesRotationInsteadOfInversion = true;
					component3.RotationAngle = angleFromAim;
				}
				val3.transform.position = dfVectorExtensions.Quantize(val3.transform.position, 0.0625f);
			}
			else
			{
				Vector3 val4 = user.unadjustedAimPoint - user.LockedApproximateSpriteCenter;
				Vector3 val5 = Vector2.op_Implicit(((BraveBehaviour)user).specRigidbody.UnitCenter);
				if (val4.y > 0f)
				{
					val5 += Vector3.up * 0.25f;
				}
				GameObject val6 = (teleportObject = Object.Instantiate<GameObject>(val, val5, Quaternion.identity));
				tk2dBaseSprite component4 = val6.GetComponent<tk2dBaseSprite>();
				if (Object.op_Implicit((Object)(object)component4))
				{
					component4.PlaceAtPositionByAnchor(val5, (Anchor)4);
				}
				base.spawnedPlayerObject = val6;
				Vector2 val7 = Vector2.op_Implicit(user.unadjustedAimPoint - user.LockedApproximateSpriteCenter);
				val7 = Vector2.op_Implicit(Quaternion.Euler(0f, 0f, angleFromAim) * Vector2.op_Implicit(val7));
				DebrisObject val8 = LootEngine.DropItemWithoutInstantiating(val6, val6.transform.position, val7, base.tossForce, false, false, true, false);
				if (Object.op_Implicit((Object)(object)val6.GetComponent<BlackHoleDoer>()))
				{
					val8.PreventFallingInPits = true;
					val8.PreventAbsorption = true;
				}
				if (val4.y > 0f && Object.op_Implicit((Object)(object)val8))
				{
					val8.additionalHeightBoost = -1f;
					if (Object.op_Implicit((Object)(object)((BraveBehaviour)val8).sprite))
					{
						((BraveBehaviour)val8).sprite.UpdateZDepth();
					}
				}
				val8.IsAccurateDebris = true;
				((EphemeralObject)val8).Priority = (EphemeralPriority)0;
				val8.bounceCount = (base.canBounce ? 1 : 0);
			}
			if (Object.op_Implicit((Object)(object)base.spawnedPlayerObject))
			{
				PortableTurretController component5 = base.spawnedPlayerObject.GetComponent<PortableTurretController>();
				if (Object.op_Implicit((Object)(object)component5))
				{
					component5.sourcePlayer = ((PlayerItem)this).LastOwner;
				}
				Projectile componentInChildren = base.spawnedPlayerObject.GetComponentInChildren<Projectile>();
				if (Object.op_Implicit((Object)(object)componentInChildren))
				{
					componentInChildren.Owner = (GameActor)(object)((PlayerItem)this).LastOwner;
					componentInChildren.TreatedAsNonProjectileForChallenge = true;
				}
				SpawnObjectItem componentInChildren2 = base.spawnedPlayerObject.GetComponentInChildren<SpawnObjectItem>();
				if (Object.op_Implicit((Object)(object)componentInChildren2))
				{
					componentInChildren2.SpawningPlayer = ((PlayerItem)this).LastOwner;
				}
			}
		}

		public override void DoActiveEffect(PlayerController user)
		{
			//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_002c: Unknown result type (might be due to invalid IL or missing references)
			((PlayerItem)this).DoActiveEffect(user);
			if ((Object)(object)teleportObject != (Object)null)
			{
				Vector2 worldCenter = teleportObject.GetComponent<tk2dBaseSprite>().WorldCenter;
				TeleportPlayerToCursorPosition.StartTeleport(user, worldCenter);
				TeleportEffect(teleportObject, user);
				EndEffect(user);
				((PlayerItem)this).IsCurrentlyActive = false;
			}
		}

		private void EndEffect(PlayerController user)
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)((Component)this).gameObject != (Object)null)
			{
				AkSoundEngine.PostEvent("Play_CHR_ninja_dash_01", teleportObject);
				GameObject bloodiedScarfPoofVFX = TeleportPlayerToCursorPosition.BloodiedScarfPoofVFX;
				GameObject val = Object.Instantiate<GameObject>(bloodiedScarfPoofVFX);
				val.GetComponent<tk2dBaseSprite>().PlaceAtLocalPositionByAnchor(Vector2.op_Implicit(teleportObject.GetComponent<tk2dBaseSprite>().WorldCenter + new Vector2(0f, -0.5f)), (Anchor)1);
				val.transform.position = dfVectorExtensions.Quantize(val.transform.position, 0.0625f);
				val.GetComponent<tk2dBaseSprite>().UpdateZDepth();
			}
			Object.Destroy((Object)(object)teleportObject);
			((PlayerItem)this).m_isCurrentlyActive = false;
		}

		public override void OnPreDrop(PlayerController user)
		{
			//IL_0058: 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_006c: 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_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			((SpawnObjectPlayerItem)this).OnPreDrop(user);
			if ((Object)(object)teleportObject != (Object)null)
			{
				AkSoundEngine.PostEvent("Play_CHR_ninja_dash_01", teleportObject);
				GameObject bloodiedScarfPoofVFX = TeleportPlayerToCursorPosition.BloodiedScarfPoofVFX;
				if ((Object)(object)bloodiedScarfPoofVFX != (Object)null)
				{
					GameObject val = Object.Instantiate<GameObject>(bloodiedScarfPoofVFX);
					val.GetComponent<tk2dBaseSprite>().PlaceAtLocalPositionByAnchor(Vector2.op_Implicit(teleportObject.GetComponent<tk2dBaseSprite>().WorldCenter + new Vector2(0f, -0.5f)), (Anchor)1);
					val.transform.position = dfVectorExtensions.Quantize(val.transform.position, 0.0625f);
					val.GetComponent<tk2dBaseSprite>().UpdateZDepth();
				}
				Object.Destroy((Object)(object)teleportObject);
			}
		}

		public override void OnDestroy()
		{
			//IL_003c: 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_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)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			AkSoundEngine.PostEvent("Play_CHR_ninja_dash_01", teleportObject);
			GameObject bloodiedScarfPoofVFX = TeleportPlayerToCursorPosition.BloodiedScarfPoofVFX;
			if ((Object)(object)bloodiedScarfPoofVFX != (Object)null)
			{
				GameObject val = Object.Instantiate<GameObject>(bloodiedScarfPoofVFX);
				val.GetComponent<tk2dBaseSprite>().PlaceAtLocalPositionByAnchor(Vector2.op_Implicit(teleportObject.GetComponent<tk2dBaseSprite>().WorldCenter + new Vector2(0f, -0.5f)), (Anchor)1);
				val.transform.position = dfVectorExtensions.Quantize(val.transform.position, 0.0625f);
				val.GetComponent<tk2dBaseSprite>().UpdateZDepth();
				Object.Destroy((Object)(object)teleportObject);
			}
			((SpawnObjectPlayerItem)this).OnDestroy();
		}

		private void TeleportEffect(GameObject g, PlayerController p)
		{
			//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_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: 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_0123: Unknown result type (might be due to invalid IL or missing references)
			Vector2 worldCenter = ((BraveBehaviour)p).sprite.WorldCenter;
			if ((Object)(object)g != (Object)null && (Object)(object)g.GetComponent<tk2dBaseSprite>() != (Object)null)
			{
				worldCenter = g.GetComponent<tk2dBaseSprite>().WorldCenter;
			}
			AkSoundEngine.PostEvent("Play_CHR_ninja_dash_01", ((Component)this).gameObject);
			for (int i = 0; i < GameManager.Instance.AllPlayers.Length; i++)
			{
				if (!GameManager.Instance.AllPlayers[i].IsGhost)
				{
					((BraveBehaviour)GameManager.Instance.AllPlayers[i]).healthHaver.TriggerInvulnerabilityPeriod(1f);
					((BraveBehaviour)GameManager.Instance.AllPlayers[i]).knockbackDoer.TriggerTemporaryKnockbackInvulnerability(1f);
				}
			}
			GameObject bloodiedScarfPoofVFX = TeleportPlayerToCursorPosition.BloodiedScarfPoofVFX;
			if ((Object)(object)bloodiedScarfPoofVFX != (Object)null && (Object)(object)g != (Object)null)
			{
				GameObject val = Object.Instantiate<GameObject>(bloodiedScarfPoofVFX);
				val.GetComponent<tk2dBaseSprite>().PlaceAtLocalPositionByAnchor(Vector2.op_Implicit(worldCenter + new Vector2(0f, -0.5f)), (Anchor)1);
				val.transform.position = dfVectorExtensions.Quantize(val.transform.position, 0.0625f);
				val.GetComponent<tk2dBaseSprite>().UpdateZDepth();
			}
			p.CurrentRoom.ApplyActionToNearbyEnemies(worldCenter, 2f, (Action<AIActor, float>)ProcessEnemy);
		}

		private void ProcessEnemy(AIActor a, float distance)
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			if (a.IsNormalEnemy && Object.op_Implicit((Object)(object)((BraveBehaviour)a).healthHaver) && !((BraveBehaviour)a).healthHaver.IsBoss)
			{
				((BraveBehaviour)a).healthHaver.ApplyDamage(100000f, Vector2.zero, "Telefrag", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false);
			}
		}

		public static GameObject BuildPrefab()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: 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_01f5: Expected O, but got Unknown
			GameObject val = SpriteBuilder.SpriteFromResource("RPGworldMod/Resources/ThrowableActives/Item/item_toss_001.png", new GameObject("ItemToss"), (Assembly)null);
			FakePrefabExtensions.MakeFakePrefab(val);
			tk2dSpriteAnimator val2 = val.AddComponent<tk2dSpriteAnimator>();
			PickupObject byId = PickupObjectDatabase.GetById(108);
			tk2dSpriteCollectionData spriteCollection = ((SpawnObjectPlayerItem)((byId is SpawnObjectPlayerItem) ? byId : null)).objectToSpawn.GetComponent<tk2dSpriteAnimator>().Library.clips[0].frames[0].spriteCollection;
			tk2dSpriteAnimationClip val3 = SpriteBuilder.AddAnimation(val2, spriteCollection, new List<int> { SpriteBuilder.AddSpriteToCollection("RPGworldMod/Resources/ThrowableActives/Item/item_toss_001.png", spriteCollection, (Assembly)null) }, "deploy", (WrapMode)2, 15f);
			tk2dSpriteAnimationClip val4 = SpriteBuilder.AddAnimation(val2, spriteCollection, new List<int>
			{
				SpriteBuilder.AddSpriteToCollection("RPGworldMod/Resources/ThrowableActives/Item/item_toss_001.png", spriteCollection, (Assembly)null),
				SpriteBuilder.AddSpriteToCollection("RPGworldMod/Resources/ThrowableActives/Item/item_toss_002.png", spriteCollection, (Assembly)null),
				SpriteBuilder.AddSpriteToCollection("RPGworldMod/Resources/ThrowableActives/Item/item_toss_003.png", spriteCollection, (Assembly)null),
				SpriteBuilder.AddSpriteToCollection("RPGworldMod/Resources/ThrowableActives/Item/item_toss_004.png", spriteCollection, (Assembly)null),
				SpriteBuilder.AddSpriteToCollection("RPGworldMod/Resources/ThrowableActives/Item/item_toss_005.png", spriteCollection, (Assembly)null),
				SpriteBuilder.AddSpriteToCollection("RPGworldMod/Resources/ThrowableActives/Item/item_toss_006.png", spriteCollection, (Assembly)null)
			}, "toss", (WrapMode)1, 15f);
			tk2dSpriteAnimationClip val5 = SpriteBuilder.AddAnimation(val2, spriteCollection, new List<int>
			{
				SpriteBuilder.AddSpriteToCollection("RPGworldMod/Resources/ThrowableActives/Item/item_vanish_001.png", spriteCollection, (Assembly)null),
				SpriteBuilder.AddSpriteToCollection("RPGworldMod/Resources/ThrowableActives/Item/item_vanish_002.png", spriteCollection, (Assembly)null),
				SpriteBuilder.AddSpriteToCollection("RPGworldMod/Resources/ThrowableActives/Item/item_vanish_003.png", spriteCollection, (Assembly)null),
				SpriteBuilder.AddSpriteToCollection("RPGworldMod/Resources/ThrowableActives/Item/item_vanish_004.png", spriteCollection, (Assembly)null),
				SpriteBuilder.AddSpriteToCollection("RPGworldMod/Resources/ThrowableActives/Item/item_vanish_005.png", spriteCollection, (Assembly)null),
				SpriteBuilder.AddSpriteToCollection("RPGworldMod/Resources/ThrowableActives/Item/item_vanish_006.png", spriteCollection, (Assembly)null)
			}, "vanish", (WrapMode)1, 15f);
			val4.fps = 12f;
			val4.loopStart = 0;
			CustomThrowableObject val6 = new CustomThrowableObject
			{
				doEffectOnHitGround = true,
				OnThrownAnimation = "deploy",
				OnHitGroundAnimation = "toss",
				DefaultAnim = "toss",
				destroyOnHitGround = false,
				thrownSoundEffect = "Play_OBJ_item_throw_01",
				effectSoundEffect = "Play_CHR_fall_land_01"
			};
			SpriteBuilder.AddComponent<CustomThrowableObject>(val, val6);
			return val;
		}
	}
	internal class MiscToolMethods
	{
		public static Projectile standardproj = ((BraveBehaviour)((Gun)PickupObjectDatabase.GetById(15)).DefaultModule.projectiles[0]).projectile;

		public static Projectile SpawnProjAtPosi(Projectile proj, Vector2 posi, PlayerController player, Gun gun, float var = 0f, float speedmult = 1f, bool postprocess = true)
		{
			//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_004e: Unknown result type (might be due to invalid IL or missing references)
			GameObject gameObject = ((Component)proj).gameObject;
			Vector3 val = Vector2.op_Implicit(posi);
			GameActor currentOwner = gun.CurrentOwner;
			GameObject val2 = SpawnManager.SpawnProjectile(gameObject, val, Quaternion.Euler(0f, 0f, ((Object)(object)((currentOwner is PlayerController) ? currentOwner : null).CurrentGun == (Object)null) ? 0f : (((GameActor)/*isinst with value type is only supported in some contexts*/).CurrentGun.CurrentAngle + var)), true);
			Projectile component = val2.GetComponent<Projectile>();
			if ((Object)(object)component != (Object)null)
			{
				component.Owner = (GameActor)(object)player;
				component.Shooter = ((BraveBehaviour)player).specRigidbody;
				ProjectileData baseData = component.baseData;
				baseData.speed *= speedmult;
				component.UpdateSpeed();
				if (postprocess)
				{
					player.DoPostProcessProjectile(proj);
				}
			}
			return component;
		}

		public static Projectile SpawnProjAtPosi(Projectile proj, Vector2 posi, PlayerController player, float Angle = 0f, float var = 0f, float speedmult = 1f, bool postprocess = true)
		{
			//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_001b: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = SpawnManager.SpawnProjectile(((Component)proj).gameObject, Vector2.op_Implicit(posi), Quaternion.Euler(0f, 0f, Angle + var), true);
			Projectile component = val.GetComponent<Projectile>();
			if ((Object)(object)component != (Object)null)
			{
				component.Owner = (GameActor)(object)player;
				component.Shooter = ((BraveBehaviour)player).specRigidbody;
				ProjectileData baseData = component.baseData;
				baseData.speed *= speedmult;
				component.UpdateSpeed();
				if (postprocess)
				{
					player.DoPostProcessProjectile(proj);
				}
			}
			return component;
		}

		public static List<T> RandomNoRepeats<T>(List<T> candidates, int count)
		{
			List<T> list = new List<T>();
			int num = 0;
			do
			{
				num++;
				int index = Random.Range(0, candidates.Count);
				if (!list.Contains(candidates[index]))
				{
					list.Add(candidates[index]);
				}
			}
			while (num < count * 3 && list.Count < count);
			return list;
		}

		public static float getPlayerDepth()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Invalid comparison between Unknown and I4
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Invalid comparison between Unknown and I4
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Invalid comparison between Unknown and I4
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Invalid comparison between Unknown and I4
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Invalid comparison between Unknown and I4
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Invalid comparison between Unknown and I4
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Invalid comparison between Unknown and I4
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Invalid comparison between Unknown and I4
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Invalid comparison between Unknown and I4
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Invalid comparison between Unknown and I4
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Invalid comparison between Unknown and I4
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Invalid comparison between Unknown and I4
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Invalid comparison between Unknown and I4
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Invalid comparison between Unknown and I4
			float result = 1f;
			if ((int)GameManager.Instance.Dungeon.tileIndices.tilesetId == 2)
			{
				result = 1f;
			}
			if ((int)GameManager.Instance.Dungeon.tileIndices.tilesetId == 4 || (int)GameManager.Instance.Dungeon.tileIndices.tilesetId == 8192)
			{
				result = 1.5f;
			}
			if ((int)GameManager.Instance.Dungeon.tileIndices.tilesetId == 1)
			{
				result = 2f;
			}
			if ((int)GameManager.Instance.Dungeon.tileIndices.tilesetId == 8 || (int)GameManager.Instance.Dungeon.tileIndices.tilesetId == 4096)
			{
				result = 2.5f;
			}
			if ((int)GameManager.Instance.Dungeon.tileIndices.tilesetId == 16)
			{
				result = 3f;
			}
			if ((int)GameManager.Instance.Dungeon.tileIndices.tilesetId == 32768)
			{
				result = 3.5f;
			}
			if ((int)GameManager.Instance.Dungeon.tileIndices.tilesetId == 32)
			{
				result = 4f;
			}
			if ((int)GameManager.Instance.Dungeon.tileIndices.tilesetId == 2048 || (int)GameManager.Instance.Dungeon.tileIndices.tilesetId == 1024)
			{
				result = 4.5f;
			}
			if ((int)GameManager.Instance.Dungeon.tileIndices.tilesetId == 64)
			{
				result = 5f;
			}
			if ((int)GameManager.Instance.Dungeon.tileIndices.tilesetId == 16384 || (int)GameManager.Instance.Dungeon.tileIndices.tilesetId == 128)
			{
				result = 5.5f;
			}
			return result;
		}

		public static VFXComplex CreateVFXComplex(string name, List<string> spritePaths, int fps, IntVector2 Dimensions, Anchor anchor, bool usesZHeight, float zHeightOffset, bool persist = false, VFXAlignment alignment = 1, float emissivePower = -1f, Color? emissiveColour = null, VFXPoolType type = 1)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: 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_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Expected O, but got Unknown
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: Unknown result type (might be due to invalid IL or missing references)
			//IL_031c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Expected O, but got Unknown
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject(name);
			VFXComplex val2 = new VFXComplex();
			VFXObject val3 = new VFXObject();
			val.SetActive(false);
			FakePrefab.MarkAsFakePrefab(val);
			Object.DontDestroyOnLoad((Object)(object)val);
			tk2dSpriteCollectionData val4 = SpriteBuilder.ConstructCollection(val, name + "_Collection", false);
			int num = SpriteBuilder.AddSpriteToCollection(spritePaths[0], val4, (Assembly)null);
			tk2dSprite orAddComponent = GameObjectExtensions.GetOrAddComponent<tk2dSprite>(val);
			((tk2dBaseSprite)orAddComponent).SetSprite(val4, num);
			tk2dSpriteDefinition currentSpriteDef = ((tk2dBaseSprite)orAddComponent).GetCurrentSpriteDef();
			currentSpriteDef.colliderVertices = (Vector3[])(object)new Vector3[2]
			{
				new Vector3(0f, 0f, 0f),
				new Vector3((float)(Dimensions.x / 16), (float)(Dimensions.y / 16), 0f)
			};
			tk2dSpriteAnimator orAddComponent2 = GameObjectExtensions.GetOrAddComponent<tk2dSpriteAnimator>(val);
			tk2dSpriteAnimation orAddComponent3 = GameObjectExtensions.GetOrAddComponent<tk2dSpriteAnimation>(val);
			orAddComponent3.clips = (tk2dSpriteAnimationClip[])(object)new tk2dSpriteAnimationClip[0];
			orAddComponent2.Library = orAddComponent3;
			tk2dSpriteAnimationClip val5 = new tk2dSpriteAnimationClip();
			val5.name = "start";
			val5.frames = (tk2dSpriteAnimationFrame[])(object)new tk2dSpriteAnimationFrame[0];
			val5.fps = fps;
			tk2dSpriteAnimationClip val6 = val5;
			List<tk2dSpriteAnimationFrame> list = new List<tk2dSpriteAnimationFrame>();
			for (int i = 0; i < spritePaths.Count; i++)
			{
				tk2dSpriteCollectionData val7 = val4;
				int num2 = SpriteBuilder.AddSpriteToCollection(spritePaths[i], val7, (Assembly)null);
				tk2dSpriteDefinition val8 = val7.spriteDefinitions[num2];
				val8.ConstructOffsetsFromAnchor(anchor);
				val8.colliderVertices = currentSpriteDef.colliderVertices;
				if (emissivePower > 0f)
				{
					val8.material.shader = ShaderCache.Acquire("Brave/LitTk2dCustomFalloffTintableTiltedCutoutEmissive");
				}
				if (emissivePower > 0f)
				{
					val8.material.SetFloat("_EmissiveColorPower", emissivePower);
				}
				if (emissiveColour.HasValue)
				{
					val8.material.SetColor("_EmissiveColor", emissiveColour.Value);
				}
				if (emissivePower > 0f)
				{
					val8.materialInst.shader = ShaderCache.Acquire("Brave/LitTk2dCustomFalloffTintableTiltedCutoutEmissive");
				}
				if (emissivePower > 0f)
				{
					val8.materialInst.SetFloat("_EmissiveColorPower", emissivePower);
				}
				if (emissiveColour.HasValue)
				{
					val8.materialInst.SetColor("_EmissiveColor", emissiveColour.Value);
				}
				list.Add(new tk2dSpriteAnimationFrame
				{
					spriteId = num2,
					spriteCollection = val7
				});
			}
			if (emissivePower > 0f)
			{
				((BraveBehaviour)orAddComponent).renderer.material.shader = ShaderCache.Acquire("Brave/LitTk2dCustomFalloffTintableTiltedCutoutEmissive");
			}
			if (emissivePower > 0f)
			{
				((BraveBehaviour)orAddComponent).renderer.material.SetFloat("_EmissiveColorPower", emissivePower);
			}
			if (emissiveColour.HasValue)
			{
				((BraveBehaviour)orAddComponent).renderer.material.SetColor("_EmissiveColor", emissiveColour.Value);
			}
			val6.frames = list.ToArray();
			val6.wrapMode = (WrapMode)2;
			orAddComponent3.clips = orAddComponent3.clips.Concat((IEnumerable<tk2dSpriteAnimationClip>)(object)new tk2dSpriteAnimationClip[1] { val6 }).ToArray();
			if (!persist)
			{
				SpriteAnimatorKiller val9 = ((Component)orAddComponent2).gameObject.AddComponent<SpriteAnimatorKiller>();
				val9.fadeTime = -1f;
				val9.animator = orAddComponent2;
				val9.delayDestructionTime = -1f;
			}
			orAddComponent2.playAutomatically = true;
			orAddComponent2.DefaultClipId = orAddComponent2.GetClipIdByName("start");
			val3.attached = true;
			val3.persistsOnDeath = persist;
			val3.usesZHeight = usesZHeight;
			val3.zHeight = zHeightOffset;
			val3.alignment = alignment;
			val3.destructible = false;
			val3.effect = val;
			val2.effects = (VFXObject[])(object)new VFXObject[1] { val3 };
			return val2;
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("dainplay.etg.rpgworld", "RPGworld mod", "1.0.1")]
	public class Plugin : BaseUnityPlugin
	{
		public const string GUID = "dainplay.etg.rpgworld";

		public const string NAME = "RPGworld mod";

		public const string VERSION = "1.0.1";

		public const string TEXT_COLOR = "#00FFAA";

		public void Start()
		{
			ETGModMainBehaviour.WaitForGameManagerStart((Action<GameManager>)GMStart);
		}

		public void GMStart(GameManager g)
		{
			Gruv_pistol.Add();
			Gruv_shotgun.Add();
			Gruv_assault_rifle.Add();
			Gruv_sniper_rifle.Add();
			Gruv_machine_gun.Add();
			Gruv_rocket_launcher.Add();
			Gruv_crown.Init();
			An_item.Init();
			InitialiseCharacters.Charactersetup();
			InitialiseSynergies.DoInitialisation();
			LogRainbow("RPGworld mod v1.0.1 started successfully.");
		}

		public static void Log(string text, string color = "#FFFFFF")
		{
			ETGModConsole.Log((object)("<color=" + color + ">" + text + "</color>"), false);
		}

		public static void LogRainbow(string text)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: 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_00c0: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			SGroup val = new SGroup
			{
				Size = new Vector2(20000f, 32f),
				AutoLayoutPadding = 0f
			};
			for (int i = 0; i < text.Length; i++)
			{
				char c = text[i];
				if (c == ' ')
				{
					((SElement)val).Children.Add((SElement)new SRect(Color.clear)
					{
						Size = Vector2.one * 10f
					});
					continue;
				}
				float num = Mathf.InverseLerp(0f, (float)text.Length, (float)i);
				Color foreground = Color.HSVToRGB(num, 1f, 1f);
				SLabel item = new SLabel(c.ToString())
				{
					Foreground = foreground,
					With = { (SModifier)(object)new SRainbowModifier() }
				};
				((SElement)val).Children.Add((SElement)(object)item);
			}
			val.AutoLayout = (SGroup g) => g.AutoLayoutHorizontal;
			((SElement)((ETGModMenu)ETGModConsole.Instance).GUI)[0].Children.Add((SElement)(object)val);
		}
	}
	public class SRainbowModifier : SModifier
	{
		private float startTime;

		private float baseHue;

		public override void Init()
		{
			//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_0018: Unknown result type (might be due to invalid IL or missing references)
			startTime = Time.realtimeSinceStartup;
			Color foreground = base.Elem.Foreground;
			float num = default(float);
			float num2 = default(float);
			Color.RGBToHSV(foreground, ref baseHue, ref num, ref num2);
		}

		public override void Update()
		{
			//IL_0059: 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_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			float num = Time.realtimeSinceStartup - startTime;
			float num2 = Mathf.Abs(num * -0.5f + baseHue) % 1f;
			int num3 = 8;
			int num4 = 2;
			int num5 = 3;
			float num6 = Mathf.Sin(num * (float)num5 + baseHue * (float)num3) * (float)num4;
			base.Elem.Foreground = Color.HSVToRGB(num2, 1f, 1f);
			base.Elem.Position = Vector2Extensions.WithY(base.Elem.Position, num6);
		}
	}
	public class StaticCoroutine : MonoBehaviour
	{
		public class EasyTrailComponent : BraveBehaviour
		{
			public Texture _gradTexture;

			private GameObject obj;

			public Vector2 TrailPos;

			public Color BaseColor;

			public Color StartColor;

			public Color EndColor;

			public float LifeTime;

			public float StartWidth;

			public float EndWidth;

			public EasyTrailComponent()
			{
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_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_0038: 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_0043: Unknown result type (might be due to invalid IL or missing references)
				TrailPos = Vector2.op_Implicit(new Vector3(0f, 0f, 0f));
				BaseColor = Color.red;
				StartColor = Color.red;
				EndColor = Color.white;
				LifeTime = 1f;
				StartWidth = 1f;
				EndWidth = 0f;
			}

			public void Start()
			{
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_0047: Unknown result type (might be due to invalid IL or missing references)
				//IL_004c: 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_007e: Expected O, but got Unknown
				//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
				obj = ((Component)this).gameObject;
				GameObject val = ETGMod.AddChild(obj, "trail object", new Type[0]);
				val.transform.position = obj.transform.position;
				val.transform.localPosition = Vector2.op_Implicit(TrailPos);
				TrailRenderer val2 = val.AddComponent<TrailRenderer>();
				((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0;
				((Renderer)val2).receiveShadows = false;
				Material val3 = new Material(Shader.Find("Sprites/Default"));
				val3.mainTexture = _gradTexture;
				((Renderer)val2).material = val3;
				val2.minVertexDistance = 0.1f;
				val3.SetColor("_Color", BaseColor);
				val2.startColor = StartColor;
				val2.endColor = EndColor;
				val2.time = LifeTime;
				val2.startWidth = StartWidth;
				val2.endWidth = EndWidth;
				val2.autodestruct = false;
			}
		}

		private static StaticCoroutine m_instance;

		private void OnDestroy()
		{
			((MonoBehaviour)m_instance).StopAllCoroutines();
		}

		private void OnApplicationQuit()
		{
			((MonoBehaviour)m_instance).StopAllCoroutines();
		}

		private static StaticCoroutine Build()
		{
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			if ((Object)(object)m_instance != (Object)null)
			{
				return m_instance;
			}
			m_instance = (StaticCoroutine)(object)Object.FindObjectOfType(typeof(StaticCoroutine));
			if ((Object)(object)m_instance != (Object)null)
			{
				return m_instance;
			}
			GameObject val = new GameObject("StaticCoroutine");
			val.AddComponent<StaticCoroutine>();
			m_instance = val.GetComponent<StaticCoroutine>();
			if ((Object)(object)m_instance != (Object)null)
			{
				return m_instance;
			}
			ETGModConsole.Log((object)"STATIC COROUTINE: Build did not generate a replacement instance. Method Failed!", false);
			return null;
		}

		public static void Start(string methodName)
		{
			((MonoBehaviour)Build()).StartCoroutine(methodName);
		}

		public static void Start(string methodName, object value)
		{
			((MonoBehaviour)Build()).StartCoroutine(methodName, value);
		}

		public static Coroutine Start(IEnumerator routine)
		{
			return ((MonoBehaviour)Build()).StartCoroutine(routine);
		}
	}
	public static class Stuff
	{
		public static GameObject WinchesterTargetHitVFX = ResourceManager.LoadAssetBundle("shared_auto_001").LoadAsset<GameObject>("VFX_Explosion_Firework");

		public static void Init()
		{
		}

		public static bool PlayerHasActiveSynergy(this PlayerController player, string synergyNameToCheck)
		{
			foreach (int activeExtraSynergy in player.ActiveExtraSynergies)
			{
				AdvancedSynergyEntry val = GameManager.Instance.SynergyManager.synergies[activeExtraSynergy];
				if (val.NameKey == synergyNameToCheck)
				{
					return true;
				}
			}
			return false;
		}

		public static T ReflectGetField<T>(Type classType, string fieldName, object o = null)
		{
			FieldInfo field = classType.GetField(fieldName, BindingFlags.Public | BindingFlags.NonPublic | ((o != null) ? BindingFlags.Instance : BindingFlags.Static));
			return (T)field.GetValue(o);
		}

		public static BeamController FreeFireBeamFromAnywhere(Projectile projectileToSpawn, PlayerController owner, GameObject otherShooter, Vector2 fixedPosition, bool usesFixedPosition, float targetAngle, float duration, bool skipChargeTime = false)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: 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_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = ((!usesFixedPosition) ? otherShooter.GetComponent<SpeculativeRigidbody>().UnitCenter : fixedPosition);
			GameObject val2 = SpawnManager.SpawnProjectile(((Component)projectileToSpawn).gameObject, Vector2.op_Implicit(val), Quaternion.identity, true);
			Projectile component = val2.GetComponent<Projectile>();
			component.Owner = (GameActor)(object)owner;
			BeamController component2 = val2.GetComponent<BeamController>();
			if (skipChargeTime)
			{
				component2.chargeDelay = 0f;
				component2.usesChargeDelay = false;
			}
			component2.Owner = (GameActor)(object)owner;
			component2.HitsPlayers = false;
			component2.HitsEnemies = true;
			Vector3 val3 = Vector2.op_Implicit(BraveMathCollege.DegreesToVector(targetAngle, 1f));
			component2.Direction = Vector2.op_Implicit(val3);
			component2.Origin = val;
			((MonoBehaviour)GameManager.Instance.Dungeon).StartCoroutine(HandleFreeFiringBeam(component2, otherShooter, fixedPosition, usesFixedPosition, targetAngle, duration));
			return component2;
		}

		public static IEnumerator HandleFreeFiringBeam(BeamController beam, GameObject otherShooter, Vector2 fixedPosition, bool usesFixedPosition, float targetAngle, float duration)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			float elapsed = 0f;
			yield return null;
			while (elapsed < duration && !((Object)(object)otherShooter == (Object)null) && !((Object)(object)otherShooter.GetComponent<SpeculativeRigidbody>() == (Object)null))
			{
				Vector2 vector = ((!usesFixedPosition) ? otherShooter.GetComponent<SpeculativeRigidbody>().UnitCenter : fixedPosition);
				elapsed += BraveTime.DeltaTime;
				beam.Origin = vector;
				beam.LateUpdatePosition(Vector2.op_Implicit(vector));
				yield return null;
			}
			beam.CeaseAttack();
		}

		public static bool CanBlinkToPoint(PlayerController Owner, Vector2 point)
		{
			//IL_0002: 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_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Invalid comparison between Unknown and I4
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Invalid comparison between Unknown and I4
			bool flag = Owner.IsValidPlayerPosition(point);
			if (flag && Owner.CurrentRoom != null)
			{
				CellData val = GameManager.Instance.Dungeon.data[Vector2Extensions.ToIntVector2(point, (VectorConversions)0)];
				if (val == null)
				{
					return false;
				}
				RoomHandler nearestRoom = val.nearestRoom;
				if ((int)val.type != 2)
				{
					flag = false;
				}
				if (Owner.CurrentRoom.IsSealed && nearestRoom != Owner.CurrentRoom)
				{
					flag = false;
				}
				if (Owner.CurrentRoom.IsSealed && val.isExitCell)
				{
					flag = false;
				}
				if ((int)nearestRoom.visibility == 0 || (int)nearestRoom.visibility == 3)
				{
					flag = false;
				}
			}
			if (Owner.CurrentRoom == null)
			{
				flag = false;
			}
			return !(Owner.IsDodgeRolling | ((GameActor)Owner).IsFalling | Owner.IsCurrentlyCoopReviving | Owner.IsInMinecart | Owner.IsInputOverridden) && flag;
		}

		public static bool PositionIsInBounds(PlayerController Owner, Vector2 point)
		{
			//IL_0023: 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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Invalid comparison between Unknown and I4
			bool flag = true;
			if (Owner.CurrentRoom != null)
			{
				CellData val = GameManager.Instance.Dungeon.data[Vector2Extensions.ToIntVector2(point, (VectorConversions)0)];
				if (val == null)
				{
					return false;
				}
				RoomHandler nearestRoom = val.nearestRoom;
				if ((int)val.type != 2)
				{
					flag = false;
				}
				if (Owner.CurrentRoom.IsSealed && nearestRoom != Owner.CurrentRoom)
				{
					flag = false;
				}
				if (Owner.CurrentRoom.IsSealed && val.isExitCell)
				{
					flag = false;
				}
				if ((int)nearestRoom.visibility == 0 || (int)nearestRoom.visibility == 3)
				{
					flag = false;
				}
			}
			if (Owner.CurrentRoom == null)
			{
				flag = false;
			}
			return !(Owner.IsDodgeRolling | ((GameActor)Owner).IsFalling | Owner.IsCurrentlyCoopReviving | Owner.IsInMinecart | Owner.IsInputOverridden) && flag;
		}

		public static Vector2 AdjustInputVector(Vector2 rawInput, float cardinalMagnetAngle, float ordinalMagnetAngle)
		{
			//IL_0001: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			float num = BraveMathCollege.ClampAngle360(BraveMathCollege.Atan2Degrees(rawInput));
			float num2 = num % 90f;
			float num3 = (num + 45f) % 90f;
			float num4 = 0f;
			if (cardinalMagnetAngle > 0f)
			{
				if (num2 < cardinalMagnetAngle)
				{
					num4 = 0f - num2;
				}
				else if (num2 > 90f - cardinalMagnetAngle)
				{
					num4 = 90f - num2;
				}
			}
			if (ordinalMagnetAngle > 0f)
			{
				if (num3 < ordinalMagnetAngle)
				{
					num4 = 0f - num3;
				}
				else if (num3 > 90f - ordinalMagnetAngle)
				{
					num4 = 90f - num3;
				}
			}
			num += num4;
			return Vector3Extensions.XY(Quaternion.Euler(0f, 0f, num) * Vector3.right) * ((Vector2)(ref rawInput)).magnitude;
		}
	}
	public class TeleportPlayerToCursorPosition : MonoBehaviour
	{
		private static Vector2 lockedDodgeRollDirection;

		public static BlinkPassiveItem m_BlinkPassive = ((Component)PickupObjectDatabase.GetById(436)).GetComponent<BlinkPassiveItem>();

		public GameObject BlinkpoofVfx = m_BlinkPassive.BlinkpoofVfx;

		public static GameObject BloodiedScarfPoofVFX = ((Component)PickupObjectDatabase.GetById(436)).GetComponent<BlinkPassiveItem>().BlinkpoofVfx.gameObject;

		public static void StartTeleport(PlayerController user, Vector2 newPosition)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			((BraveBehaviour)user).healthHaver.TriggerInvulnerabilityPeriod(0.001f);
			user.DidUnstealthyAction();
			Vector2 targetPoint = BraveMathCollege.ClampToBounds(newPosition, GameManager.Instance.MainCameraController.MinVisiblePoint, GameManager.Instance.MainCameraController.MaxVisiblePoint);
			BlinkToPoint(user, targetPoint);
		}

		private static void BlinkToPoint(PlayerController Owner, Vector2 targetPoint)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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_0030: 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_0039: 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_0049: 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_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)
			Vector2 val = targetPoint - ((BraveBehaviour)Owner).specRigidbody.UnitCenter;
			lockedDodgeRollDirection = ((Vector2)(ref val)).normalized;
			Vector2 val2 = Vector2.op_Implicit(((BraveBehaviour)Owner).transform.position);
			int num = (int)targetPoint.x;
			int num2 = (int)targetPoint.y;
			int num3 = (int)val2.x;
			int num4 = (int)val2.y;
			int num5 = Math.Abs(num3 - num);
			int num6 = ((num < num3) ? 1 : (-1));
			int num7 = -Math.Abs(num4 - num2);
			int num8 = ((num2 < num4) ? 1 : (-1));
			int num9 = num5 + num7;
			int num10 = 600;
			while (num10 > 0 && (num != num3 || num2 != num4))
			{
				if (CanBlinkToPoint(new Vector2((float)num, (float)num2), Owner))
				{
					StaticCoroutine.Start(HandleBlinkTeleport(Owner, new Vector2((float)num, (float)num2), lockedDodgeRollDirection));
					break;
				}
				int num11 = 2 * num9;
				if (num11 >= num7)
				{
					num9 += num7;
					num += num6;
				}
				if (num11 <= num5)
				{
					num9 += num5;
					num2 += num8;
				}
				num10--;
			}
		}

		private static bool CanBlinkToPoint(Vector2 point, PlayerController owner)
		{
			//IL_0009: 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_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Invalid comparison between Unknown and I4
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Invalid comparison between Unknown and I4
			RoomHandler currentRoom = owner.CurrentRoom;
			bool flag = owner.IsValidPlayerPosition(point);
			if (flag && currentRoom != null)
			{
				CellData val = GameManager.Instance.Dungeon.data[Vector2Extensions.ToIntVector2(point, (VectorConversions)0)];
				if (val == null)
				{
					return false;
				}
				RoomHandler nearestRoom = val.nearestRoom;
				if ((int)val.type != 2)
				{
					flag = false;
				}
				if (currentRoom.IsSealed && nearestRoom != currentRoom)
				{
					flag = false;
				}
				if (currentRoom.IsSealed && val.isExitCell)
				{
					flag = false;
				}
				if ((int)nearestRoom.visibility == 0 || (int)nearestRoom.visibility == 3)
				{
					flag = false;
				}
			}
			if (currentRoom == null)
			{
				flag = false;
			}
			return flag;
		}

		private static IEnumerator HandleBlinkTeleport(PlayerController Owner, Vector2 targetPoint, Vector2 targetDirection)
		{
			//IL_000e: 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_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			AkSoundEngine.PostEvent("Play_ENM_wizardred_vanish_01", ((Component)Owner).gameObject);
			List<AIActor> list = Stuff.ReflectGetField<List<AIActor>>(typeof(PlayerController), "m_rollDamagedEnemies", Owner);
			if (list != null)
			{
				list.Clear();
				FieldInfo field = typeof(PlayerController).GetField("m_rollDamagedEnemies", BindingFlags.Instance | BindingFlags.NonPublic);
				field.SetValue(Owner, list);
			}
			if (Object.op_Implicit((Object)(object)((BraveBehaviour)Owner).knockbackDoer))
			{
				((BraveBehaviour)Owner).knockbackDoer.ClearContinuousKnockbacks();
			}
			Owner.IsEthereal = true;
			Owner.IsVisible = false;
			float RecoverySpeed = GameManager.Instance.MainCameraController.OverrideRecoverySpeed;
			bool IsLerping = GameManager.Instance.MainCameraController.IsLerping;
			yield return (object)new WaitForSeconds(0.1f);
			GameManager.Instance.MainCameraController.OverrideRecoverySpeed = 80f;
			GameManager.Instance.MainCameraController.IsLerping = true;
			if (Owner.IsPrimaryPlayer)
			{
				GameManager.Instance.MainCameraController.UseOverridePlayerOnePosition = true;
				GameManager.Instance.MainCameraController.OverridePlayerOnePosition = targetPoint;
				yield return (object)new WaitForSeconds(0.12f);
				((BraveBehaviour)Owner).specRigidbody.Velocity = Vector2.zero;
				((BraveBehaviour)Owner).specRigidbody.Position = new Position(targetPoint);
				GameManager.Instance.MainCameraController.UseOverridePlayerOnePosition = false;
			}
			else
			{
				GameManager.Instance.MainCameraController.UseOverridePlayerTwoPosition = true;
				GameManager.Instance.MainCameraController.OverridePlayerTwoPosition = targetPoint;
				yield return (object)new WaitForSeconds(0.12f);
				((BraveBehaviour)Owner).specRigidbody.Velocity = Vector2.zero;
				((BraveBehaviour)Owner).specRigidbody.Position = new Position(targetPoint);
				GameManager.Instance.MainCameraController.UseOverridePlayerTwoPosition = false;
			}
			GameManager.Instance.MainCameraController.OverrideRecoverySpeed = RecoverySpeed;
			GameManager.Instance.MainCameraController.IsLerping = IsLerping;
			Owner.IsEthereal = false;
			Owner.IsVisible = true;
			if (!(Owner.CurrentFireMeterValue <= 0f))
			{
				Owner.CurrentFireMeterValue = Mathf.Max(0f, Owner.CurrentFireMeterValue -= 0.5f);
				if (Owner.CurrentFireMeterValue == 0f)
				{
					Owner.IsOnFire = false;
				}
			}
		}

		public static void CorrectForWalls(PlayerController portal)
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			if (!PhysicsEngine.Instance.OverlapCast(((BraveBehaviour)portal).specRigidbody, (List<CollisionData>)null, true, false, (int?)null, (int?)null, false, (Vector2?)null, (Func<SpeculativeRigidbody, bool>)null, (SpeculativeRigidbody[])(object)new SpeculativeRigidbody[0]))
			{
				return;
			}
			Vector2 val = Vector3Extensions.XY(((BraveBehaviour)portal).transform.position);
			IntVector2[] cardinalsAndOrdinals = IntVector2.CardinalsAndOrdinals;
			int num = 0;
			int num2 = 1;
			do
			{
				for (int i = 0; i < cardinalsAndOrdinals.Length; i++)
				{
					((BraveBehaviour)portal).specRigidbody.Position = new Position(val + PhysicsEngine.PixelToUnit(cardinalsAndOrdinals[i] * num2));
					((BraveBehaviour)portal).specRigidbody.Reinitialize();
					if (!PhysicsEngine.Instance.OverlapCast(((BraveBehaviour)portal).specRigidbody, (List<CollisionData>)null, true, false, (int?)null, (int?)null, false, (Vector2?)null, (Func<SpeculativeRigidbody, bool>)null, (SpeculativeRigidbody[])(object)new SpeculativeRigidbody[0]))
					{
						return;
					}
				}
				num2++;
				num++;
			}
			while (num <= 200);
			Debug.LogError((object)"FREEZE AVERTED!  TELL RUBEL!  (you're welcome) 147");
		}
	}
	public static class GunTools
	{
		public static tk2dSpriteDefinition CopyDefinitionFrom(this tk2dSpriteDefinition other)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: 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_0045: 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_004b: 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_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: 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_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: 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_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Expected O, but got Unknown
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: 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_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: 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_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: Unknown result type (might be due to invalid IL or missing references)
			//IL_0326: Unknown result type (might be due to invalid IL or missing references)
			//IL_0329: Unknown result type (might be due to invalid IL or missing references)
			//IL_0365: Unknown result type (might be due to invalid IL or missing references)
			//IL_0366: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Expected O, but got Unknown
			//IL_0384: Unknown result type (might be due to invalid IL or missing references)
			//IL_0389: Unknown result type (might be due to invalid IL or missing references)
			//IL_038f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0397: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a5: Unknown result type (might be due to