Decompiled source of AdvancedMovementPack v1.0.0

AdvancedMovementPack/AdvancedMovementPack/AdvancedMovementPack.dll

Decompiled a year ago
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using AdvancedMovementPack.Cards;
using BepInEx;
using UnboundLib.Cards;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("AdvancedMovementPack")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AdvancedMovementPack")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("1926c2cb-c879-4017-a6a3-1c0717de1dd9")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace AdvancedMovementPack
{
	[BepInPlugin("com.joel.rounds.advancedmovementpack", "Advanced Movement Pack", "1.0.0")]
	[BepInProcess("Rounds.exe")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class AdvancedMovementPack : BaseUnityPlugin
	{
		private const string ModId = "com.joel.rounds.advancedmovementpack";

		private const string ModName = "Advanced Movement Pack";

		private const string ModVersion = "1.0.0";

		private void Awake()
		{
			CustomCard.BuildCard<SwiftShrink>();
			CustomCard.BuildCard<Geppo>();
			CustomCard.BuildCard<Grapple>();
			CustomCard.BuildCard<Momentum>();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Advanced Movement Pack loaded");
			string[] manifestResourceNames = Assembly.GetExecutingAssembly().GetManifestResourceNames();
			foreach (string text in manifestResourceNames)
			{
				Debug.Log((object)("[AdvancedMovementPack] Resource: " + text));
			}
		}
	}
}
namespace AdvancedMovementPack.Cards
{
	public class Geppo : CustomCard
	{
		protected override string GetTitle()
		{
			return "Geppo";
		}

		protected override string GetDescription()
		{
			return "Soar! With extra jumpheight.";
		}

		protected override GameObject GetCardArt()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: 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_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AdvancedMovementPack.Resources.Geppo.png");
			if (stream == null)
			{
				Debug.LogError("[Geppo] Resource not found!");
				return new GameObject("GeppoArt_Missing");
			}
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
			ImageConversion.LoadImage(val, array);
			Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 1f);
			GameObject val2 = new GameObject("GeppoArt");
			Image obj = val2.AddComponent<Image>();
			obj.sprite = sprite;
			obj.preserveAspect = true;
			val2.GetComponent<RectTransform>().sizeDelta = new Vector2((float)((Texture)val).width, (float)((Texture)val).height);
			((Object)val2).hideFlags = (HideFlags)61;
			return val2;
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)0;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)2;
		}

		protected override CardInfoStat[] GetStats()
		{
			//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_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_0032: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Jump Height",
					amount = "+100%",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			characterStats.jump += 1f;
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			characterStats.jump -= 1f;
		}

		public override string GetModName()
		{
			return "Advanced Movement Pack";
		}
	}
	public class Momentum : CustomCard
	{
		protected override string GetTitle()
		{
			return "Momentum";
		}

		protected override string GetDescription()
		{
			return "Accelerate while moving (up to +100%). Lose the momentum if you stop.";
		}

		protected override GameObject GetCardArt()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: 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_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AdvancedMovementPack.Resources.Momentum.png");
			if (stream == null)
			{
				Debug.LogError("[Momentum] Resource not found!");
				return new GameObject("MomentumArt_Missing");
			}
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
			ImageConversion.LoadImage(val, array);
			Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 1f);
			GameObject val2 = new GameObject("MomentumArt");
			Image obj = val2.AddComponent<Image>();
			obj.sprite = sprite;
			obj.preserveAspect = true;
			val2.GetComponent<RectTransform>().sizeDelta = new Vector2((float)((Texture)val).width, (float)((Texture)val).height);
			((Object)val2).hideFlags = (HideFlags)61;
			return val2;
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)1;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)0;
		}

		protected override CardInfoStat[] GetStats()
		{
			//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_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_0032: Expected O, but got Unknown
			//IL_0034: 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_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Acceleration",
					amount = "+100%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Block Cooldown",
					amount = "+1s",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			MomentumHandler momentumHandler = ((Component)player).gameObject.GetComponent<MomentumHandler>();
			if ((Object)(object)momentumHandler == (Object)null)
			{
				momentumHandler = ((Component)player).gameObject.AddComponent<MomentumHandler>();
			}
			momentumHandler.cardCount++;
			block.cdAdd += 1f;
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			MomentumHandler component = ((Component)player).gameObject.GetComponent<MomentumHandler>();
			if ((Object)(object)component != (Object)null)
			{
				component.cardCount--;
				if (component.cardCount <= 0)
				{
					Object.Destroy((Object)(object)component);
				}
			}
			block.cdAdd -= 1f;
		}

		public override string GetModName()
		{
			return "Advanced Movement Pack";
		}
	}
	public class MomentumHandler : MonoBehaviour
	{
		public int cardCount;

		private Player player;

		private CharacterStatModifiers stats;

		private float currentBoost = 1f;

		private const float accelerationRate = 0.2f;

		private float stopTimer;

		private const float stopThreshold = 0.15f;

		private GameObject particleGO;

		private ParticleSystem ps;

		private EmissionModule emission;

		private void Start()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Expected O, but got Unknown
			player = ((Component)this).GetComponent<Player>();
			stats = ((Component)this).GetComponent<CharacterStatModifiers>();
			particleGO = new GameObject("MomentumTrail");
			particleGO.transform.SetParent(((Component)this).transform, false);
			particleGO.transform.localPosition = Vector3.zero;
			ps = particleGO.AddComponent<ParticleSystem>();
			MainModule main = ps.main;
			((MainModule)(ref main)).startColor = new MinMaxGradient(Color.red);
			((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0.08f);
			((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.25f);
			((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(6f);
			((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
			((MainModule)(ref main)).maxParticles = 1000;
			ShapeModule shape = ps.shape;
			((ShapeModule)(ref shape)).enabled = true;
			((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)4;
			((ShapeModule)(ref shape)).angle = 25f;
			((ShapeModule)(ref shape)).radius = 0.2f;
			((ShapeModule)(ref shape)).rotation = new Vector3(180f, 0f, 0f);
			emission = ps.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f);
			((Renderer)((Component)ps).GetComponent<ParticleSystemRenderer>()).material = new Material(Shader.Find("Sprites/Default"));
		}

		private void OnDestroy()
		{
			if ((Object)(object)particleGO != (Object)null)
			{
				Object.Destroy((Object)(object)particleGO);
			}
		}

		private void Update()
		{
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)player == (Object)null || (Object)(object)stats == (Object)null)
			{
				return;
			}
			bool flag = Mathf.Abs(player.data.input.direction.x) > 0.05f || Mathf.Abs(player.data.input.direction.y) > 0.05f;
			float num = 1f + 1f * (float)cardCount;
			float num2 = (flag ? num : 1f);
			if (flag)
			{
				stopTimer = 0f;
				currentBoost = Mathf.MoveTowards(currentBoost, num2, 0.2f * Time.deltaTime);
			}
			else
			{
				stopTimer += Time.deltaTime;
				if (stopTimer >= 0.15f)
				{
					currentBoost = 1f;
				}
			}
			stats.movementSpeed = currentBoost;
			if (((EmissionModule)(ref emission)).enabled)
			{
				((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit((currentBoost >= num - 0.01f && flag) ? 200f : 0f);
			}
			else
			{
				((EmissionModule)(ref emission)).enabled = true;
			}
			if ((Object)(object)particleGO != (Object)null)
			{
				particleGO.transform.position = ((Component)this).transform.position;
			}
		}
	}
	public class SwiftShrink : CustomCard
	{
		protected override string GetTitle()
		{
			return "Swift Shrink";
		}

		protected override string GetDescription()
		{
			return "Smaller and quicker — small HP tradeoff.";
		}

		protected override GameObject GetCardArt()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: 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_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AdvancedMovementPack.Resources.SwiftShrink.png");
			if (stream == null)
			{
				Debug.LogError("[SwiftShrink] Resource not found!");
				return new GameObject("SwiftShrinkArt_Missing");
			}
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
			ImageConversion.LoadImage(val, array);
			Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 1f);
			GameObject val2 = new GameObject("SwiftShrink");
			Image obj = val2.AddComponent<Image>();
			obj.sprite = sprite;
			obj.preserveAspect = true;
			val2.GetComponent<RectTransform>().sizeDelta = new Vector2((float)((Texture)val).width, (float)((Texture)val).height);
			((Object)val2).hideFlags = (HideFlags)61;
			return val2;
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)0;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)2;
		}

		protected override CardInfoStat[] GetStats()
		{
			//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_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_0032: Expected O, but got Unknown
			//IL_0034: 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_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: 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_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Move Speed",
					amount = "+30%",
					simepleAmount = (SimpleAmount)3
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Size",
					amount = "-20%",
					simepleAmount = (SimpleAmount)1
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Health",
					amount = "-10%",
					simepleAmount = (SimpleAmount)6
				}
			};
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			characterStats.movementSpeed *= 1.3f;
			characterStats.sizeMultiplier *= 0.8f;
			characterStats.health *= 0.9f;
		}

		public override void OnRemoveCard()
		{
		}

		public override string GetModName()
		{
			return "Advanced Movement Pack";
		}
	}
	public class Grapple : CustomCard
	{
		protected override string GetTitle()
		{
			return "Grapple";
		}

		protected override string GetDescription()
		{
			return "Grapple yourself to where your bullet lands.";
		}

		protected override GameObject GetCardArt()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: 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_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AdvancedMovementPack.Resources.Grapple.png");
			if (stream == null)
			{
				Debug.LogError("[Grapple] Resource not found!");
				return new GameObject("GrappleArt_Missing");
			}
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
			ImageConversion.LoadImage(val, array);
			Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 1f);
			GameObject val2 = new GameObject("GrappleArt");
			Image obj = val2.AddComponent<Image>();
			obj.sprite = sprite;
			obj.preserveAspect = true;
			val2.GetComponent<RectTransform>().sizeDelta = new Vector2((float)((Texture)val).width, (float)((Texture)val).height);
			((Object)val2).hideFlags = (HideFlags)61;
			return val2;
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)2;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)8;
		}

		protected override CardInfoStat[] GetStats()
		{
			//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_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_0032: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "but you can't hide.",
					amount = "You can run",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_001e: 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_002f: Expected O, but got Unknown
			GameObject val = new GameObject("GrappleBulletPrefab");
			val.AddComponent<GrappleBullet>().owner = player;
			gun.objectsToSpawn = gun.objectsToSpawn.Append(new ObjectsToSpawn
			{
				AddToProjectile = val
			}).ToArray();
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			gun.objectsToSpawn = gun.objectsToSpawn.Where((ObjectsToSpawn o) => (Object)(object)o.AddToProjectile == (Object)null || ((Object)o.AddToProjectile).name != "GrappleBulletPrefab").ToArray();
		}

		public override string GetModName()
		{
			return "Advanced Movement Pack";
		}
	}
	public class GrappleBullet : MonoBehaviour
	{
		public Player owner;

		private bool grappled;

		private void Start()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Expected O, but got Unknown
			ProjectileHit componentInParent = ((Component)this).GetComponentInParent<ProjectileHit>();
			if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.ownPlayer != (Object)null)
			{
				owner = componentInParent.ownPlayer;
			}
			ParticleSystem obj = ((Component)this).gameObject.AddComponent<ParticleSystem>();
			MainModule main = obj.main;
			((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(Color.magenta);
			((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0.15f);
			((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.2f);
			((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
			EmissionModule emission = obj.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f);
			((EmissionModule)(ref emission)).rateOverDistance = MinMaxCurve.op_Implicit(40f);
			ShapeModule shape = obj.shape;
			((ShapeModule)(ref shape)).enabled = false;
			((Renderer)((Component)obj).GetComponent<ParticleSystemRenderer>()).material = new Material(Shader.Find("Sprites/Default"));
		}

		private void OnDestroy()
		{
			TryGrapple();
		}

		private void OnDisable()
		{
			TryGrapple();
		}

		private void TryGrapple()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			if (!grappled && !((Object)(object)owner == (Object)null))
			{
				grappled = true;
				((Component)owner).transform.position = ((Component)this).transform.position;
			}
		}
	}
}