Decompiled source of ChensGradiusMod v4.0.6

ChensGradiusMod.dll

Decompiled 3 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using Chen.GradiusMod.Artifacts;
using Chen.GradiusMod.Artifacts.Machines;
using Chen.GradiusMod.Compatibility;
using Chen.GradiusMod.Drones;
using Chen.GradiusMod.Drones.TC280;
using Chen.GradiusMod.Items;
using Chen.GradiusMod.Items.GradiusOption;
using Chen.GradiusMod.Items.GradiusOption.Components;
using Chen.GradiusMod.Items.OptionSeed;
using Chen.GradiusMod.Items.OptionSeed.Components;
using Chen.GradiusMod.Mirroring;
using Chen.GradiusMod.Modules;
using Chen.Helpers.CollectionHelpers;
using Chen.Helpers.GeneralHelpers;
using Chen.Helpers.LogHelpers;
using Chen.Helpers.MathHelpers;
using Chen.Helpers.UnityHelpers;
using EntityStates;
using EntityStates.Bandit2.Weapon;
using EntityStates.BeetleGuardMonster;
using EntityStates.Captain.Weapon;
using EntityStates.Commando.CommandoWeapon;
using EntityStates.Croco;
using EntityStates.Drifter;
using EntityStates.Drone;
using EntityStates.Drone.DroneBombardment;
using EntityStates.Drone.DroneCopycat;
using EntityStates.Drone.DroneJailer;
using EntityStates.Drone.DroneWeapon;
using EntityStates.DroneTech.Weapon;
using EntityStates.DroneWeaponsChainGun;
using EntityStates.Engi.EngiMissilePainter;
using EntityStates.Engi.EngiWeapon;
using EntityStates.EngiTurret.EngiTurretWeapon;
using EntityStates.GolemMonster;
using EntityStates.Huntress;
using EntityStates.Huntress.HuntressWeapon;
using EntityStates.Loader;
using EntityStates.Mage.Weapon;
using EntityStates.Merc;
using EntityStates.Railgunner.Weapon;
using EntityStates.Seeker;
using EntityStates.Squid.SquidWeapon;
using EntityStates.TitanMonster;
using EntityStates.Toolbot;
using EntityStates.Treebot;
using EntityStates.Treebot.Weapon;
using EntityStates.Turret1;
using EntityStates.VoidSurvivor.Weapon;
using LookingGlass.ItemStatsNameSpace;
using Microsoft.CodeAnalysis;
using On.EntityStates;
using On.EntityStates.Bandit2.Weapon;
using On.EntityStates.BeetleGuardMonster;
using On.EntityStates.Captain.Weapon;
using On.EntityStates.Commando.CommandoWeapon;
using On.EntityStates.Croco;
using On.EntityStates.Drone;
using On.EntityStates.Drone.DroneBombardment;
using On.EntityStates.Drone.DroneCopycat;
using On.EntityStates.Drone.DroneJailer;
using On.EntityStates.Drone.DroneWeapon;
using On.EntityStates.DroneWeaponsChainGun;
using On.EntityStates.Engi.EngiMissilePainter;
using On.EntityStates.Engi.EngiWeapon;
using On.EntityStates.EngiTurret.EngiTurretWeapon;
using On.EntityStates.Huntress;
using On.EntityStates.Huntress.HuntressWeapon;
using On.EntityStates.Loader;
using On.EntityStates.Mage.Weapon;
using On.EntityStates.Merc;
using On.EntityStates.Railgunner.Weapon;
using On.EntityStates.Squid.SquidWeapon;
using On.EntityStates.TitanMonster;
using On.EntityStates.Toolbot;
using On.EntityStates.Treebot;
using On.EntityStates.Treebot.Weapon;
using On.EntityStates.Turret1;
using On.EntityStates.VoidSurvivor.Weapon;
using On.RoR2;
using On.RoR2.Projectile;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using RoR2;
using RoR2.AsyncManagement;
using RoR2.CharacterAI;
using RoR2.Navigation;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("ChensGradiusMod.Tests")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ChensGradiusMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("3.5.4.0")]
[assembly: AssemblyInformationalVersion("3.5.4+3ef933aaaf95c5f24744e5b96e8c8f7966cfbee3")]
[assembly: AssemblyProduct("ChensGradiusMod")]
[assembly: AssemblyTitle("ChensGradiusMod")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/cheeeeeeeeeen/RoR2-ChensGradiusMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("3.5.4.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace Chen.GradiusMod
{
	public static class Extensions
	{
		public static bool SafeCheck(this Dictionary<string, Object> dictionary, string key)
		{
			if (dictionary.ContainsKey(key))
			{
				return Object.op_Implicit(dictionary[key]);
			}
			return false;
		}

		public static void MuzzleEffect(this GameObject catalyst, GameObject effectPrefab, bool transmit)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: 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_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_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			EffectData val = new EffectData
			{
				origin = catalyst.transform.position,
				rotation = catalyst.transform.rotation,
				rootObject = catalyst
			};
			EffectManager.SpawnEffect(effectPrefab, val, transmit);
		}

		public static void SetAllDriversToAimTowardsEnemies(this GameObject masterObject)
		{
			if ((Object)(object)masterObject == (Object)null)
			{
				Debug.LogError((object)"SetAllDriversToAimTowardsEnemies: masterObject is null.");
				return;
			}
			AISkillDriver[] components = masterObject.GetComponents<AISkillDriver>();
			if (components == null || components.Length == 0)
			{
				Debug.LogError((object)("SetAllDriversToAimTowardsEnemies: No AISkillDrivers found on '" + ((Object)masterObject).name + "'."));
			}
			else
			{
				components.SetAllDriversToAimTowardsEnemies();
			}
		}

		public static void SetAllDriversToAimTowardsEnemies(this AISkillDriver[] skillDrivers)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			foreach (AISkillDriver val in skillDrivers)
			{
				if ((Object)(object)val != (Object)null)
				{
					val.aimType = (AimType)2;
				}
			}
		}

		public static void AssignDeathBehavior(this GameObject masterObject, Type newStateType)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			CharacterMaster component = masterObject.GetComponent<CharacterMaster>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				GradiusModPlugin.Log.Warning((object)"Extensions.AssignDeathBehavior: CharacterMaster component not found!");
				return;
			}
			GameObject bodyPrefab = component.bodyPrefab;
			CharacterDeathBehavior orAddComponent = Extensions.GetOrAddComponent<CharacterDeathBehavior>(bodyPrefab);
			orAddComponent.deathState = new SerializableEntityStateType(newStateType);
		}

		public static void FilterOutOwnerFromAttack(this BulletAttack bulletAttack)
		{
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Expected O, but got Unknown
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Expected O, but got Unknown
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			FilterCallback originalFilterCallback = bulletAttack.filterCallback ?? BulletAttack.defaultFilterCallback;
			HitCallback originalHitCallback = bulletAttack.hitCallback ?? BulletAttack.defaultHitCallback;
			TeamComponent val = (Object.op_Implicit((Object)(object)bulletAttack.owner) ? bulletAttack.owner.GetComponent<TeamComponent>() : null);
			TeamIndex? teamIndex = bulletAttack.teamIndexOverride ?? (Object.op_Implicit((Object)(object)val) ? new TeamIndex?(val.teamIndex) : ((TeamIndex?)null));
			bulletAttack.filterCallback = (FilterCallback)delegate(BulletAttack attack, ref BulletHit hitInfo)
			{
				//IL_0041: Unknown result type (might be due to invalid IL or missing references)
				//IL_009d: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)bulletAttack.owner == (Object)(object)hitInfo.entityObject || (Object)(object)bulletAttack.weapon == (Object)(object)hitInfo.entityObject)
				{
					return false;
				}
				if (teamIndex.HasValue && (int)FriendlyFireManager.friendlyFireMode == 0)
				{
					HurtBox val2 = (Object.op_Implicit((Object)(object)hitInfo.collider) ? ((Component)hitInfo.collider).GetComponent<HurtBox>() : null);
					if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.healthComponent) && Object.op_Implicit((Object)(object)val2.healthComponent.body) && val2.healthComponent.body.teamComponent.teamIndex == teamIndex.Value)
					{
						return false;
					}
				}
				return originalFilterCallback.Invoke(attack, ref hitInfo);
			};
			bulletAttack.hitCallback = (HitCallback)delegate(BulletAttack attack, ref BulletHit hitInfo)
			{
				return !((Object)(object)bulletAttack.owner == (Object)(object)hitInfo.entityObject) && !((Object)(object)bulletAttack.weapon == (Object)(object)hitInfo.entityObject) && originalHitCallback.Invoke(attack, ref hitInfo);
			};
		}

		public static void InitializeDroneModelComponents(this GameObject droneModel, CharacterBody droneBody, float colliderMultiplier)
		{
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			CapsuleCollider componentInChildren = droneModel.GetComponentInChildren<CapsuleCollider>();
			if (!Object.op_Implicit((Object)(object)componentInChildren))
			{
				GradiusModPlugin.Log.Warning((object)"Extensions.InitializeDroneModelComponents: CapsuleCollider not found! Cannot setup HurtBoxes without it.");
				return;
			}
			CharacterModel val = droneModel.AddComponent<CharacterModel>();
			val.body = droneBody;
			Extensions.BuildRendererInfos(val, droneModel);
			val.autoPopulateLightInfos = true;
			val.invisibilityCount = 0;
			val.temporaryOverlays = new List<TemporaryOverlayInstance>();
			HurtBoxGroup val2 = droneModel.AddComponent<HurtBoxGroup>();
			HurtBox val3 = ((Component)componentInChildren).gameObject.AddComponent<HurtBox>();
			((Component)val3).gameObject.layer = LayerIndex.entityPrecise.intVal;
			val3.healthComponent = ((Component)droneBody).GetComponent<HealthComponent>();
			val3.isBullseye = true;
			val3.damageModifier = (DamageModifier)0;
			val3.hurtBoxGroup = val2;
			val3.indexInGroup = 0;
			val2.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val3 };
			val2.mainHurtBox = val3;
			val2.bullseyeCount = 1;
			CapsuleCollider component = ((Component)droneBody).GetComponent<CapsuleCollider>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.center = componentInChildren.center;
				component.radius = componentInChildren.radius * colliderMultiplier;
				component.height = componentInChildren.height * colliderMultiplier;
				component.direction = componentInChildren.direction;
			}
		}
	}
	[BepInPlugin("com.Chen.ChensGradiusMod", "ChensGradiusMod", "4.0.6")]
	[BepInDependency("com.bepis.r2api", "5.3.0")]
	[BepInDependency("com.Chen.ChensHelpers", "1.2.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	public class GradiusModPlugin : BaseUnityPlugin
	{
		internal class GlobalConfig
		{
			private const string Section = "General";

			public bool emergencyDroneFix { get; private set; } = true;

			public bool gunnerDronesAreRepurchaseable { get; private set; } = true;

			public bool turretsAreRepurchaseable { get; private set; } = true;

			public bool healingDronesAreRepurchaseable { get; private set; } = true;

			public bool emergencyDronesAreRepurchaseable { get; private set; } = true;

			public bool flameDronesAreRepurchaseable { get; private set; } = true;

			public bool missileDronesAreRepurchaseable { get; private set; } = true;

			public bool megaDronesAreRepurchaseable { get; private set; } = true;

			public bool equipmentDronesAreRepurchaseable { get; private set; } = true;

			public float dropEquipFromDroneChance { get; private set; }

			public int flameDroneWeightScorchedAcres { get; private set; } = 1;

			public int flameDroneWeightAbyssalDepths { get; private set; } = 3;

			public bool turretsAsDroneCategory { get; private set; } = true;

			public void Bind(ConfigFile config)
			{
				//IL_0131: Unknown result type (might be due to invalid IL or missing references)
				//IL_013b: Expected O, but got Unknown
				//IL_016c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0176: Expected O, but got Unknown
				//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b1: Expected O, but got Unknown
				emergencyDroneFix = config.Bind<bool>("General", "EmergencyDroneFix", emergencyDroneFix, "Applies a fix for Emergency Drones. Set to false if there are issues regarding compatibility.").Value;
				gunnerDronesAreRepurchaseable = BindRepurchase(config, "GunnerDronesAreRepurchaseable", "Gunner Drones", gunnerDronesAreRepurchaseable);
				turretsAreRepurchaseable = BindRepurchase(config, "TurretsAreRepurchaseable", "Gunner Turrets", turretsAreRepurchaseable);
				healingDronesAreRepurchaseable = BindRepurchase(config, "HealingDronesAreRepurchaseable", "Healing Drones", healingDronesAreRepurchaseable);
				emergencyDronesAreRepurchaseable = BindRepurchase(config, "EmergencyDronesAreRepurchaseable", "Emergency Drones", emergencyDronesAreRepurchaseable);
				flameDronesAreRepurchaseable = BindRepurchase(config, "FlameDronesAreRepurchaseable", "Incinerator Drones", flameDronesAreRepurchaseable);
				missileDronesAreRepurchaseable = BindRepurchase(config, "MissileDronesAreRepurchaseable", "Missile Drones", missileDronesAreRepurchaseable);
				megaDronesAreRepurchaseable = BindRepurchase(config, "MegaDronesAreRepurchaseable", "TC-280 Prototypes", megaDronesAreRepurchaseable);
				equipmentDronesAreRepurchaseable = BindRepurchase(config, "EquipmentDronesAreRepurchaseable", "Equipment Drones", equipmentDronesAreRepurchaseable);
				dropEquipFromDroneChance = config.Bind<float>("General", "DropEquipFromDroneChance", dropEquipFromDroneChance, new ConfigDescription("Allows Equipment Drones to have a chance to drop their Equipment when destroyed. Value of 43 means 43% chance. Affected by the drone's luck.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), Array.Empty<object>())).Value;
				flameDroneWeightScorchedAcres = config.Bind<int>("General", "FlameDroneWeightScorchedAcres", flameDroneWeightScorchedAcres, new ConfigDescription("Flame Drone spawn weight multiplier in Scorched Acres. Set to 1 for default.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, int.MaxValue), Array.Empty<object>())).Value;
				flameDroneWeightAbyssalDepths = config.Bind<int>("General", "FlameDroneWeightAbyssalDepths", flameDroneWeightAbyssalDepths, new ConfigDescription("Flame Drone spawn weight multiplier in Abyssal Depths. Set to 1 for default.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, int.MaxValue), Array.Empty<object>())).Value;
				turretsAsDroneCategory = config.Bind<bool>("General", "TurretsAsDroneCategory", turretsAsDroneCategory, "Gunner Turrets are not treated as Drones by the Director and they fall under Miscellaneous Category, hence why gunner turrets spawn more often. Setting this to true will change the category of turrets to Drones as well.").Value;
			}

			private static bool BindRepurchase(ConfigFile config, string key, string droneName, bool defaultValue)
			{
				return config.Bind<bool>("General", key, defaultValue, "Allows all " + droneName + " to be repurchased when they are destroyed or decommissioned. Drones owned by enemies or given by the Artifact of Machines are never repurchaseable.").Value;
			}
		}

		internal static readonly GlobalConfig generalCfg = new GlobalConfig();

		public const string ModVer = "4.0.6";

		public const string ModName = "ChensGradiusMod";

		public const string ModGuid = "com.Chen.ChensGradiusMod";

		internal static ConfigFile cfgFile;

		internal static List<ModuleBase> chensItemList = new List<ModuleBase>();

		internal static List<DroneInfo> gradiusDronesList = new List<DroneInfo>();

		internal static Log Log;

		internal static AssetBundle assetBundle;

		private static readonly Lazy<GameObject> _backupDroneMaster = LazyAddressable<GameObject>("RoR2/Base/Drones/DroneBackupMaster.prefab");

		private static readonly Lazy<GameObject> _drone1Master = LazyAddressable<GameObject>("RoR2/Base/Drones/Drone1Master.prefab");

		private static readonly Lazy<GameObject> _drone2Master = LazyAddressable<GameObject>("RoR2/Base/Drones/Drone2Master.prefab");

		private static readonly Lazy<GameObject> _emergencyDroneMaster = LazyAddressable<GameObject>("RoR2/Base/Drones/EmergencyDroneMaster.prefab");

		private static readonly Lazy<GameObject> _flameDroneMaster = LazyAddressable<GameObject>("RoR2/Base/Drones/FlameDroneMaster.prefab");

		private static readonly Lazy<GameObject> _missileDroneMaster = LazyAddressable<GameObject>("RoR2/Base/Drones/DroneMissileMaster.prefab");

		private static readonly Lazy<GameObject> _turret1Master = LazyAddressable<GameObject>("RoR2/Base/Drones/Turret1Master.prefab");

		private static readonly Lazy<GameObject> _tc280DroneMaster = LazyAddressable<GameObject>("RoR2/Base/Drones/MegaDroneMaster.prefab");

		private static readonly Lazy<GameObject> _equipmentDroneMaster = LazyAddressable<GameObject>("RoR2/Base/Drones/EquipmentDroneMaster.prefab");

		private static readonly Lazy<GameObject> _colDronemanMaster = LazyAddressable<GameObject>("RoR2/DLC1/DroneCommander/DroneCommanderMaster.prefab");

		private static readonly Lazy<GameObject> _alphaConstructMaster = LazyAddressable<GameObject>("RoR2/DLC1/MajorAndMinorConstruct/MinorConstructMaster.prefab");

		private static readonly Lazy<InteractableSpawnCard> _drone1SpawnCard = LazyAddressable<InteractableSpawnCard>("RoR2/Base/Drones/iscBrokenDrone1.asset");

		private static readonly Lazy<SkillDef> _drone1Skill = LazyAddressable<SkillDef>("RoR2/Base/Drones/Drone1BodyGun.asset");

		private static readonly Lazy<GameObject> _helperPrefab = new Lazy<GameObject>((Func<GameObject>)(() => LegacyResourcesAPI.Load<GameObject>("SpawnCards/HelperPrefab")));

		private static readonly Lazy<Material> _summonDroneMaterial = new Lazy<Material>((Func<Material>)(() => LegacyResourcesAPI.Load<Material>("Materials/matSummonDrone")));

		internal static SoundPlayer soundPlayer = new SoundPlayer(Array.Empty<EventPosterKey>());

		internal static GameObject backupDroneMaster => _backupDroneMaster.Value;

		internal static GameObject drone1Master => _drone1Master.Value;

		internal static GameObject drone2Master => _drone2Master.Value;

		internal static GameObject emergencyDroneMaster => _emergencyDroneMaster.Value;

		internal static GameObject flameDroneMaster => _flameDroneMaster.Value;

		internal static GameObject missileDroneMaster => _missileDroneMaster.Value;

		internal static GameObject turret1Master => _turret1Master.Value;

		internal static GameObject tc280DroneMaster => _tc280DroneMaster.Value;

		internal static GameObject equipmentDroneMaster => _equipmentDroneMaster.Value;

		internal static GameObject colDronemanMaster => _colDronemanMaster.Value;

		internal static GameObject alphaConstructMaster => _alphaConstructMaster.Value;

		internal static GameObject helperPrefab => _helperPrefab.Value;

		internal static InteractableSpawnCard drone1SpawnCard => _drone1SpawnCard.Value;

		internal static SkillDef drone1Skill => _drone1Skill.Value;

		internal static Material summonDroneMaterial => _summonDroneMaterial.Value;

		private void RegisterVanillaChanges()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Expected O, but got Unknown
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Expected O, but got Unknown
			if (generalCfg.emergencyDroneFix)
			{
				Log.Debug((object)"Vanilla Fix: Applying Emergency Drone Fix.");
				HealBeamController.HealBeamAlreadyExists_GameObject_HealthComponent += new hook_HealBeamAlreadyExists_GameObject_HealthComponent(HealBeamController_HealBeamAlreadyExists_GO_HC);
			}
			if (generalCfg.flameDroneWeightScorchedAcres > 1 || generalCfg.flameDroneWeightAbyssalDepths > 1)
			{
				Log.Debug((object)"Vanilla Change: Modifying Flame Drone spawn weight on Abyssal Depths or Scorched Acres (or both).");
				DirectorAPI.InteractableActions += FlameDrone_InteractableActions;
			}
			if (generalCfg.turretsAsDroneCategory)
			{
				Log.Debug((object)"Vanilla Change: Modifying category of Gunner Turrets to Drones category.");
				DirectorAPI.InteractableActions += Turret1_InteractableActions;
			}
			Log.Debug((object)"Vanilla Change: Applying repurchase rules on vanilla drones.");
			DeathState.OnImpactServer += new hook_OnImpactServer(DroneDeathState_OnImpactServer);
			DeathState.OnEnter += new hook_OnEnter(TurretDeathState_OnEnter);
		}

		private void DroneDeathState_OnImpactServer(orig_OnImpactServer orig, DeathState self, Vector3 contactPoint)
		{
			//IL_000a: 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)
			if (self is DroneDeathState)
			{
				orig.Invoke(self, contactPoint);
				return;
			}
			CharacterBody characterBody = ((EntityState)self).characterBody;
			if (IsVanillaDroneRepurchaseable(characterBody))
			{
				bool spawnedRepairObject = self.spawnedRepairObject;
				orig.Invoke(self, contactPoint);
				if (!spawnedRepairObject && self.spawnedRepairObject && GetBodyName(characterBody) == "EquipmentDroneBody")
				{
					TryDropDroneEquipment(characterBody);
				}
			}
		}

		private void TurretDeathState_OnEnter(orig_OnEnter orig, DeathState self)
		{
			orig.Invoke(self);
			if (!IsVanillaDroneRepurchaseable(((EntityState)self).characterBody))
			{
				self.deadFormToSpawnOnDeath = null;
			}
		}

		private static bool IsVanillaDroneRepurchaseable(CharacterBody body)
		{
			if (!Object.op_Implicit((Object)(object)body))
			{
				return true;
			}
			if (ArtifactBase<Machines>.instance != null && ArtifactBase<Machines>.instance.ShouldSuppressBrokenDrone(body))
			{
				return false;
			}
			return GetBodyName(body) switch
			{
				"Drone1Body" => generalCfg.gunnerDronesAreRepurchaseable, 
				"Turret1Body" => generalCfg.turretsAreRepurchaseable, 
				"Drone2Body" => generalCfg.healingDronesAreRepurchaseable, 
				"EmergencyDroneBody" => generalCfg.emergencyDronesAreRepurchaseable, 
				"FlameDroneBody" => generalCfg.flameDronesAreRepurchaseable, 
				"MissileDroneBody" => generalCfg.missileDronesAreRepurchaseable, 
				"EquipmentDroneBody" => generalCfg.equipmentDronesAreRepurchaseable, 
				_ => true, 
			};
		}

		private static string GetBodyName(CharacterBody body)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)body))
			{
				return null;
			}
			return BodyCatalog.GetBodyName(body.bodyIndex);
		}

		private static void TryDropDroneEquipment(CharacterBody body)
		{
			//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_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Invalid comparison between Unknown and I4
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: 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_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active && Object.op_Implicit((Object)(object)body.inventory) && Object.op_Implicit((Object)(object)body.master))
			{
				EquipmentIndex currentEquipmentIndex = body.inventory.currentEquipmentIndex;
				if ((int)currentEquipmentIndex != -1 && Util.CheckRoll(generalCfg.dropEquipFromDroneChance, body.master))
				{
					CreatePickupInfo val = new CreatePickupInfo
					{
						position = body.corePosition,
						rotation = Quaternion.identity
					};
					((CreatePickupInfo)(ref val)).pickup = new UniquePickup(PickupCatalog.FindPickupIndex(currentEquipmentIndex));
					GenericPickupController.CreatePickup(ref val);
				}
			}
		}

		private void Turret1_InteractableActions(DccsPool arg1, StageInfo arg2)
		{
			if (!Object.op_Implicit((Object)(object)arg1))
			{
				return;
			}
			Helpers.ForEachPoolEntryInDccsPool(arg1, (Action<PoolEntry>)delegate(PoolEntry poolEntry)
			{
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0034: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: 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_0067: Unknown result type (might be due to invalid IL or missing references)
				//IL_006e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: Unknown result type (might be due to invalid IL or missing references)
				//IL_0078: Unknown result type (might be due to invalid IL or missing references)
				//IL_008a: Expected O, but got Unknown
				//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_0096: 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_009d: 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_00a5: Expected O, but got Unknown
				DirectorCard turretDirectorCard = null;
				poolEntry.dccs.RemoveCardsThatFailFilter((Predicate<DirectorCard>)delegate(DirectorCard dCard)
				{
					if (Object.op_Implicit((Object)(object)dCard.spawnCard) && ((Object)dCard.spawnCard).name.Contains("Turret1"))
					{
						turretDirectorCard = dCard;
						return false;
					}
					return true;
				});
				if (turretDirectorCard != null)
				{
					DirectorCard card = new DirectorCard
					{
						spawnCard = turretDirectorCard.spawnCard,
						selectionWeight = turretDirectorCard.selectionWeight,
						minimumStageCompletions = turretDirectorCard.minimumStageCompletions,
						spawnDistance = turretDirectorCard.spawnDistance,
						preventOverhead = turretDirectorCard.preventOverhead
					};
					DirectorCardHolder val = new DirectorCardHolder
					{
						Card = card,
						MonsterCategory = (MonsterCategory)0,
						InteractableCategory = (InteractableCategory)5
					};
					DirectorAPI.AddCard(poolEntry.dccs, val);
				}
			});
		}

		private void FlameDrone_InteractableActions(DccsPool arg1, StageInfo arg2)
		{
			if (!Object.op_Implicit((Object)(object)arg1))
			{
				return;
			}
			float weightMultiplier;
			if (((StageInfo)(ref arg2)).CheckStage((Stage)128, Array.Empty<string>()))
			{
				weightMultiplier = generalCfg.flameDroneWeightAbyssalDepths;
			}
			else
			{
				if (!((StageInfo)(ref arg2)).CheckStage((Stage)64, Array.Empty<string>()))
				{
					return;
				}
				weightMultiplier = generalCfg.flameDroneWeightScorchedAcres;
			}
			if (weightMultiplier <= 1f)
			{
				return;
			}
			Helpers.ForEachPoolEntryInDccsPool(arg1, (Action<PoolEntry>)delegate(PoolEntry poolEntry)
			{
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0034: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: Unknown result type (might be due to invalid IL or missing references)
				//IL_0063: Unknown result type (might be due to invalid IL or missing references)
				//IL_0074: 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_0080: 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_0097: Expected O, but got Unknown
				//IL_0097: Unknown result type (might be due to invalid IL or missing references)
				//IL_009c: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a3: 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_00aa: 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_00b2: Expected O, but got Unknown
				DirectorCard flameDroneDirectorCard = null;
				poolEntry.dccs.RemoveCardsThatFailFilter((Predicate<DirectorCard>)delegate(DirectorCard dCard)
				{
					if (Object.op_Implicit((Object)(object)dCard.spawnCard) && ((Object)dCard.spawnCard).name.Contains("FlameDrone"))
					{
						flameDroneDirectorCard = dCard;
						return false;
					}
					return true;
				});
				if (flameDroneDirectorCard != null)
				{
					DirectorCard card = new DirectorCard
					{
						spawnCard = flameDroneDirectorCard.spawnCard,
						selectionWeight = Mathf.RoundToInt((float)flameDroneDirectorCard.selectionWeight * weightMultiplier),
						minimumStageCompletions = flameDroneDirectorCard.minimumStageCompletions,
						spawnDistance = flameDroneDirectorCard.spawnDistance,
						preventOverhead = flameDroneDirectorCard.preventOverhead
					};
					DirectorCardHolder val = new DirectorCardHolder
					{
						Card = card,
						MonsterCategory = (MonsterCategory)0,
						InteractableCategory = (InteractableCategory)5
					};
					DirectorAPI.AddCard(poolEntry.dccs, val);
				}
			});
		}

		private bool HealBeamController_HealBeamAlreadyExists_GO_HC(orig_HealBeamAlreadyExists_GameObject_HealthComponent orig, GameObject owner, HealthComponent targetHealthComponent)
		{
			List<HealBeamController> instancesList = InstanceTracker.GetInstancesList<HealBeamController>();
			for (int i = 0; i < instancesList.Count; i++)
			{
				HealBeamController val = instancesList[i];
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.target) && Object.op_Implicit((Object)(object)val.target.healthComponent) && Object.op_Implicit((Object)(object)targetHealthComponent) && Object.op_Implicit((Object)(object)val.ownership) && Object.op_Implicit((Object)(object)val.ownership.ownerObject) && (Object)(object)val.target.healthComponent == (Object)(object)targetHealthComponent && (Object)(object)val.ownership.ownerObject == (Object)(object)owner)
				{
					return true;
				}
			}
			return false;
		}

		private void Update()
		{
			DropletGenerator.Update();
			if (Input.GetKeyDown((KeyCode)290))
			{
				CharacterMaster master = PlayerCharacterMasterController.instances[0].master;
				OptionMasterTracker.SpawnOption(((Component)master.GetBody()).gameObject, 1);
			}
			else
			{
				soundPlayer.Update();
			}
		}

		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			//IL_0040: 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_0047: Expected O, but got Unknown
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			Log = new Log(((BaseUnityPlugin)this).Logger);
			Log.Debug((object)"Loading assets...");
			BundleInfo val = default(BundleInfo);
			((BundleInfo)(ref val))..ctor("Chen.GradiusMod.chensgradiusmod_assets", (BundleType)0);
			BundleInfo val2 = default(BundleInfo);
			((BundleInfo)(ref val2))..ctor("Chen.GradiusMod.chensgradiusmod_soundbank.bnk", (BundleType)1);
			AssetsManager val3 = new AssetsManager(val);
			AssetsManager val4 = new AssetsManager(val2);
			assetBundle = val3.Register();
			Extensions.ConvertShaders(assetBundle);
			val4.Register();
			cfgFile = new ConfigFile(Path.Combine(Paths.ConfigPath, "com.Chen.ChensGradiusMod.cfg"), true);
			Log.Debug((object)"Loading global configs...");
			generalCfg.Bind(cfgFile);
			Log.Debug((object)"Modifying vanilla drone behavior...");
			ModifyVanillaDroneDeathBehaviors();
			ModifyVanillaDronesSkillDrivers();
			Log.Debug((object)"Instantiating item and artifact classes...");
			chensItemList = SetupModules(new ModuleBase[3]
			{
				new GradiusOption(),
				new OptionSeed(),
				new Machines()
			});
			Log.Debug((object)"Instantiating custom drones...");
			gradiusDronesList = DroneCatalog.Initialize("com.Chen.ChensGradiusMod", cfgFile);
			DroneCatalog.EfficientSetupAll(gradiusDronesList);
			Log.Debug((object)"Applying vanilla changes and fixes...");
			RegisterVanillaChanges();
			if (cfgFile.Bind<bool>("Mod Compatibility: LookingGlass", "EnableItemStats", true, "Add item stats to LookingGlass (if installed).").Value && LookingGlassCompat.IsLookingGlassInstalled)
			{
				Log.Debug((object)"Adding item stats to LookingGlass...");
				LookingGlassCompat.Init();
			}
		}

		private List<ModuleBase> SetupModules(IEnumerable<ModuleBase> modules)
		{
			List<ModuleBase> list = new List<ModuleBase>();
			foreach (ModuleBase module in modules)
			{
				module.BindConfigFile(cfgFile);
				module.SetupConfig();
				if (module.enabled)
				{
					list.Add(module);
				}
				else
				{
					Log.Warning((object)(module.name + " is disabled in the config. Skipping."));
				}
			}
			foreach (ModuleBase item in list)
			{
				item.SetupAttributes();
			}
			foreach (ModuleBase item2 in list)
			{
				item2.SetupBehavior();
			}
			foreach (ModuleBase item3 in list)
			{
				item3.Install();
			}
			return list;
		}

		private static Lazy<T> LazyAddressable<T>(string key)
		{
			return new Lazy<T>(delegate
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				T val = Addressables.LoadAssetAsync<T>((object)key).WaitForCompletion();
				if (val == null)
				{
					Log.Error((object)("Failed to load the addressable asset " + key + "."));
				}
				return val;
			});
		}

		private void ModifyVanillaDroneDeathBehaviors()
		{
			if (generalCfg.megaDronesAreRepurchaseable)
			{
				tc280DroneMaster.AssignDeathBehavior(typeof(DeathState));
			}
		}

		private void ModifyVanillaDronesSkillDrivers()
		{
			drone1Master.SetAllDriversToAimTowardsEnemies();
			tc280DroneMaster.SetAllDriversToAimTowardsEnemies();
			missileDroneMaster.SetAllDriversToAimTowardsEnemies();
			backupDroneMaster.SetAllDriversToAimTowardsEnemies();
			flameDroneMaster.SetAllDriversToAimTowardsEnemies();
			equipmentDroneMaster.SetAllDriversToAimTowardsEnemies();
			colDronemanMaster.SetAllDriversToAimTowardsEnemies();
			alphaConstructMaster.SetAllDriversToAimTowardsEnemies();
		}

		internal static bool DebugCheck()
		{
			return false;
		}
	}
}
namespace Chen.GradiusMod.Modules
{
	public abstract class ModuleBase
	{
		public bool enabled { get; protected set; } = true;

		public string name => GetType().Name;

		protected abstract string configCategoryPrefix { get; }

		protected string configCategory => configCategoryPrefix + "." + name;

		protected ConfigFile config { get; private set; }

		internal void BindConfigFile(ConfigFile configFile)
		{
			config = configFile;
		}

		public virtual void SetupConfig()
		{
			enabled = Bind("enabled", enabled, "If false, this module will not be loaded at all.");
		}

		public abstract void SetupAttributes();

		public virtual void SetupBehavior()
		{
		}

		public virtual void Install()
		{
		}

		public virtual void Uninstall()
		{
		}

		protected T Bind<T>(string propertyName, T defaultValue, string description)
		{
			return config.Bind<T>(configCategory, ToKey(propertyName), defaultValue, description).Value;
		}

		protected T Bind<T>(string propertyName, T defaultValue, string description, T min, T max) where T : IComparable
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			ConfigDescription val = new ConfigDescription(description, (AcceptableValueBase)(object)new AcceptableValueRange<T>(min, max), Array.Empty<object>());
			return config.Bind<T>(configCategory, ToKey(propertyName), defaultValue, val).Value;
		}

		public static string Pct(float value, uint precision = 0u)
		{
			return (value * 100f).ToString("N" + precision, CultureInfo.InvariantCulture) + "%";
		}

		public static string NPlur(int number)
		{
			if (number != 1)
			{
				return "s";
			}
			return string.Empty;
		}

		private static string ToKey(string propertyName)
		{
			return char.ToUpperInvariant(propertyName[0]) + propertyName.Substring(1);
		}
	}
}
namespace Chen.GradiusMod.Mirroring
{
	public struct MirrorPoint
	{
		public GameObject origin;

		public float multiplier;

		public Vector3? direction;
	}
	public interface IMirrorProvider
	{
		void CollectMirrorPoints(CharacterBody attacker, List<MirrorPoint> points);
	}
	public static class AttackMirror
	{
		private static readonly List<IMirrorProvider> providers = new List<IMirrorProvider>();

		private static readonly HashSet<Type> excludedStates = new HashSet<Type>();

		private static readonly HashSet<string> excludedProjectiles = new HashSet<string>();

		private static readonly ConditionalWeakTable<OverlapAttack, OverlapAttack[]> overlapCopies = new ConditionalWeakTable<OverlapAttack, OverlapAttack[]>();

		private static readonly List<MirrorPoint> pointBuffer = new List<MirrorPoint>();

		private static readonly Func<object, object> memberwiseClone = (Func<object, object>)Delegate.CreateDelegate(typeof(Func<object, object>), typeof(object).GetMethod("MemberwiseClone", BindingFlags.Instance | BindingFlags.NonPublic));

		private static bool installed;

		private static bool mirroring;

		public static void ExcludeEntityState(Type stateType)
		{
			if (stateType != null)
			{
				excludedStates.Add(stateType);
			}
		}

		public static void ExcludeProjectile(GameObject projectilePrefab)
		{
			if (Object.op_Implicit((Object)(object)projectilePrefab))
			{
				ExcludeProjectile(((Object)projectilePrefab).name);
			}
		}

		public static void ExcludeProjectile(string projectilePrefabName)
		{
			if (!string.IsNullOrEmpty(projectilePrefabName))
			{
				excludedProjectiles.Add(projectilePrefabName);
			}
		}

		internal static void RegisterProvider(IMirrorProvider provider)
		{
			if (!providers.Contains(provider))
			{
				providers.Add(provider);
			}
			Install();
		}

		private static void Install()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Expected O, but got Unknown
			if (!installed)
			{
				installed = true;
				ExcludeProjectile("WightProjectile");
				ExcludeProjectile("WightReaperProjectile");
				BulletAttack.Fire_FireArgs += new hook_Fire_FireArgs(BulletAttack_Fire);
				ProjectileManager.FireProjectile_FireProjectileInfo += new hook_FireProjectile_FireProjectileInfo(ProjectileManager_FireProjectile);
				OverlapAttack.Fire += new hook_Fire(OverlapAttack_Fire);
				BlastAttack.Fire += new hook_Fire(BlastAttack_Fire);
			}
		}

		private static void BulletAttack_Fire(orig_Fire_FireArgs orig, BulletAttack self, FireArgs args)
		{
			//IL_0014: 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_0060: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, args);
			if ((Object.op_Implicit((Object)(object)self.weapon) && Object.op_Implicit((Object)(object)self.weapon.GetComponent<ProjectileController>())) || !TryGetMirrorPoints(self.owner, self.damageType, self.procChainMask, out var points))
			{
				return;
			}
			RunMirrored(delegate
			{
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: Expected O, but got Unknown
				//IL_003b: 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_0065: 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)
				foreach (MirrorPoint item in points)
				{
					BulletAttack val = (BulletAttack)memberwiseClone(self);
					val.origin = item.origin.transform.position;
					val.aimVector = (Vector3)(((??)item.direction) ?? self.aimVector);
					val.weapon = item.origin;
					val.damage *= item.multiplier;
					val.force *= item.multiplier;
					val.FilterOutOwnerFromAttack();
					val.Fire();
				}
			});
		}

		private static void ProjectileManager_FireProjectile(orig_FireProjectile_FireProjectileInfo orig, ProjectileManager self, FireProjectileInfo info)
		{
			//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_001c: 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_008d: 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_00a7: 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)
			orig.Invoke(self, info);
			if (!Object.op_Implicit((Object)(object)info.projectilePrefab) || excludedProjectiles.Contains(((Object)info.projectilePrefab).name) || Object.op_Implicit((Object)(object)info.projectilePrefab.GetComponent<ProjectileLocator>()))
			{
				return;
			}
			DamageTypeCombo damageType = (DamageTypeCombo)(((??)info.damageTypeOverride) ?? GetProjectileDamageType(info.projectilePrefab));
			if (!TryGetMirrorPoints(info.owner, damageType, info.procChainMask, out var points) || IsCalledFromProjectile())
			{
				return;
			}
			RunMirrored(delegate
			{
				//IL_0017: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_002a: 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_0082: 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)
				foreach (MirrorPoint item in points)
				{
					FireProjectileInfo val = info;
					val.position = item.origin.transform.position;
					if (item.direction.HasValue)
					{
						val.rotation = Util.QuaternionSafeLookRotation(item.direction.Value);
					}
					val.damage *= item.multiplier;
					val.force *= item.multiplier;
					self.FireProjectile(val);
				}
			});
		}

		private static bool OverlapAttack_Fire(orig_Fire orig, OverlapAttack self, List<HurtBox> hitResults)
		{
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			bool result = orig.Invoke(self, hitResults);
			if (Object.op_Implicit((Object)(object)self.inflictor) && (Object)(object)self.inflictor != (Object)(object)self.attacker)
			{
				return result;
			}
			if (!TryGetMirrorPoints(self.attacker, self.damageType, self.procChainMask, out var points))
			{
				return result;
			}
			if (!overlapCopies.TryGetValue(self, out var copies) || copies.Length != points.Count)
			{
				copies = (OverlapAttack[])(object)new OverlapAttack[points.Count];
				for (int i = 0; i < copies.Length; i++)
				{
					copies[i] = CloneOverlapAttack(self);
				}
				overlapCopies.Remove(self);
				overlapCopies.Add(self, copies);
			}
			RunMirrored(delegate
			{
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0072: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				for (int j = 0; j < copies.Length; j++)
				{
					OverlapAttack val = copies[j];
					val.hitBoxGroup = self.hitBoxGroup;
					val.isCrit = self.isCrit;
					val.damage = self.damage * points[j].multiplier;
					val.forceVector = self.forceVector * points[j].multiplier;
					val.pushAwayForce = self.pushAwayForce * points[j].multiplier;
					val.Fire((List<HurtBox>)null);
				}
			});
			return result;
		}

		private static Result BlastAttack_Fire(orig_Fire orig, BlastAttack self)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: 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_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: 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)
			Result result = orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self.inflictor) && (Object)(object)self.inflictor != (Object)(object)self.attacker)
			{
				return result;
			}
			if (!TryGetMirrorPoints(self.attacker, self.damageType, self.procChainMask, out var points))
			{
				return result;
			}
			RunMirrored(delegate
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_002c: Expected O, but got Unknown
				//IL_0054: Unknown result type (might be due to invalid IL or missing references)
				//IL_005f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				foreach (MirrorPoint item in points)
				{
					BlastAttack val = (BlastAttack)memberwiseClone(self);
					val.baseDamage *= item.multiplier;
					val.baseForce *= item.multiplier;
					val.bonusForce *= item.multiplier;
					val.Fire();
				}
			});
			return result;
		}

		private static bool TryGetMirrorPoints(GameObject attackerObject, DamageTypeCombo damageType, ProcChainMask procChainMask, out List<MirrorPoint> points)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_002e: 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_0037: Invalid comparison between Unknown and I4
			//IL_0041: 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)
			points = null;
			if (mirroring || providers.Count == 0 || !Object.op_Implicit((Object)(object)attackerObject))
			{
				return false;
			}
			if ((damageType.damageSource & 0x40) != 0)
			{
				return false;
			}
			if ((damageType.damageSource & 0xF) <= 0 && !((ProcChainMask)(ref procChainMask)).Equals(default(ProcChainMask)))
			{
				return false;
			}
			CharacterBody component = attackerObject.GetComponent<CharacterBody>();
			if (!Object.op_Implicit((Object)(object)component) || IsInExcludedState(component))
			{
				return false;
			}
			pointBuffer.Clear();
			foreach (IMirrorProvider provider in providers)
			{
				provider.CollectMirrorPoints(component, pointBuffer);
			}
			pointBuffer.RemoveAll((MirrorPoint point) => !Object.op_Implicit((Object)(object)point.origin));
			if (pointBuffer.Count == 0)
			{
				return false;
			}
			points = new List<MirrorPoint>(pointBuffer);
			return true;
		}

		private static bool IsInExcludedState(CharacterBody body)
		{
			if (excludedStates.Count == 0)
			{
				return false;
			}
			EntityStateMachine[] components = ((Component)body).GetComponents<EntityStateMachine>();
			foreach (EntityStateMachine val in components)
			{
				EntityState state = val.state;
				if (state == null)
				{
					continue;
				}
				foreach (Type excludedState in excludedStates)
				{
					if (excludedState.IsInstanceOfType(state))
					{
						return true;
					}
				}
			}
			return false;
		}

		private static bool IsCalledFromProjectile()
		{
			StackFrame[] frames = new StackTrace(2, fNeedFileInfo: false).GetFrames();
			if (frames == null)
			{
				return false;
			}
			StackFrame[] array = frames;
			foreach (StackFrame stackFrame in array)
			{
				Type type = stackFrame.GetMethod()?.DeclaringType;
				if (!(type == null) && !(type == typeof(ProjectileManager)) && type.Namespace == "RoR2.Projectile")
				{
					return true;
				}
			}
			return false;
		}

		private static DamageTypeCombo GetProjectileDamageType(GameObject projectilePrefab)
		{
			//IL_0016: 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)
			ProjectileDamage component = projectilePrefab.GetComponent<ProjectileDamage>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return DamageTypeCombo.Generic;
			}
			return component.damageType;
		}

		private static OverlapAttack CloneOverlapAttack(OverlapAttack source)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: 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_001f: 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_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_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: 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_0071: 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_007d: 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_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_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00b9: 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_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: 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_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Expected O, but got Unknown
			return new OverlapAttack
			{
				attacker = source.attacker,
				inflictor = source.inflictor,
				teamIndex = source.teamIndex,
				attackerFiltering = source.attackerFiltering,
				forceVector = source.forceVector,
				pushAwayForce = source.pushAwayForce,
				physForceFlags = source.physForceFlags,
				damage = source.damage,
				isCrit = source.isCrit,
				procChainMask = source.procChainMask,
				procCoefficient = source.procCoefficient,
				hitBoxGroup = source.hitBoxGroup,
				hitEffectPrefab = source.hitEffectPrefab,
				impactSound = source.impactSound,
				damageColorIndex = source.damageColorIndex,
				damageType = source.damageType,
				maximumOverlapTargets = source.maximumOverlapTargets,
				attackOriginPreference = source.attackOriginPreference,
				retriggerTimeout = source.retriggerTimeout,
				isSphereOverlap = source.isSphereOverlap,
				filterCallback = source.filterCallback,
				hasDamageProcessingHurtboxes = source.hasDamageProcessingHurtboxes,
				modifyOutgoingOverlapInfoCallback = source.modifyOutgoingOverlapInfoCallback
			};
		}

		private static void RunMirrored(Action action)
		{
			mirroring = true;
			try
			{
				action();
			}
			finally
			{
				mirroring = false;
			}
		}
	}
}
namespace Chen.GradiusMod.Items
{
	public abstract class ItemBase<T> : ItemBase where T : ItemBase<T>
	{
		public static T instance { get; private set; }

		protected ItemBase()
		{
			if (instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" instantiated twice.");
			}
			instance = this as T;
		}
	}
	public abstract class ItemBase : ModuleBase
	{
		public ItemDef itemDef { get; private set; }

		public abstract string displayName { get; }

		public abstract ItemTier itemTier { get; }

		public virtual ItemTag[] itemTags => (ItemTag[])(object)new ItemTag[0];

		public virtual bool itemIsAIBlacklisted => false;

		protected GameObject modelResource { get; set; }

		protected Sprite iconResource { get; set; }

		protected override string configCategoryPrefix => "Items";

		protected string tokenPrefix => "CHENSGRADIUSMOD_" + base.name.ToUpperInvariant();

		protected abstract string GetNameString(string langid = null);

		protected abstract string GetPickupString(string langid = null);

		protected abstract string GetDescString(string langid = null);

		protected abstract string GetLoreString(string langid = null);

		public override void SetupAttributes()
		{
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Expected O, but got Unknown
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Expected O, but got Unknown
			List<ItemTag> list = new List<ItemTag>(itemTags);
			if (itemIsAIBlacklisted && !list.Contains((ItemTag)4))
			{
				list.Add((ItemTag)4);
			}
			itemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)itemDef).name = "CGM" + base.name;
			itemDef.nameToken = tokenPrefix + "_NAME_RENDERED";
			itemDef.pickupToken = tokenPrefix + "_PICKUP_RENDERED";
			itemDef.descriptionToken = tokenPrefix + "_DESC_RENDERED";
			itemDef.loreToken = tokenPrefix + "_LORE_RENDERED";
			itemDef.pickupModelPrefab = modelResource;
			itemDef.pickupIconSprite = iconResource;
			itemDef.tags = list.ToArray();
			itemDef.canRemove = true;
			itemDef.hidden = false;
			itemDef._itemTierDef = LoadItemTierDef(itemTier);
			LanguageAPI.Add(itemDef.nameToken, GetNameString());
			LanguageAPI.Add(itemDef.pickupToken, GetPickupString());
			LanguageAPI.Add(itemDef.descriptionToken, GetDescString());
			LanguageAPI.Add(itemDef.loreToken, GetLoreString());
			ItemAPI.Add(new CustomItem(itemDef, new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>())));
		}

		public int GetCount(CharacterBody body)
		{
			if (!Object.op_Implicit((Object)(object)itemDef) || !Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory))
			{
				return 0;
			}
			return body.inventory.GetItemCountEffective(itemDef);
		}

		public int GetCount(CharacterMaster master)
		{
			if (!Object.op_Implicit((Object)(object)itemDef) || !Object.op_Implicit((Object)(object)master) || !Object.op_Implicit((Object)(object)master.inventory))
			{
				return 0;
			}
			return master.inventory.GetItemCountEffective(itemDef);
		}

		public int GetCountSpecific(CharacterBody body, ItemDef specificItemDef)
		{
			if (!Object.op_Implicit((Object)(object)specificItemDef) || !Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory))
			{
				return 0;
			}
			return body.inventory.GetItemCountEffective(specificItemDef);
		}

		private static ItemTierDef LoadItemTierDef(ItemTier tier)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected I4, but got Unknown
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			string text;
			switch ((int)tier)
			{
			case 0:
				text = "RoR2/Base/Common/Tier1Def.asset";
				break;
			case 1:
				text = "RoR2/Base/Common/Tier2Def.asset";
				break;
			case 2:
				text = "RoR2/Base/Common/Tier3Def.asset";
				break;
			default:
				return null;
			}
			return Addressables.LoadAssetAsync<ItemTierDef>((object)text).WaitForCompletion();
		}
	}
}
namespace Chen.GradiusMod.Items.OptionSeed
{
	public class OptionSeed : ItemBase<OptionSeed>, IMirrorProvider
	{
		private static readonly HashSet<string> DedicatedBodies = new HashSet<string>
		{
			"CommandoBody", "HuntressBody", "Bandit2Body", "ToolbotBody", "EngiBody", "EngiTurretBody", "EngiWalkerTurretBody", "MageBody", "MercBody", "TreebotBody",
			"LoaderBody", "CrocoBody", "CaptainBody", "RailgunnerBody", "VoidSurvivorBody"
		};

		private static readonly HashSet<string> BuiltInAutoBodies = new HashSet<string> { "SeekerBody", "ChefBody", "FalseSonBody", "AcolyteBody", "DrifterBody", "DroneTechBody", "Enforcer2Body" };

		private readonly Dictionary<string, bool> autoMirroringOverrides = new Dictionary<string, bool>();

		internal const uint GetOptionEventId = 649757048u;

		internal const uint LoseOptionEventId = 2603869165u;

		internal const float DefaultVerticalOffsetMultiplier = 0.4f;

		internal const float DefaultHorizontalOffsetMultiplier = 0.8f;

		internal const float DefaultRotationRadius = 0.3f;

		private static readonly Dictionary<string, float> VerticalOffsetMultipliers = new Dictionary<string, float>
		{
			{ "EngiTurretBody", 0.5f },
			{ "EngiWalkerTurretBody", 1.3f },
			{ "ToolbotBody", 0.5f },
			{ "MageBody", 0.8f },
			{ "LoaderBody", 0.7f }
		};

		private static readonly Dictionary<string, float> HorizontalOffsetMultipliers = new Dictionary<string, float>
		{
			{ "ToolbotBody", 1f },
			{ "CrocoBody", 1f }
		};

		private static readonly Dictionary<string, float> RotationRadius = new Dictionary<string, float>
		{
			{ "ToolbotBody", 0.5f },
			{ "CrocoBody", 0.5f }
		};

		private static readonly Lazy<GameObject> _loaderZapCone = new Lazy<GameObject>((Func<GameObject>)(() => Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Loader/LoaderZapCone.prefab").WaitForCompletion()));

		private static readonly Lazy<Material> _evisTargetMaterial = new Lazy<Material>((Func<Material>)(() => Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Merc/matMercEvisTarget.mat").WaitForCompletion()));

		public override string displayName => "Gradius' Option Seed";

		public override ItemTier itemTier => (ItemTier)1;

		public override ItemTag[] itemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 };

		public override bool itemIsAIBlacklisted => true;

		public float damageMultiplier { get; private set; } = 0.2f;

		public float stackDamageMultiplier { get; private set; } = 0.05f;

		public bool mobileTurretsSeedSyncEffect { get; private set; } = true;

		public bool flamethrowerSeedSyncEffect { get; private set; } = true;

		public bool includeModelInsideOrb { get; private set; } = true;

		public bool staticPositions { get; private set; }

		public float rotationSpeed { get; private set; } = 10f;

		public bool autoSupportModdedSurvivors { get; private set; } = true;

		internal static GameObject optionSeedPrefab { get; private set; }

		private static GameObject loaderZapCone => _loaderZapCone.Value;

		private static Material evisTargetMaterial => _evisTargetMaterial.Value;

		public void FireForSeeds(CharacterBody optionSeedOwner, Action<GameObject, SeedBehavior, SeedTracker, float> actionToRun)
		{
			if (!Object.op_Implicit((Object)(object)optionSeedOwner) || UsesAutoMirroring(optionSeedOwner))
			{
				return;
			}
			SeedTracker component = ((Component)optionSeedOwner).GetComponent<SeedTracker>();
			if (Object.op_Implicit((Object)(object)component))
			{
				InputBankTest inputBankTest = component.inputBankTest;
				if (Object.op_Implicit((Object)(object)inputBankTest))
				{
					float arg = ComputeMultiplier(optionSeedOwner);
					actionToRun(component.leftSeed, component.leftBehavior, component, arg);
					actionToRun(component.rightSeed, component.rightBehavior, component, arg);
				}
			}
		}

		public void SetVerticalOffsetMultiplier(string bodyName, float newValue)
		{
			VerticalOffsetMultipliers[bodyName] = newValue;
		}

		public void SetHorizontalOffsetMultiplier(string bodyName, float newValue)
		{
			HorizontalOffsetMultipliers[bodyName] = newValue;
		}

		public void SetRotationalRadius(string bodyName, float newValue)
		{
			RotationRadius[bodyName] = newValue;
		}

		public override void Install()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Expected O, but got Unknown
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Expected O, but got Unknown
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Expected O, but got Unknown
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Expected O, but got Unknown
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Expected O, but got Unknown
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Expected O, but got Unknown
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Expected O, but got Unknown
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Expected O, but got Unknown
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Expected O, but got Unknown
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Expected O, but got Unknown
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Expected O, but got Unknown
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Expected O, but got Unknown
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Expected O, but got Unknown
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Expected O, but got Unknown
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Expected O, but got Unknown
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Expected O, but got Unknown
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Expected O, but got Unknown
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Expected O, but got Unknown
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Expected O, but got Unknown
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Expected O, but got Unknown
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Expected O, but got Unknown
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Expected O, but got Unknown
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Expected O, but got Unknown
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0215: Expected O, but got Unknown
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Expected O, but got Unknown
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Expected O, but got Unknown
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Expected O, but got Unknown
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Expected O, but got Unknown
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Expected O, but got Unknown
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Expected O, but got Unknown
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_028c: Expected O, but got Unknown
			//IL_0293: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Expected O, but got Unknown
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Expected O, but got Unknown
			//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Expected O, but got Unknown
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Expected O, but got Unknown
			//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Expected O, but got Unknown
			//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f2: Expected O, but got Unknown
			//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0303: Expected O, but got Unknown
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0314: Expected O, but got Unknown
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: Expected O, but got Unknown
			//IL_032c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: Expected O, but got Unknown
			//IL_033d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0347: Expected O, but got Unknown
			//IL_034e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Expected O, but got Unknown
			//IL_035f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0369: Expected O, but got Unknown
			//IL_0370: Unknown result type (might be due to invalid IL or missing references)
			//IL_037a: Expected O, but got Unknown
			//IL_0381: Unknown result type (might be due to invalid IL or missing references)
			//IL_038b: Expected O, but got Unknown
			//IL_0392: Unknown result type (might be due to invalid IL or missing references)
			//IL_039c: Expected O, but got Unknown
			base.Install();
			CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(CharacterBody_OnInventoryChanged);
			CharacterBody.onBodyStartGlobal += CharacterBody_onBodyStartGlobal;
			FireGrenades.FireGrenade += new hook_FireGrenade(FireGrenades_FireGrenade);
			FirePistol2.FireBullet += new hook_FireBullet(FirePistol2_FireBullet);
			GenericBulletBaseState.FireBullet += new hook_FireBullet(GenericBulletBaseState_FireBullet);
			FireBarrage.FireBullet += new hook_FireBullet(FireBarrage_FireBullet);
			GenericProjectileBaseState.FireProjectile += new hook_FireProjectile(GenericProjectileBaseState_FireProjectile);
			Fire.FireMissile += new hook_FireMissile(Fire_FireMissile);
			FireGauss.OnEnter += new hook_OnEnter(FireGauss_OnEnter);
			FireBeam.FixedUpdate += new hook_FixedUpdate(FireBeam_FixedUpdate);
			FireBeam.OnEnter += new hook_OnEnter(FireBeam_OnEnter);
			FireBeam.OnExit += new hook_OnExit(FireBeam_OnExit);
			FireSeekingArrow.FireOrbArrow += new hook_FireOrbArrow(FireSeekingArrow_FireOrbArrow);
			ThrowGlaive.FireOrbGlaive += new hook_FireOrbGlaive(ThrowGlaive_FireOrbGlaive);
			BasicMeleeAttack.OnEnter += new hook_OnEnter(BasicMeleeAttack_OnEnter);
			BasicMeleeAttack.AuthorityFireAttack += new hook_AuthorityFireAttack(BasicMeleeAttack_AuthorityFireAttack);
			Evis.FixedUpdate += new hook_FixedUpdate(Evis_FixedUpdate);
			WhirlwindBase.OnEnter += new hook_OnEnter(WhirlwindBase_OnEnter);
			WhirlwindBase.FixedUpdate += new hook_FixedUpdate(WhirlwindBase_FixedUpdate);
			FocusedAssaultDash.OnMeleeHitAuthority += new hook_OnMeleeHitAuthority(FocusedAssaultDash_OnMeleeHitAuthority);
			Uppercut.OnEnter += new hook_OnEnter(Uppercut_OnEnter);
			Uppercut.FixedUpdate += new hook_FixedUpdate(Uppercut_FixedUpdate);
			FireShotgun2.FireBullet += new hook_FireBullet(FireShotgun2_FireBullet);
			BaseFireSidearmRevolverState.OnEnter += new hook_OnEnter(BaseFireSidearmRevolverState_OnEnter);
			Bandit2FireShiv.FireShiv += new hook_FireShiv(Bandit2FireShiv_FireShiv);
			BaseNailgunState.FireBullet += new hook_FireBullet(BaseNailgunState_FireBullet);
			AimThrowableBase.FireProjectile += new hook_FireProjectile(AimThrowableBase_FireProjectile);
			RecoverAimStunDrone.OnEnter += new hook_OnEnter(RecoverAimStunDrone_OnEnter);
			FireBuzzsaw.FixedUpdate += new hook_FixedUpdate(FireBuzzsaw_FixedUpdate);
			FireFireBolt.FireGauntlet += new hook_FireGauntlet(FireFireBolt_FireGauntlet);
			BaseThrowBombState.Fire += new hook_Fire(BaseThrowBombState_Fire);
			Flamethrower.OnEnter += new hook_OnEnter(Flamethrower_OnEnter);
			Flamethrower.FireGauntlet += new hook_FireGauntlet(Flamethrower_FireGauntlet);
			Flamethrower.FixedUpdate += new hook_FixedUpdate(Flamethrower_FixedUpdate);
			Flamethrower.OnExit += new hook_OnExit(Flamethrower_OnExit);
			FireSyringe.FixedUpdate += new hook_FixedUpdate(FireSyringe_FixedUpdate);
			TreebotFireFruitSeed.OnEnter += new hook_OnEnter(TreebotFireFruitSeed_OnEnter);
			FireFlower2.OnEnter += new hook_OnEnter(FireFlower2_OnEnter);
			ArrowRain.DoFireArrowRain += new hook_DoFireArrowRain(ArrowRain_DoFireArrowRain);
			ThrowPylon.OnEnter += new hook_OnEnter(ThrowPylon_OnEnter);
			SwingZapFist.OnMeleeHitAuthority += new hook_OnMeleeHitAuthority(SwingZapFist_OnMeleeHitAuthority);
			GroundSlam.DetonateAuthority += new hook_DetonateAuthority(GroundSlam_DetonateAuthority);
			BaseLeap.DetonateAuthority += new hook_DetonateAuthority(BaseLeap_DetonateAuthority);
			BaseLeap.DropAcidPoolAuthority += new hook_DropAcidPoolAuthority(BaseLeap_DropAcidPoolAuthority);
			FireSpit.OnEnter += new hook_OnEnter(FireSpit_OnEnter);
			FireTazer.Fire += new hook_Fire(FireTazer_Fire);
			FirePistol.OnEnter += new hook_OnEnter(FirePistol_OnEnter);
			BaseFireSnipe.OnEnter += new hook_OnEnter(BaseFireSnipe_OnEnter);
			FireBlasterBase.OnEnter += new hook_OnEnter(FireBlasterBase_OnEnter);
			FireCorruptDisks.OnEnter += new hook_OnEnter(FireCorruptDisks_OnEnter);
			FireCorruptHandBeam.OnEnter += new hook_OnEnter(FireCorruptHandBeam_OnEnter);
			FireHandBeam.OnEnter += new hook_OnEnter(FireHandBeam_OnEnter);
			FireMegaBlasterBase.OnEnter += new hook_OnEnter(FireMegaBlasterBase_OnEnter);
			FireTwinBlaster.OnEnter += new hook_OnEnter(FireTwinBlaster_OnEnter);
		}

		public override void Uninstall()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Expected O, but got Unknown
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Expected O, but got Unknown
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Expected O, but got Unknown
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Expected O, but got Unknown
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Expected O, but got Unknown
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Expected O, but got Unknown
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Expected O, but got Unknown
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Expected O, but got Unknown
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Expected O, but got Unknown
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Expected O, but got Unknown
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Expected O, but got Unknown
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Expected O, but got Unknown
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Expected O, but got Unknown
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Expected O, but got Unknown
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Expected O, but got Unknown
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Expected O, but got Unknown
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Expected O, but got Unknown
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Expected O, but got Unknown
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Expected O, but got Unknown
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Expected O, but got Unknown
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Expected O, but got Unknown
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Expected O, but got Unknown
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Expected O, but got Unknown
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0215: Expected O, but got Unknown
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Expected O, but got Unknown
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Expected O, but got Unknown
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Expected O, but got Unknown
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Expected O, but got Unknown
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Expected O, but got Unknown
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Expected O, but got Unknown
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_028c: Expected O, but got Unknown
			//IL_0293: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Expected O, but got Unknown
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Expected O, but got Unknown
			//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Expected O, but got Unknown
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Expected O, but got Unknown
			//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Expected O, but got Unknown
			//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f2: Expected O, but got Unknown
			//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0303: Expected O, but got Unknown
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0314: Expected O, but got Unknown
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: Expected O, but got Unknown
			//IL_032c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: Expected O, but got Unknown
			//IL_033d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0347: Expected O, but got Unknown
			//IL_034e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Expected O, but got Unknown
			//IL_035f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0369: Expected O, but got Unknown
			//IL_0370: Unknown result type (might be due to invalid IL or missing references)
			//IL_037a: Expected O, but got Unknown
			//IL_0381: Unknown result type (might be due to invalid IL or missing references)
			//IL_038b: Expected O, but got Unknown
			//IL_0392: Unknown result type (might be due to invalid IL or missing references)
			//IL_039c: Expected O, but got Unknown
			base.Uninstall();
			CharacterBody.OnInventoryChanged -= new hook_OnInventoryChanged(CharacterBody_OnInventoryChanged);
			CharacterBody.onBodyStartGlobal -= CharacterBody_onBodyStartGlobal;
			FireGrenades.FireGrenade -= new hook_FireGrenade(FireGrenades_FireGrenade);
			FirePistol2.FireBullet -= new hook_FireBullet(FirePistol2_FireBullet);
			GenericBulletBaseState.FireBullet -= new hook_FireBullet(GenericBulletBaseState_FireBullet);
			FireBarrage.FireBullet -= new hook_FireBullet(FireBarrage_FireBullet);
			GenericProjectileBaseState.FireProjectile -= new hook_FireProjectile(GenericProjectileBaseState_FireProjectile);
			Fire.FireMissile -= new hook_FireMissile(Fire_FireMissile);
			FireGauss.OnEnter -= new hook_OnEnter(FireGauss_OnEnter);
			FireBeam.FixedUpdate -= new hook_FixedUpdate(FireBeam_FixedUpdate);
			FireBeam.OnEnter -= new hook_OnEnter(FireBeam_OnEnter);
			FireBeam.OnExit -= new hook_OnExit(FireBeam_OnExit);
			FireSeekingArrow.FireOrbArrow -= new hook_FireOrbArrow(FireSeekingArrow_FireOrbArrow);
			ThrowGlaive.FireOrbGlaive -= new hook_FireOrbGlaive(ThrowGlaive_FireOrbGlaive);
			BasicMeleeAttack.OnEnter -= new hook_OnEnter(BasicMeleeAttack_OnEnter);
			BasicMeleeAttack.AuthorityFireAttack -= new hook_AuthorityFireAttack(BasicMeleeAttack_AuthorityFireAttack);
			Evis.FixedUpdate -= new hook_FixedUpdate(Evis_FixedUpdate);
			WhirlwindBase.OnEnter -= new hook_OnEnter(WhirlwindBase_OnEnter);
			WhirlwindBase.FixedUpdate -= new hook_FixedUpdate(WhirlwindBase_FixedUpdate);
			FocusedAssaultDash.OnMeleeHitAuthority -= new hook_OnMeleeHitAuthority(FocusedAssaultDash_OnMeleeHitAuthority);
			Uppercut.OnEnter -= new hook_OnEnter(Uppercut_OnEnter);
			Uppercut.FixedUpdate -= new hook_FixedUpdate(Uppercut_FixedUpdate);
			FireShotgun2.FireBullet -= new hook_FireBullet(FireShotgun2_FireBullet);
			BaseFireSidearmRevolverState.OnEnter -= new hook_OnEnter(BaseFireSidearmRevolverState_OnEnter);
			Bandit2FireShiv.FireShiv -= new hook_FireShiv(Bandit2FireShiv_FireShiv);
			BaseNailgunState.FireBullet -= new hook_FireBullet(BaseNailgunState_FireBullet);
			AimThrowableBase.FireProjectile -= new hook_FireProjectile(AimThrowableBase_FireProjectile);
			RecoverAimStunDrone.OnEnter -= new hook_OnEnter(RecoverAimStunDrone_OnEnter);
			FireBuzzsaw.FixedUpdate -= new hook_FixedUpdate(FireBuzzsaw_FixedUpdate);
			FireFireBolt.FireGauntlet -= new hook_FireGauntlet(FireFireBolt_FireGauntlet);
			BaseThrowBombState.Fire -= new hook_Fire(BaseThrowBombState_Fire);
			Flamethrower.OnEnter -= new hook_OnEnter(Flamethrower_OnEnter);
			Flamethrower.FireGauntlet -= new hook_FireGauntlet(Flamethrower_FireGauntlet);
			Flamethrower.FixedUpdate -= new hook_FixedUpdate(Flamethrower_FixedUpdate);
			Flamethrower.OnExit -= new hook_OnExit(Flamethrower_OnExit);
			FireSyringe.FixedUpdate -= new hook_FixedUpdate(FireSyringe_FixedUpdate);
			TreebotFireFruitSeed.OnEnter -= new hook_OnEnter(TreebotFireFruitSeed_OnEnter);
			FireFlower2.OnEnter -= new hook_OnEnter(FireFlower2_OnEnter);
			ArrowRain.DoFireArrowRain -= new hook_DoFireArrowRain(ArrowRain_DoFireArrowRain);
			ThrowPylon.OnEnter -= new hook_OnEnter(ThrowPylon_OnEnter);
			SwingZapFist.OnMeleeHitAuthority -= new hook_OnMeleeHitAuthority(SwingZapFist_OnMeleeHitAuthority);
			GroundSlam.DetonateAuthority -= new hook_DetonateAuthority(GroundSlam_DetonateAuthority);
			BaseLeap.DetonateAuthority -= new hook_DetonateAuthority(BaseLeap_DetonateAuthority);
			BaseLeap.DropAcidPoolAuthority -= new hook_DropAcidPoolAuthority(BaseLeap_DropAcidPoolAuthority);
			FireSpit.OnEnter -= new hook_OnEnter(FireSpit_OnEnter);
			FireTazer.Fire -= new hook_Fire(FireTazer_Fire);
			FirePistol.OnEnter -= new hook_OnEnter(FirePistol_OnEnter);
			BaseFireSnipe.OnEnter -= new hook_OnEnter(BaseFireSnipe_OnEnter);
			FireBlasterBase.OnEnter -= new hook_OnEnter(FireBlasterBase_OnEnter);
			FireCorruptDisks.OnEnter -= new hook_OnEnter(FireCorruptDisks_OnEnter);
			FireCorruptHandBeam.OnEnter -= new hook_OnEnter(FireCorruptHandBeam_OnEnter);
			FireHandBeam.OnEnter -= new hook_OnEnter(FireHandBeam_OnEnter);
			FireMegaBlasterBase.OnEnter -= new hook_OnEnter(FireMegaBlasterBase_OnEnter);
			FireTwinBlaster.OnEnter -= new hook_OnEnter(FireTwinBlaster_OnEnter);
		}

		private void CharacterBody_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self.master))
			{
				if (GetCount(self) > 0)
				{
					SeedTracker.SpawnSeeds(((Component)self).gameObject);
				}
				else
				{
					SeedTracker.DestroySeeds(((Component)self).gameObject);
				}
			}
		}

		private void CharacterBody_onBodyStartGlobal(CharacterBody obj)
		{
			if (Object.op_Implicit((Object)(object)obj.master) && GetCount(obj) > 0)
			{
				SeedTracker.SpawnSeeds(((Component)obj).gameObject);
			}
		}

		private void FireTazer_Fire(orig_Fire orig, FireTazer self)
		{
			orig.Invoke(self);
			FireForSeeds(((EntityState)self).characterBody, delegate(GameObject seed, SeedBehavior _b, SeedTracker _t, float multiplier)
			{
				//IL_002a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				//IL_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0063: Unknown result type (might be due to invalid IL or missing references)
				//IL_0068: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)FireTazer.muzzleflashEffectPrefab))
				{
					seed.MuzzleEffect(FireTazer.muzzleflashEffectPrefab, transmit: false);
				}
				if (((EntityState)self).isAuthority)
				{
					FireProjectileInfo val = new FireProjectileInfo
					{
						projectilePrefab = FireTazer.projectilePrefab,
						position = seed.transform.position
					};
					Ray aimRay = ((BaseState)self).GetAimRay();
					val.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction);
					val.owner = ((EntityState)self).gameObject;
					val.damage = ((BaseState)self).damageStat * FireTazer.damageCoefficient * multiplier;
					val.force = FireTazer.force * multiplier;
					val.crit = Util.CheckRoll(((BaseState)self).critStat, ((EntityState)self).characterBody.master);
					FireProjectileInfo val2 = val;
					ProjectileManager.instance.FireProjectile(val2);
				}
			});
		}

		private void FireSpit_OnEnter(orig_OnEnter orig, FireSpit self)
		{
			orig.Invoke(self);
			FireForSeeds(((EntityState)self).characterBody, delegate(GameObject seed, SeedBehavior _b, SeedTracker _t, float multiplier)
			{
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_005a: Unknown result type (might be due to invalid IL or missing references)
				//IL_005f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0062: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_0094: Unknown result type (might be due to invalid IL or missing references)
				//IL_0099: Unknown result type (might be due to invalid IL or missing references)
				//IL_009c: 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_00e0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_012c: Unknown result type (might be due to invalid IL or missing references)
				//IL_012d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0133: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)self.effectPrefab))
				{
					seed.MuzzleEffect(self.effectPrefab, transmit: false);
				}
				if (((EntityState)self).isAuthority)
				{
					DamageType val = (DamageType)(((Object)(object)self.crocoDamageTypeController != (Object)null) ? ((int)DamageTypeCombo.op_Implicit(self.crocoDamageTypeController.GetDamageType())) : 0);
					FireProjectileInfo val2 = new FireProjectileInfo
					{
						projectilePrefab = self.projectilePrefab,
						position = seed.transform.position
					};
					Ray aimRay = ((BaseState)self).GetAimRay();
					val2.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction);
					val2.owner = ((EntityState)self).gameObject;
					val2.damage = ((BaseState)self).damageStat * self.damageCoefficient * multiplier;
					val2.damageTypeOverride = DamageTypeCombo.op_Implicit(val);
					val2.force = self.force * multiplier;
					val2.crit = Util.CheckRoll(((BaseState)self).critStat, ((EntityState)self).characterBody.master);
					FireProjectileInfo val3 = val2;
					ProjectileManager.instance.FireProjectile(val3);
				}
			});
		}

		private void BaseLeap_DropAcidPoolAuthority(orig_DropAcidPoolAuthority orig, BaseLeap self)
		{
			orig.Invoke(self);
			FireForSeeds(((EntityState)self).characterBody, delegate(GameObject seed, SeedBehavior _b, SeedTracker _t, float multiplier)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//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_0073: Unknown result type (might be due to invalid IL or missing references)
				//IL_0074: Unknown result type (might be due to invalid IL or missing references)
				//IL_0079: Unknown result type (might be due to invalid IL or missing references)
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0080: Unknown result type (might be due to invalid IL or missing references)
				Vector3 position = seed.transform.position;
				FireProjectileInfo val = new FireProjectileInfo
				{
					projectilePrefab = BaseLeap.projectilePrefab,
					crit = self.isCritAuthority,
					force = 0f,
					damage = ((BaseState)self).damageStat * multiplier,
					owner = ((EntityState)self).gameObject,
					rotation = Quaternion.identity,
					position = position
				};
				ProjectileManager.instance.FireProjectile(val);
			});
		}

		private Result BaseLeap_DetonateAuthority(orig_DetonateAuthority orig, BaseLeap self)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			Result result = orig.Invoke(self);
			FireForSeeds(((EntityState)self).characterBody, delegate(GameObject seed, SeedBehavior _b, SeedTracker _t, float multiplier)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_0036: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: 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_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: 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_007d: Unknown result type (might be due to invalid IL or missing references)
				//IL_007f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0084: Unknown result type (might be due to invalid IL or missing references)
				//IL_008f: 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_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_00ab: 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_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_00c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00de: Unknown result type (might be due to invalid IL or missing references)
				new BlastAttack
				{
					attacker = ((EntityState)self).gameObject,
					baseDamage = ((BaseState)self).damageStat * self.blastDamageCoefficient * multiplier,
					baseForce = self.blastForce * multiplier,
					bonusForce = self.blastBonusForce,
					crit = ((BaseState)self).RollCrit(),
					damageType = self.GetBlastDamageType(),
					falloffModel = (FalloffModel)0,
					procCoefficient = BaseLeap.blastProcCoefficient,
					radius = BaseLeap.blastRadius,
					position = seed.transform.position,
					attackerFiltering = (AttackerFiltering)2,
					impactEffect = EffectCatalog.FindEffectIndexFromPrefab(self.blastImpactEffectPrefab),
					teamIndex = ((EntityState)self).teamComponent.teamIndex
				}.Fire();
			});
			return result;
		}

		private Result GroundSlam_DetonateAuthority(orig_DetonateAuthority orig, GroundSlam self)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			Result result = orig.Invoke(self);
			FireForSeeds(((EntityState)self).characterBody, delegate(GameObject seed, SeedBehavior _b, SeedTracker _t, float multiplier)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: 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_003e: 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)
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				//IL_005a: 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_0062: 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_0069: Unknown result type (might be due to invalid IL or missing references)
				//IL_006e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0079: 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_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_0095: Unknown result type (might be due to invalid IL or missing references)
				//IL_0097: Unknown result type (might be due to invalid IL or missing references)
				//IL_009c: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a2: 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_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_00c2: Unknown result type (might be due to invalid IL or missing references)
				new BlastAttack
				{
					attacker = ((Enti