Decompiled source of Skillsmas v1.3.4

Skillsmas.dll

Decompiled 10 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using ArtificerExtended.Components;
using ArtificerExtended.Passive;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Bandit2;
using EntityStates.Bandit2.Weapon;
using EntityStates.Captain.Weapon;
using EntityStates.CaptainDefenseMatrixItem;
using EntityStates.Commando;
using EntityStates.Commando.CommandoWeapon;
using EntityStates.Croco;
using EntityStates.Huntress.HuntressWeapon;
using EntityStates.Loader;
using EntityStates.Mage.Weapon;
using EntityStates.Merc;
using EntityStates.Merc.Weapon;
using EntityStates.Toolbot;
using HG;
using HG.BlendableTypes;
using HG.Reflection;
using IL.RoR2.Projectile;
using JetBrains.Annotations;
using KinematicCharacterController;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using MysticsRisky2Utils;
using MysticsRisky2Utils.BaseAssetTypes;
using MysticsRisky2Utils.ContentManagement;
using MysticsRisky2Utils.MonoBehaviours;
using MysticsRisky2Utils.SoftDependencies;
using On.EntityStates.Captain.Weapon;
using On.EntityStates.CaptainDefenseMatrixItem;
using On.EntityStates.Commando;
using On.EntityStates.Huntress.HuntressWeapon;
using On.RoR2;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using RoR2;
using RoR2.Audio;
using RoR2.ContentManagement;
using RoR2.Items;
using RoR2.Navigation;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using Skillsmas.DamageTypes;
using Skillsmas.Skills;
using Skillsmas.Skills.Bandit;
using Skillsmas.Skills.Captain;
using Skillsmas.Skills.Loader;
using Skillsmas.Skills.Toolbot;
using Skillsmas.SoftDependencies;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: OptIn]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("Skillsmas")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Skillsmas")]
[assembly: AssemblyTitle("Skillsmas")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Skillsmas
{
	public abstract class BaseGenericLoadable : BaseLoadableAsset
	{
	}
	public static class SkillsmasUtils
	{
		public static CameraRigController FindCameraRigController(GameObject viewer)
		{
			foreach (CameraRigController readOnlyInstances in CameraRigController.readOnlyInstancesList)
			{
				if ((Object)(object)readOnlyInstances.target == (Object)(object)viewer && (Object)(object)readOnlyInstances._localUserViewer.cachedBodyObject == (Object)(object)viewer && !readOnlyInstances.hasOverride)
				{
					return readOnlyInstances;
				}
			}
			return null;
		}

		public static void UncorrectAimRay(GameObject viewer, ref Ray aimRay, float finalPointDistance = 1000f)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_002c: 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_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_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: 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)
			CameraRigController val = FindCameraRigController(viewer);
			if (Object.op_Implicit((Object)(object)val))
			{
				Vector3 position = val.currentCameraState.position;
				float num = finalPointDistance;
				Vector3 val2 = position - ((Ray)(ref aimRay)).origin;
				finalPointDistance = num + ((Vector3)(ref val2)).magnitude;
				position += finalPointDistance * (val.currentCameraState.rotation * Vector3.forward);
				val2 = position - ((Ray)(ref aimRay)).origin;
				((Ray)(ref aimRay)).direction = ((Vector3)(ref val2)).normalized;
			}
		}
	}
	public class SkillsmasProjectileProximityDetonator : MonoBehaviour
	{
		public TeamFilter myTeamFilter;

		public ProjectileExplosion projectileExplosion;

		public GameObject objectToDestroy;

		public void OnTriggerEnter(Collider collider)
		{
			//IL_005b: 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)
			if (!NetworkServer.active || !Object.op_Implicit((Object)(object)collider))
			{
				return;
			}
			HurtBox component = ((Component)collider).GetComponent<HurtBox>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			HealthComponent healthComponent = component.healthComponent;
			if (!Object.op_Implicit((Object)(object)healthComponent))
			{
				return;
			}
			TeamComponent component2 = ((Component)healthComponent).GetComponent<TeamComponent>();
			if (!Object.op_Implicit((Object)(object)component2) || component2.teamIndex != myTeamFilter.teamIndex)
			{
				if (Object.op_Implicit((Object)(object)projectileExplosion))
				{
					projectileExplosion.SetAlive(false);
				}
				if (Object.op_Implicit((Object)(object)objectToDestroy))
				{
					Object.Destroy((Object)(object)objectToDestroy);
				}
			}
		}
	}
	public class SkillsmasProjectileEnhanceZone : MonoBehaviour
	{
		public TeamFilter teamFilter;

		public List<Rigidbody> ignoredProjectiles;

		public List<DamageType> enhancementDamageTypes = new List<DamageType>();

		public void Start()
		{
			ignoredProjectiles = new List<Rigidbody>();
		}

		public void OnTriggerEnter(Collider other)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: 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_00d2: 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_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: 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)
			TeamFilter component = ((Component)other).GetComponent<TeamFilter>();
			Rigidbody component2 = ((Component)other).GetComponent<Rigidbody>();
			if (!Object.op_Implicit((Object)(object)component2) || component.teamIndex != teamFilter.teamIndex || ignoredProjectiles.Contains(component2))
			{
				return;
			}
			ignoredProjectiles.Add(component2);
			if (enhancementDamageTypes.Count <= 0)
			{
				return;
			}
			ProjectileDamage component3 = ((Component)other).GetComponent<ProjectileDamage>();
			ProjectileOverlapAttack component4 = ((Component)other).GetComponent<ProjectileOverlapAttack>();
			ProjectileDotZone component5 = ((Component)other).GetComponent<ProjectileDotZone>();
			foreach (DamageType enhancementDamageType in enhancementDamageTypes)
			{
				if (Object.op_Implicit((Object)(object)component3))
				{
					component3.damageType |= enhancementDamageType;
				}
				if (Object.op_Implicit((Object)(object)component4))
				{
					OverlapAttack attack = component4.attack;
					attack.damageType |= enhancementDamageType;
				}
				if (Object.op_Implicit((Object)(object)component5))
				{
					OverlapAttack attack2 = component5.attack;
					attack2.damageType |= enhancementDamageType;
				}
			}
		}
	}
	public class SkillsmasProjectileHealOwnerOnDamageInflicted : MonoBehaviour, IOnDamageInflictedServerReceiver
	{
		public ProjectileController projectileController;

		public float flatHealing;

		public float fractionalHealing;

		public float healingFromDamageDealt;

		public int maxInstancesOfHealing = -1;

		public int instancesOfHealing = 0;

		public void Awake()
		{
			projectileController = ((Component)this).GetComponent<ProjectileController>();
		}

		public void OnDamageInflictedServer(DamageReport damageReport)
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: 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_00b7: Expected O, but got Unknown
			if ((maxInstancesOfHealing == -1 || instancesOfHealing < maxInstancesOfHealing) && Object.op_Implicit((Object)(object)projectileController.owner))
			{
				HealthComponent component = projectileController.owner.GetComponent<HealthComponent>();
				if (Object.op_Implicit((Object)(object)component))
				{
					HealOrb val = new HealOrb
					{
						origin = ((Component)this).transform.position,
						target = component.body.mainHurtBox,
						healValue = flatHealing + component.fullHealth * fractionalHealing + healingFromDamageDealt * damageReport.damageDealt,
						overrideDuration = 0.3f
					};
					OrbManager.instance.AddOrb((Orb)(object)val);
					instancesOfHealing++;
				}
			}
		}
	}
	public class SkillsmasProjectileSoundAdder : MonoBehaviour
	{
		public ProjectileOverlapAttack projectileOverlapAttack;

		public NetworkSoundEventDef impactSoundEventDef;

		public void Start()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)projectileOverlapAttack))
			{
				projectileOverlapAttack.attack.impactSound = impactSoundEventDef.index;
			}
		}
	}
	public class SkillsmasAlignToRigidbodyVelocity : MonoBehaviour
	{
		public Rigidbody rigidbody;

		public float minimumVelocitySqrMagnitude = 1f;

		public ProjectileStickOnImpact projectileStickOnImpact;

		public void Awake()
		{
			rigidbody = ((Component)this).GetComponent<Rigidbody>();
			projectileStickOnImpact = ((Component)this).GetComponent<ProjectileStickOnImpact>();
		}

		public void LateUpdate()
		{
			//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_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)
			if (Object.op_Implicit((Object)(object)rigidbody))
			{
				Vector3 velocity = rigidbody.velocity;
				if (((Vector3)(ref velocity)).sqrMagnitude >= minimumVelocitySqrMagnitude && (!Object.op_Implicit((Object)(object)projectileStickOnImpact) || !projectileStickOnImpact.stuck))
				{
					Transform transform = ((Component)this).transform;
					velocity = rigidbody.velocity;
					transform.forward = ((Vector3)(ref velocity)).normalized;
				}
			}
		}
	}
	public class PrepCustomWall : BaseState
	{
		public float baseDuration = 0.5f;

		public GameObject areaIndicatorPrefab;

		public GameObject muzzleflashEffect;

		public GameObject goodCrosshairPrefab;

		public GameObject badCrosshairPrefab;

		public string prepWallSoundString = "Play_mage_shift_start";

		public string fireSoundString = "Play_mage_shift_stop";

		public float maxDistance = 600f;

		public float maxSlopeAngle = 70f;

		public float duration;

		public bool goodPlacement;

		public GameObject areaIndicatorInstance;

		public OverrideRequest crosshairOverrideRequest;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			((EntityState)this).characterBody.SetAimTimer(duration + 2f);
			((EntityState)this).PlayAnimation("Gesture, Additive", "PrepWall", "PrepWall.playbackRate", duration);
			Util.PlaySound(prepWallSoundString, ((EntityState)this).gameObject);
			areaIndicatorInstance = Object.Instantiate<GameObject>(areaIndicatorPrefab);
			UpdateAreaIndicator();
		}

		private void UpdateAreaIndicator()
		{
			//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_0036: 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_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: 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_00b7: 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)
			bool flag = goodPlacement;
			goodPlacement = false;
			areaIndicatorInstance.SetActive(true);
			if (Object.op_Implicit((Object)(object)areaIndicatorInstance))
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				float num = default(float);
				RaycastHit val = default(RaycastHit);
				if (Physics.Raycast(CameraRigController.ModifyAimRayIfApplicable(aimRay, ((EntityState)this).gameObject, ref num), ref val, maxDistance + num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)))
				{
					areaIndicatorInstance.transform.position = ((RaycastHit)(ref val)).point;
					areaIndicatorInstance.transform.up = ((RaycastHit)(ref val)).normal;
					areaIndicatorInstance.transform.forward = -((Ray)(ref aimRay)).direction;
					goodPlacement = Vector3.Angle(Vector3.up, ((RaycastHit)(ref val)).normal) < maxSlopeAngle;
				}
				if (flag != goodPlacement || crosshairOverrideRequest == null)
				{
					if (crosshairOverrideRequest != null)
					{
						crosshairOverrideRequest.Dispose();
					}
					GameObject val2 = (goodPlacement ? goodCrosshairPrefab : badCrosshairPrefab);
					crosshairOverrideRequest = CrosshairUtils.RequestOverrideForBody(((EntityState)this).characterBody, val2, (OverridePriority)1);
				}
			}
			areaIndicatorInstance.SetActive(goodPlacement);
		}

		public override void Update()
		{
			((EntityState)this).Update();
			UpdateAreaIndicator();
		}

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

		public virtual void CreateWall(Vector3 position, Quaternion rotation)
		{
		}

		public override void OnExit()
		{
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: 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)
			if (!((EntityState)this).outer.destroying)
			{
				if (goodPlacement)
				{
					((EntityState)this).PlayAnimation("Gesture, Additive", "FireWall");
					Util.PlaySound(fireSoundString, ((EntityState)this).gameObject);
					if (Object.op_Implicit((Object)(object)areaIndicatorInstance))
					{
						if (((EntityState)this).isAuthority)
						{
							EffectManager.SimpleMuzzleFlash(muzzleflashEffect, ((EntityState)this).gameObject, "MuzzleLeft", true);
							EffectManager.SimpleMuzzleFlash(muzzleflashEffect, ((EntityState)this).gameObject, "MuzzleRight", true);
						}
						Vector3 forward = areaIndicatorInstance.transform.forward;
						forward.y = 0f;
						((Vector3)(ref forward)).Normalize();
						Vector3 val = Vector3.Cross(Vector3.up, forward);
						CreateWall(areaIndicatorInstance.transform.position, Util.QuaternionSafeLookRotation(val));
						if (SkillsmasPlugin.artificerExtendedEnabled)
						{
							ArtificerExtendedSupport.TriggerAltPassiveSkillCast(((Component)((EntityState)this).outer).gameObject);
						}
					}
				}
				else
				{
					((EntityState)this).skillLocator.utility.AddOneStock();
					((EntityState)this).PlayCrossfade("Gesture, Additive", "BufferEmpty", 0.2f);
				}
			}
			EntityState.Destroy((Object)(object)areaIndicatorInstance.gameObject);
			if (crosshairOverrideRequest != null)
			{
				crosshairOverrideRequest.Dispose();
			}
			((EntityState)this).OnExit();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)3;
		}
	}
	public static class ExtensionMethods
	{
		public static void LoadConfiguration(this EntityState entityState, Type type)
		{
			if (EntityStateCatalog.instanceFieldInitializers.TryGetValue(type, out var value))
			{
				value(entityState);
			}
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.themysticsword.skillsmas", "Skillsmas", "1.3.4")]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	public class SkillsmasPlugin : BaseUnityPlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static CollectContentPackProvidersDelegate <>9__13_0;

			internal void <Awake>b__13_0(AddContentPackProviderDelegate addContentPackProvider)
			{
				addContentPackProvider.Invoke((IContentPackProvider)(object)new SkillsmasContent());
			}
		}

		public const string PluginGUID = "com.themysticsword.skillsmas";

		public const string PluginName = "Skillsmas";

		public const string PluginVersion = "1.3.4";

		public static Assembly executingAssembly;

		internal static Type declaringType;

		internal static PluginInfo pluginInfo;

		internal static ManualLogSource logger;

		internal static ConfigFile config;

		internal static ConfigurableValue<bool> ignoreBalanceConfig;

		internal static bool artificerExtendedEnabled;

		private static AssetBundle _assetBundle;

		public static AssetBundle AssetBundle
		{
			get
			{
				if ((Object)(object)_assetBundle == (Object)null)
				{
					_assetBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(pluginInfo.Location), "skillsmasassetbundle"));
				}
				return _assetBundle;
			}
		}

		public void Awake()
		{
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Expected O, but got Unknown
			//IL_00f2: 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_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Expected O, but got Unknown
			pluginInfo = ((BaseUnityPlugin)this).Info;
			logger = ((BaseUnityPlugin)this).Logger;
			config = ((BaseUnityPlugin)this).Config;
			executingAssembly = Assembly.GetExecutingAssembly();
			declaringType = MethodBase.GetCurrentMethod().DeclaringType;
			ConfigEntry<bool> val = config.Bind<bool>("General", "Ignore Balance Changes", true, "Old value that has no effect anymore. Will be removed in the future. Use the Ignore Balance Changes option in the ! General ! section instead.");
			ignoreBalanceConfig = ConfigurableValue.CreateBool("com.themysticsword.skillsmas", "Skillsmas", config, "! General !", "Ignore Balance Changes", val.Value, "If true, most of the balance-related number values won't be changed by configs, and will use recommended default values.", (List<string>)null, (ConfigEntry<bool>)null, false, (Action<bool>)null);
			if (RiskOfOptionsDependency.enabled)
			{
				Sprite val2 = null;
				string path = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "icon.png");
				if (File.Exists(path))
				{
					Texture2D val3 = new Texture2D(2, 2);
					ImageConversion.LoadImage(val3, File.ReadAllBytes(path));
					val2 = Sprite.Create(val3, new Rect(0f, 0f, (float)((Texture)val3).width, (float)((Texture)val3).height), new Vector2(0f, 0f), 100f);
				}
				RiskOfOptionsDependency.RegisterModInfo("com.themysticsword.skillsmas", "Skillsmas", "Adds new skills. Has nothing to do with Christmas. Sorry.", val2);
			}
			if (Chainloader.PluginInfos.ContainsKey("com.Borbo.ArtificerExtended"))
			{
				artificerExtendedEnabled = true;
				ArtificerExtendedSupport.Init();
			}
			ContentLoadHelper.PluginAwakeLoad<BaseGenericLoadable>(executingAssembly);
			ContentLoadHelper.PluginAwakeLoad<BaseItem>(executingAssembly);
			ContentLoadHelper.PluginAwakeLoad<BaseEquipment>(executingAssembly);
			ContentLoadHelper.PluginAwakeLoad<BaseBuff>(executingAssembly);
			ContentLoadHelper.PluginAwakeLoad<BaseInteractable>(executingAssembly);
			ContentLoadHelper.PluginAwakeLoad<BaseCharacterBody>(executingAssembly);
			ContentLoadHelper.PluginAwakeLoad<BaseCharacterMaster>(executingAssembly);
			ContentLoadHelper.PluginAwakeLoad<BaseSkill>(executingAssembly);
			object obj = <>c.<>9__13_0;
			if (obj == null)
			{
				CollectContentPackProvidersDelegate val4 = delegate(AddContentPackProviderDelegate addContentPackProvider)
				{
					addContentPackProvider.Invoke((IContentPackProvider)(object)new SkillsmasContent());
				};
				<>c.<>9__13_0 = val4;
				obj = (object)val4;
			}
			ContentManager.collectContentPackProviders += (CollectContentPackProvidersDelegate)obj;
		}
	}
	public class SkillsmasContent : IContentPackProvider
	{
		public static class Resources
		{
			public static List<GameObject> bodyPrefabs = new List<GameObject>();

			public static List<GameObject> masterPrefabs = new List<GameObject>();

			public static List<GameObject> projectilePrefabs = new List<GameObject>();

			public static List<GameObject> effectPrefabs = new List<GameObject>();

			public static List<GameObject> gameModePrefabs = new List<GameObject>();

			public static List<GameObject> networkedObjectPrefabs = new List<GameObject>();

			public static List<NetworkSoundEventDef> networkSoundEventDefs = new List<NetworkSoundEventDef>();

			public static List<UnlockableDef> unlockableDefs = new List<UnlockableDef>();

			public static List<Type> entityStateTypes = new List<Type>();

			public static List<SkillDef> skillDefs = new List<SkillDef>();

			public static List<SkillFamily> skillFamilies = new List<SkillFamily>();

			public static List<SceneDef> sceneDefs = new List<SceneDef>();

			public static List<GameEndingDef> gameEndingDefs = new List<GameEndingDef>();
		}

		public static class Items
		{
			public static ItemDef Skillsmas_TemporaryMicrobots;
		}

		public static class Buffs
		{
			public static BuffDef Skillsmas_StopBarrierDecay;

			public static BuffDef Skillsmas_ChainKillActive;

			public static BuffDef Skillsmas_EnemyMark;

			public static BuffDef Skillsmas_MarkedEnemyHit;

			public static BuffDef Skillsmas_MarkedEnemyKill;

			public static BuffDef Skillsmas_ChainKillBonusDamage;

			public static BuffDef Skillsmas_ToolbotUpdated;

			public static BuffDef Skillsmas_Harden;
		}

		private ContentPack contentPack = new ContentPack();

		public string identifier => "Skillsmas";

		public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
		{
			contentPack.identifier = identifier;
			ContentLoadHelper contentLoadHelper = new ContentLoadHelper();
			Action[] loadDispatchers = new Action[8]
			{
				delegate
				{
					contentLoadHelper.DispatchLoad<object>(SkillsmasPlugin.executingAssembly, typeof(BaseGenericLoadable), (Action<object[]>)null);
				},
				delegate
				{
					contentLoadHelper.DispatchLoad<ItemDef>(SkillsmasPlugin.executingAssembly, typeof(BaseItem), (Action<ItemDef[]>)delegate(ItemDef[] x)
					{
						contentPack.itemDefs.Add(x);
					});
				},
				delegate
				{
					contentLoadHelper.DispatchLoad<EquipmentDef>(SkillsmasPlugin.executingAssembly, typeof(BaseEquipment), (Action<EquipmentDef[]>)delegate(EquipmentDef[] x)
					{
						contentPack.equipmentDefs.Add(x);
					});
				},
				delegate
				{
					contentLoadHelper.DispatchLoad<BuffDef>(SkillsmasPlugin.executingAssembly, typeof(BaseBuff), (Action<BuffDef[]>)delegate(BuffDef[] x)
					{
						contentPack.buffDefs.Add(x);
					});
				},
				delegate
				{
					contentLoadHelper.DispatchLoad<GameObject>(SkillsmasPlugin.executingAssembly, typeof(BaseInteractable), (Action<GameObject[]>)null);
				},
				delegate
				{
					contentLoadHelper.DispatchLoad<GameObject>(SkillsmasPlugin.executingAssembly, typeof(BaseCharacterBody), (Action<GameObject[]>)delegate(GameObject[] x)
					{
						contentPack.bodyPrefabs.Add(x);
					});
				},
				delegate
				{
					contentLoadHelper.DispatchLoad<GameObject>(SkillsmasPlugin.executingAssembly, typeof(BaseCharacterMaster), (Action<GameObject[]>)delegate(GameObject[] x)
					{
						contentPack.masterPrefabs.Add(x);
					});
				},
				delegate
				{
					contentLoadHelper.DispatchLoad<SkillDef>(SkillsmasPlugin.executingAssembly, typeof(BaseSkill), (Action<SkillDef[]>)delegate(SkillDef[] x)
					{
						contentPack.skillDefs.Add(x);
					});
				}
			};
			int i = 0;
			while (i < loadDispatchers.Length)
			{
				loadDispatchers[i]();
				args.ReportProgress(Util.Remap((float)(i + 1), 0f, (float)loadDispatchers.Length, 0f, 0.05f));
				yield return null;
				int num = i + 1;
				i = num;
			}
			while (contentLoadHelper.coroutine.MoveNext())
			{
				args.ReportProgress(Util.Remap(contentLoadHelper.progress.value, 0f, 1f, 0.05f, 0.9f));
				yield return contentLoadHelper.coroutine.Current;
			}
			loadDispatchers = new Action[15]
			{
				delegate
				{
					ContentLoadHelper.PopulateTypeFields<ItemDef>(typeof(Items), contentPack.itemDefs, (Func<string, string>)null);
				},
				delegate
				{
					ContentLoadHelper.PopulateTypeFields<BuffDef>(typeof(Buffs), contentPack.buffDefs, (Func<string, string>)null);
				},
				delegate
				{
					contentPack.bodyPrefabs.Add(Resources.bodyPrefabs.ToArray());
				},
				delegate
				{
					contentPack.masterPrefabs.Add(Resources.masterPrefabs.ToArray());
				},
				delegate
				{
					contentPack.projectilePrefabs.Add(Resources.projectilePrefabs.ToArray());
				},
				delegate
				{
					contentPack.gameModePrefabs.Add(Resources.gameModePrefabs.ToArray());
				},
				delegate
				{
					contentPack.networkedObjectPrefabs.Add(Resources.networkedObjectPrefabs.ToArray());
				},
				delegate
				{
					contentPack.effectDefs.Add(Resources.effectPrefabs.ConvertAll((Converter<GameObject, EffectDef>)((GameObject x) => new EffectDef(x))).ToArray());
				},
				delegate
				{
					contentPack.networkSoundEventDefs.Add(Resources.networkSoundEventDefs.ToArray());
				},
				delegate
				{
					contentPack.unlockableDefs.Add(Resources.unlockableDefs.ToArray());
				},
				delegate
				{
					contentPack.entityStateTypes.Add(Resources.entityStateTypes.ToArray());
				},
				delegate
				{
					contentPack.skillDefs.Add(Resources.skillDefs.ToArray());
				},
				delegate
				{
					contentPack.skillFamilies.Add(Resources.skillFamilies.ToArray());
				},
				delegate
				{
					contentPack.sceneDefs.Add(Resources.sceneDefs.ToArray());
				},
				delegate
				{
					contentPack.gameEndingDefs.Add(Resources.gameEndingDefs.ToArray());
				}
			};
			int j = 0;
			while (j < loadDispatchers.Length)
			{
				loadDispatchers[j]();
				args.ReportProgress(Util.Remap((float)(j + 1), 0f, (float)loadDispatchers.Length, 0.9f, 0.95f));
				yield return null;
				int num = j + 1;
				j = num;
			}
			loadDispatchers = new Action[6]
			{
				delegate
				{
					ContentLoadHelper.InvokeAfterContentPackLoaded<BaseGenericLoadable>(SkillsmasPlugin.executingAssembly);
				},
				delegate
				{
					ContentLoadHelper.InvokeAfterContentPackLoaded<BaseItem>(SkillsmasPlugin.executingAssembly);
				},
				delegate
				{
					ContentLoadHelper.InvokeAfterContentPackLoaded<BaseEquipment>(SkillsmasPlugin.executingAssembly);
				},
				delegate
				{
					ContentLoadHelper.InvokeAfterContentPackLoaded<BaseBuff>(SkillsmasPlugin.executingAssembly);
				},
				delegate
				{
					ContentLoadHelper.InvokeAfterContentPackLoaded<BaseInteractable>(SkillsmasPlugin.executingAssembly);
				},
				delegate
				{
					ContentLoadHelper.InvokeAfterContentPackLoaded<BaseSkill>(SkillsmasPlugin.executingAssembly);
				}
			};
			int k = 0;
			while (k < loadDispatchers.Length)
			{
				loadDispatchers[k]();
				args.ReportProgress(Util.Remap((float)(k + 1), 0f, (float)loadDispatchers.Length, 0.95f, 0.99f));
				yield return null;
				int num = k + 1;
				k = num;
			}
		}

		public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args)
		{
			ContentPack.Copy(contentPack, args.output);
			args.ReportProgress(1f);
			yield break;
		}

		public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
		{
			Action[] actions = new Action[4]
			{
				delegate
				{
					//IL_0005: Unknown result type (might be due to invalid IL or missing references)
					//IL_000a: Unknown result type (might be due to invalid IL or missing references)
					OrderCharacterSkills(Addressables.LoadAssetAsync<SkillFamily>((object)"RoR2/Base/Mage/MageBodyPrimaryFamily.asset").WaitForCompletion(), new string[5] { "FireFirebolt", "FireLightningBolt", "Skillsmas_CryoBolt", "Skillsmas_RockBolt", "Skillsmas_WaterBolt" });
				},
				delegate
				{
					//IL_0005: Unknown result type (might be due to invalid IL or missing references)
					//IL_000a: Unknown result type (might be due to invalid IL or missing references)
					OrderCharacterSkills(Addressables.LoadAssetAsync<SkillFamily>((object)"RoR2/Base/Mage/MageBodySecondaryFamily.asset").WaitForCompletion(), new string[5] { "Skillsmas_FlameBomb", "NovaBomb", "IceBomb", "Skillsmas_RockBomb", "Skillsmas_WaterBomb" });
				},
				delegate
				{
					//IL_0005: Unknown result type (might be due to invalid IL or missing references)
					//IL_000a: Unknown result type (might be due to invalid IL or missing references)
					OrderCharacterSkills(Addressables.LoadAssetAsync<SkillFamily>((object)"RoR2/Base/Mage/MageBodyUtilityFamily.asset").WaitForCompletion(), new string[5] { "Skillsmas_FireWall", "Skillsmas_LightningPillar", "Wall", "Skillsmas_RockPlatform", "Skillsmas_WaterCloud" });
				},
				delegate
				{
					//IL_0005: Unknown result type (might be due to invalid IL or missing references)
					//IL_000a: Unknown result type (might be due to invalid IL or missing references)
					OrderCharacterSkills(Addressables.LoadAssetAsync<SkillFamily>((object)"RoR2/Base/Mage/MageBodySpecialFamily.asset").WaitForCompletion(), new string[5] { "Flamethrower", "FlyUp", "Skillsmas_FrostBarrier", "Skillsmas_RockMeteor", "Skillsmas_WaterWave" });
				}
			};
			int i = 0;
			while (i < actions.Length)
			{
				actions[i]();
				args.ReportProgress(Util.Remap((float)(i + 1), 0f, (float)actions.Length, 0f, 0.99f));
				yield return null;
				int num = i + 1;
				i = num;
			}
			args.ReportProgress(1f);
			static void OrderCharacterSkills(SkillFamily skillFamily, string[] skillNames)
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0050: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_005b: 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_007e: 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_00ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
				Variant item = skillFamily.variants[skillFamily.defaultVariantIndex];
				List<Variant> list = skillFamily.variants.ToList();
				List<Variant> list2 = new List<Variant>();
				foreach (string skillName in skillNames)
				{
					Variant item2 = ((IEnumerable<Variant>)list).FirstOrDefault((Func<Variant, bool>)((Variant x) => x.skillDef.skillName == skillName));
					if (!((object)(Variant)(ref item2)).Equals((object)default(Variant)))
					{
						list2.Add(item2);
						list.Remove(item2);
					}
				}
				int num2 = 0;
				foreach (Variant item3 in list2)
				{
					list.Insert(num2, item3);
					num2++;
				}
				skillFamily.variants = list.ToArray();
				skillFamily.defaultVariantIndex = (uint)list.IndexOf(item);
			}
		}
	}
}
namespace Skillsmas.SoftDependencies
{
	internal static class ArtificerExtendedSupport
	{
		internal class SkillsmasArtificerExtendedElementCounter : MonoBehaviour
		{
			public static Dictionary<GameObject, SkillsmasArtificerExtendedElementCounter> lookupDictionary = new Dictionary<GameObject, SkillsmasArtificerExtendedElementCounter>();

			public Power rockPower;

			public Power waterPower;

			public void OnEnable()
			{
				lookupDictionary[((Component)this).gameObject] = this;
			}

			public void OnDisable()
			{
				lookupDictionary.Remove(((Component)this).gameObject);
			}
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Action<ElementCounter, SkillLocator> <>9__1_2;

			public static Manipulator <>9__1_0;

			public static Action<ElementCounter, GenericSkill> <>9__1_3;

			public static Manipulator <>9__1_1;

			internal void <Init>b__1_0(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				val.Emit(OpCodes.Ldarg_0);
				val.Emit(OpCodes.Ldarg_1);
				val.EmitDelegate<Action<ElementCounter, SkillLocator>>((Action<ElementCounter, SkillLocator>)delegate(ElementCounter elementCounter, SkillLocator skillLocator)
				{
					//IL_0027: 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)
					GameObject gameObject = ((Component)elementCounter).gameObject;
					if (!SkillsmasArtificerExtendedElementCounter.lookupDictionary.TryGetValue(gameObject, out var value))
					{
						value = gameObject.AddComponent<SkillsmasArtificerExtendedElementCounter>();
					}
					value.rockPower = (Power)0;
					value.waterPower = (Power)0;
				});
			}

			internal void <Init>b__1_2(ElementCounter elementCounter, SkillLocator skillLocator)
			{
				//IL_0027: 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)
				GameObject gameObject = ((Component)elementCounter).gameObject;
				if (!SkillsmasArtificerExtendedElementCounter.lookupDictionary.TryGetValue(gameObject, out var value))
				{
					value = gameObject.AddComponent<SkillsmasArtificerExtendedElementCounter>();
				}
				value.rockPower = (Power)0;
				value.waterPower = (Power)0;
			}

			internal void <Init>b__1_1(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				val.Emit(OpCodes.Ldarg_0);
				val.Emit(OpCodes.Ldarg_1);
				val.EmitDelegate<Action<ElementCounter, GenericSkill>>((Action<ElementCounter, GenericSkill>)delegate(ElementCounter elementCounter, GenericSkill skill)
				{
					//IL_00af: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
					//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
					//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
					//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
					//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
					//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
					//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
					//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
					//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
					//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
					//IL_0107: Unknown result type (might be due to invalid IL or missing references)
					//IL_010d: Unknown result type (might be due to invalid IL or missing references)
					//IL_010e: Unknown result type (might be due to invalid IL or missing references)
					SkillsmasArtificerExtendedElementCounter.lookupDictionary.TryGetValue(((Component)elementCounter).gameObject, out var value);
					string skillNameToken = skill.baseSkill.skillNameToken;
					if (skillNameToken.StartsWith("MAGE_SKILLSMAS_"))
					{
						string[] array = skillNameToken.Split(new char[1] { '_' });
						if (array.Length >= 4)
						{
							switch (array[3])
							{
							case "FIRE":
								elementCounter.firePower = (Power)(elementCounter.firePower + 1);
								break;
							case "LIGHTNING":
								elementCounter.lightningPower = (Power)(elementCounter.lightningPower + 1);
								break;
							case "ICE":
								elementCounter.icePower = (Power)(elementCounter.icePower + 1);
								break;
							case "ROCK":
								if (Object.op_Implicit((Object)(object)value))
								{
									SkillsmasArtificerExtendedElementCounter skillsmasArtificerExtendedElementCounter2 = value;
									skillsmasArtificerExtendedElementCounter2.rockPower = (Power)(skillsmasArtificerExtendedElementCounter2.rockPower + 1);
								}
								break;
							case "WATER":
								if (Object.op_Implicit((Object)(object)value))
								{
									SkillsmasArtificerExtendedElementCounter skillsmasArtificerExtendedElementCounter = value;
									skillsmasArtificerExtendedElementCounter.waterPower = (Power)(skillsmasArtificerExtendedElementCounter.waterPower + 1);
								}
								break;
							}
						}
					}
				});
			}

			internal void <Init>b__1_3(ElementCounter elementCounter, GenericSkill skill)
			{
				//IL_00af: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
				//IL_0107: Unknown result type (might be due to invalid IL or missing references)
				//IL_010d: Unknown result type (might be due to invalid IL or missing references)
				//IL_010e: Unknown result type (might be due to invalid IL or missing references)
				SkillsmasArtificerExtendedElementCounter.lookupDictionary.TryGetValue(((Component)elementCounter).gameObject, out var value);
				string skillNameToken = skill.baseSkill.skillNameToken;
				if (!skillNameToken.StartsWith("MAGE_SKILLSMAS_"))
				{
					return;
				}
				string[] array = skillNameToken.Split(new char[1] { '_' });
				if (array.Length < 4)
				{
					return;
				}
				switch (array[3])
				{
				case "FIRE":
					elementCounter.firePower = (Power)(elementCounter.firePower + 1);
					break;
				case "LIGHTNING":
					elementCounter.lightningPower = (Power)(elementCounter.lightningPower + 1);
					break;
				case "ICE":
					elementCounter.icePower = (Power)(elementCounter.icePower + 1);
					break;
				case "ROCK":
					if (Object.op_Implicit((Object)(object)value))
					{
						SkillsmasArtificerExtendedElementCounter skillsmasArtificerExtendedElementCounter2 = value;
						skillsmasArtificerExtendedElementCounter2.rockPower = (Power)(skillsmasArtificerExtendedElementCounter2.rockPower + 1);
					}
					break;
				case "WATER":
					if (Object.op_Implicit((Object)(object)value))
					{
						SkillsmasArtificerExtendedElementCounter skillsmasArtificerExtendedElementCounter = value;
						skillsmasArtificerExtendedElementCounter.waterPower = (Power)(skillsmasArtificerExtendedElementCounter.waterPower + 1);
					}
					break;
				}
			}
		}

		public static BindingFlags bindingFlagAll = (BindingFlags)(-1);

		internal static void Init()
		{
			//IL_0039: 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_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Expected O, but got Unknown
			MethodInfo? method = typeof(ElementCounter).GetMethod("GetPowers", bindingFlagAll);
			object obj = <>c.<>9__1_0;
			if (obj == null)
			{
				Manipulator val = delegate(ILContext il)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Expected O, but got Unknown
					//IL_0009: Unknown result type (might be due to invalid IL or missing references)
					//IL_0015: Unknown result type (might be due to invalid IL or missing references)
					ILCursor val4 = new ILCursor(il);
					val4.Emit(OpCodes.Ldarg_0);
					val4.Emit(OpCodes.Ldarg_1);
					val4.EmitDelegate<Action<ElementCounter, SkillLocator>>((Action<ElementCounter, SkillLocator>)delegate(ElementCounter elementCounter, SkillLocator skillLocator)
					{
						//IL_0027: 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)
						GameObject gameObject = ((Component)elementCounter).gameObject;
						if (!SkillsmasArtificerExtendedElementCounter.lookupDictionary.TryGetValue(gameObject, out var value2))
						{
							value2 = gameObject.AddComponent<SkillsmasArtificerExtendedElementCounter>();
						}
						value2.rockPower = (Power)0;
						value2.waterPower = (Power)0;
					});
				};
				<>c.<>9__1_0 = val;
				obj = (object)val;
			}
			new ILHook((MethodBase)method, (Manipulator)obj);
			MethodInfo? method2 = typeof(ElementCounter).GetMethod("GetSkillPower", bindingFlagAll);
			object obj2 = <>c.<>9__1_1;
			if (obj2 == null)
			{
				Manipulator val2 = delegate(ILContext il)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Expected O, but got Unknown
					//IL_0009: Unknown result type (might be due to invalid IL or missing references)
					//IL_0015: Unknown result type (might be due to invalid IL or missing references)
					ILCursor val3 = new ILCursor(il);
					val3.Emit(OpCodes.Ldarg_0);
					val3.Emit(OpCodes.Ldarg_1);
					val3.EmitDelegate<Action<ElementCounter, GenericSkill>>((Action<ElementCounter, GenericSkill>)delegate(ElementCounter elementCounter, GenericSkill skill)
					{
						//IL_00af: Unknown result type (might be due to invalid IL or missing references)
						//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
						//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
						//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
						//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
						//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
						//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
						//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
						//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
						//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
						//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
						//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
						//IL_0107: Unknown result type (might be due to invalid IL or missing references)
						//IL_010d: Unknown result type (might be due to invalid IL or missing references)
						//IL_010e: Unknown result type (might be due to invalid IL or missing references)
						SkillsmasArtificerExtendedElementCounter.lookupDictionary.TryGetValue(((Component)elementCounter).gameObject, out var value);
						string skillNameToken = skill.baseSkill.skillNameToken;
						if (skillNameToken.StartsWith("MAGE_SKILLSMAS_"))
						{
							string[] array = skillNameToken.Split(new char[1] { '_' });
							if (array.Length >= 4)
							{
								switch (array[3])
								{
								case "FIRE":
									elementCounter.firePower = (Power)(elementCounter.firePower + 1);
									break;
								case "LIGHTNING":
									elementCounter.lightningPower = (Power)(elementCounter.lightningPower + 1);
									break;
								case "ICE":
									elementCounter.icePower = (Power)(elementCounter.icePower + 1);
									break;
								case "ROCK":
									if (Object.op_Implicit((Object)(object)value))
									{
										SkillsmasArtificerExtendedElementCounter skillsmasArtificerExtendedElementCounter2 = value;
										skillsmasArtificerExtendedElementCounter2.rockPower = (Power)(skillsmasArtificerExtendedElementCounter2.rockPower + 1);
									}
									break;
								case "WATER":
									if (Object.op_Implicit((Object)(object)value))
									{
										SkillsmasArtificerExtendedElementCounter skillsmasArtificerExtendedElementCounter = value;
										skillsmasArtificerExtendedElementCounter.waterPower = (Power)(skillsmasArtificerExtendedElementCounter.waterPower + 1);
									}
									break;
								}
							}
						}
					});
				};
				<>c.<>9__1_1 = val2;
				obj2 = (object)val2;
			}
			new ILHook((MethodBase)method2, (Manipulator)obj2);
		}

		internal static void TriggerAltPassiveSkillCast(GameObject entityStateMachineObject)
		{
			if (AltArtiPassive.instanceLookup.TryGetValue(entityStateMachineObject, out var value))
			{
				value.SkillCast((BatchHandle)null);
			}
		}

		internal static bool BodyHasAltPassive(GameObject bodyObject)
		{
			AltArtiPassive value;
			return AltArtiPassive.instanceLookup.TryGetValue(bodyObject, out value);
		}

		internal static void OnBarrierCrystalSpawned(GameObject childGameObject, ProjectileExplosion projectileExplosion)
		{
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			Crystallize.SkillsmasBarrierPickup componentInChildren = childGameObject.GetComponentInChildren<Crystallize.SkillsmasBarrierPickup>();
			if (Object.op_Implicit((Object)(object)componentInChildren))
			{
				GameObject owner = projectileExplosion.projectileController.owner;
				if (Object.op_Implicit((Object)(object)owner) && BodyHasAltPassive(owner) && SkillsmasArtificerExtendedElementCounter.lookupDictionary.TryGetValue(owner, out var value))
				{
					componentInChildren.hardenBuffDuration = ConfigurableValue<float>.op_Implicit(Crystallize.energeticResonanceDuration) * (float)value.rockPower;
				}
			}
		}

		internal static int GetWaterPower(GameObject bodyGameObject)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected I4, but got Unknown
			if (Object.op_Implicit((Object)(object)bodyGameObject) && SkillsmasArtificerExtendedElementCounter.lookupDictionary.TryGetValue(bodyGameObject, out var value))
			{
				return (int)value.waterPower;
			}
			return 0;
		}
	}
}
namespace Skillsmas.Skills
{
	public abstract class BaseSkill : BaseLoadableAsset
	{
		public SkillDef skillDef;

		public Variant skillFamilyVariant;

		public ConfigurableValue<float> configCooldown;

		public ConfigurableValue<int> configMaxStock;

		public ConfigurableValue<int> configRechargeStock;

		public ConfigurableValue<int> configRequiredStock;

		public ConfigurableValue<int> configStockToConsume;

		public ConfigurableValue<bool> configCancelSprint;

		public ConfigurableValue<bool> configForceSprint;

		public ConfigurableValue<bool> configCancelledFromSprinting;

		public ConfigurableValue<bool> configIsCombatSkill;

		public ConfigurableValue<bool> configMustKeyPress;

		public virtual Type GetSkillDefType()
		{
			return typeof(SkillDef);
		}

		public override void Load()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_001a: 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)
			skillDef = (SkillDef)ScriptableObject.CreateInstance(GetSkillDefType());
			skillFamilyVariant = new Variant
			{
				skillDef = skillDef
			};
			((BaseLoadableAsset)this).OnLoad();
			((Object)skillDef).name = skillDef.skillName;
			base.asset = skillDef;
		}

		public void SetUpValuesAndOptions(string skillName, float baseRechargeInterval, int baseMaxStock, int rechargeStock, int requiredStock, int stockToConsume, bool cancelSprintingOnActivation, bool forceSprintDuringState, bool canceledFromSprinting, bool isCombatSkill, bool mustKeyPress)
		{
			configCooldown = ConfigurableValue.CreateFloat("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, skillName, "Cooldown", baseRechargeInterval, 0f, 1000f, "", (List<string>)null, SkillsmasPlugin.ignoreBalanceConfig.bepinexConfigEntry, false, (Action<float>)delegate(float newValue)
			{
				skillDef.baseRechargeInterval = newValue;
			});
			configMaxStock = ConfigurableValue.CreateInt("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, skillName, "Max Stock", baseMaxStock, 0, 1000, "", (List<string>)null, SkillsmasPlugin.ignoreBalanceConfig.bepinexConfigEntry, false, (Action<int>)delegate(int newValue)
			{
				skillDef.baseMaxStock = newValue;
			});
			configRechargeStock = ConfigurableValue.CreateInt("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, skillName, "Recharge Stock", rechargeStock, 0, 1000, "", (List<string>)null, SkillsmasPlugin.ignoreBalanceConfig.bepinexConfigEntry, false, (Action<int>)delegate(int newValue)
			{
				skillDef.rechargeStock = newValue;
			});
			configRequiredStock = ConfigurableValue.CreateInt("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, skillName, "Required Stock", requiredStock, 0, 1000, "", (List<string>)null, SkillsmasPlugin.ignoreBalanceConfig.bepinexConfigEntry, false, (Action<int>)delegate(int newValue)
			{
				skillDef.requiredStock = newValue;
			});
			configStockToConsume = ConfigurableValue.CreateInt("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, skillName, "Stock To Consume", stockToConsume, 0, 1000, "", (List<string>)null, SkillsmasPlugin.ignoreBalanceConfig.bepinexConfigEntry, false, (Action<int>)delegate(int newValue)
			{
				skillDef.stockToConsume = newValue;
			});
			configCancelSprint = ConfigurableValue.CreateBool("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, skillName, "Cancel Sprint", cancelSprintingOnActivation, "", (List<string>)null, (ConfigEntry<bool>)null, false, (Action<bool>)delegate(bool newValue)
			{
				skillDef.cancelSprintingOnActivation = newValue;
			});
			configForceSprint = ConfigurableValue.CreateBool("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, skillName, "Force Sprint", forceSprintDuringState, "", (List<string>)null, (ConfigEntry<bool>)null, false, (Action<bool>)delegate(bool newValue)
			{
				skillDef.forceSprintDuringState = newValue;
			});
			configCancelledFromSprinting = ConfigurableValue.CreateBool("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, skillName, "Cancelled From Sprinting", canceledFromSprinting, "", (List<string>)null, (ConfigEntry<bool>)null, false, (Action<bool>)delegate(bool newValue)
			{
				skillDef.canceledFromSprinting = newValue;
			});
			configIsCombatSkill = ConfigurableValue.CreateBool("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, skillName, "Is Combat Skill", isCombatSkill, "", (List<string>)null, SkillsmasPlugin.ignoreBalanceConfig.bepinexConfigEntry, false, (Action<bool>)delegate(bool newValue)
			{
				skillDef.isCombatSkill = newValue;
			});
			configMustKeyPress = ConfigurableValue.CreateBool("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, skillName, "Must Key Press", mustKeyPress, "", (List<string>)null, (ConfigEntry<bool>)null, false, (Action<bool>)delegate(bool newValue)
			{
				skillDef.mustKeyPress = newValue;
			});
		}
	}
}
namespace Skillsmas.Skills.Treebot
{
	public class SpikyRoots : BaseSkill
	{
		public class FireRoot : BaseSkillState, IStepSetter
		{
			public static float distanceInitial = 5f;

			public static float distanceBetweenRoots = 6f;

			public static int rootCount = 4;

			public static float floorMaxDistance = 5f;

			public static float baseDuration = 0.6f;

			public static float firingBaseDuration = 0.2f;

			public float duration;

			public int step;

			public float fireInterval;

			public float fireTimer;

			public List<Vector3> rootPositions;

			public int rootsFired = 0;

			void IStepSetter.SetStep(int i)
			{
				step = i;
			}

			public override void OnEnter()
			{
				//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_009b: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d1: Expected O, but got Unknown
				//IL_0100: Unknown result type (might be due to invalid IL or missing references)
				//IL_0105: Unknown result type (might be due to invalid IL or missing references)
				//IL_0107: Unknown result type (might be due to invalid IL or missing references)
				//IL_010c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0110: Unknown result type (might be due to invalid IL or missing references)
				//IL_0115: Unknown result type (might be due to invalid IL or missing references)
				//IL_012b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0131: Unknown result type (might be due to invalid IL or missing references)
				//IL_0133: Unknown result type (might be due to invalid IL or missing references)
				//IL_0138: Unknown result type (might be due to invalid IL or missing references)
				//IL_013d: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_015e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0160: Unknown result type (might be due to invalid IL or missing references)
				//IL_0167: Unknown result type (might be due to invalid IL or missing references)
				//IL_016c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0171: Unknown result type (might be due to invalid IL or missing references)
				//IL_0176: Unknown result type (might be due to invalid IL or missing references)
				//IL_018a: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
				((BaseState)this).OnEnter();
				duration = baseDuration / ((BaseState)this).attackSpeedStat;
				float num = firingBaseDuration / ((BaseState)this).attackSpeedStat;
				Util.PlayAttackSpeedSound("Play_treeBot_R_yank", ((EntityState)this).gameObject, 1.8f);
				((EntityState)this).PlayAnimation("Gesture, Additive", "FireBomb", "FireBomb.playbackRate", num);
				if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)this).healthComponent))
				{
					((EntityState)this).healthComponent.TakeDamage(new DamageInfo
					{
						damage = ((EntityState)this).healthComponent.combinedHealth * ConfigurableValue<float>.op_Implicit(hpCost) / 100f,
						position = ((EntityState)this).characterBody.corePosition,
						attacker = null,
						inflictor = null,
						damageType = (DamageType)3,
						procCoefficient = 0f
					});
				}
				if (!((EntityState)this).isAuthority)
				{
					return;
				}
				fireInterval = num / (float)rootCount;
				rootPositions = new List<Vector3>();
				Vector3 footPosition = ((EntityState)this).characterBody.footPosition;
				Ray aimRay = ((BaseState)this).GetAimRay();
				Vector3 direction = ((Ray)(ref aimRay)).direction;
				direction.y = 0f;
				((Vector3)(ref direction)).Normalize();
				Vector3 val = footPosition + distanceInitial * direction;
				bool flag = false;
				float num2 = 20f;
				RaycastHit val2 = default(RaycastHit);
				for (int i = 0; i < rootCount; i++)
				{
					if (!flag)
					{
						if (Physics.Raycast(new Ray(val + Vector3.up * num2, Vector3.down), ref val2, num2 + floorMaxDistance, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1))
						{
							val = ((RaycastHit)(ref val2)).point;
						}
						else
						{
							flag = true;
						}
					}
					rootPositions.Add(val);
					val += distanceBetweenRoots * direction;
				}
			}

			public override void FixedUpdate()
			{
				((EntityState)this).FixedUpdate();
				if (!((EntityState)this).isAuthority)
				{
					return;
				}
				if (rootsFired < rootCount)
				{
					fireTimer -= Time.fixedDeltaTime;
					while (fireTimer <= 0f)
					{
						fireTimer += fireInterval;
						FireRootAuthority();
					}
				}
				if (((EntityState)this).fixedAge >= duration)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}

			public void FireRootAuthority()
			{
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Unknown result type (might be due to invalid IL or missing references)
				//IL_0047: Unknown result type (might be due to invalid IL or missing references)
				//IL_004f: 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_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_006b: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
				//IL_00da: Unknown result type (might be due to invalid IL or missing references)
				//IL_00df: 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_00e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fd: Expected O, but got Unknown
				Vector3 val = rootPositions[rootsFired % rootPositions.Count];
				Vector3 val2 = Quaternion.AngleAxis(RoR2Application.rng.RangeFloat(0f, 360f), Vector3.up) * Vector3.forward;
				ProjectileManager.instance.FireProjectile(new FireProjectileInfo
				{
					projectilePrefab = projectilePrefab,
					position = val,
					rotation = Util.QuaternionSafeLookRotation(val2),
					damage = ConfigurableValue<float>.op_Implicit(damage) / 100f * ((BaseState)this).damageStat,
					crit = ((EntityState)this).characterBody.RollCrit(),
					force = 0f,
					owner = ((EntityState)this).gameObject
				});
				if (Object.op_Implicit((Object)(object)rootSpawnEffectPrefab))
				{
					EffectManager.SpawnEffect(rootSpawnEffectPrefab, new EffectData
					{
						origin = val,
						rotation = Util.QuaternionSafeLookRotation(Vector3.up)
					}, true);
				}
				rootsFired++;
			}

			public override InterruptPriority GetMinimumInterruptPriority()
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				return (InterruptPriority)1;
			}
		}

		public static ConfigurableValue<float> damage = ConfigurableValue.CreateFloat("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, "REX: Uprooting", "Damage", 240f, 0f, 1000f, "", new List<string> { "TREEBOT_SKILLSMAS_SPIKYROOTS_DESCRIPTION" }, SkillsmasPlugin.ignoreBalanceConfig.bepinexConfigEntry, false, (Action<float>)null);

		public static ConfigurableValue<float> procCoefficient;

		public static ConfigurableValue<float> hpCost = ConfigurableValue.CreateFloat("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, "REX: Uprooting", "HP Cost", 10f, 0f, 1000f, "", new List<string> { "TREEBOT_SKILLSMAS_SPIKYROOTS_DESCRIPTION" }, SkillsmasPlugin.ignoreBalanceConfig.bepinexConfigEntry, false, (Action<float>)null);

		public static ConfigurableValue<float> healing;

		public static GameObject projectilePrefab;

		public static GameObject rootSpawnEffectPrefab;

		public override void OnPluginAwake()
		{
			((BaseLoadableAsset)this).OnPluginAwake();
			projectilePrefab = Utils.CreateBlankPrefab("Skillsmas_SpikyRootsProjectile", true);
			projectilePrefab.GetComponent<NetworkIdentity>().localPlayerAuthority = true;
		}

		public override Type GetSkillDefType()
		{
			return typeof(SteppedSkillDef);
		}

		public override void OnLoad()
		{
			//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_009b: 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_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0412: Unknown result type (might be due to invalid IL or missing references)
			//IL_0417: Unknown result type (might be due to invalid IL or missing references)
			//IL_0529: Unknown result type (might be due to invalid IL or missing references)
			//IL_052e: Unknown result type (might be due to invalid IL or missing references)
			skillDef.skillName = "Skillsmas_SpikyRoots";
			skillDef.skillNameToken = "TREEBOT_SKILLSMAS_SPIKYROOTS_NAME";
			skillDef.skillDescriptionToken = "TREEBOT_SKILLSMAS_SPIKYROOTS_DESCRIPTION";
			skillDef.keywordTokens = new string[1] { "KEYWORD_PERCENT_HP" };
			skillDef.icon = SkillsmasPlugin.AssetBundle.LoadAsset<Sprite>("Assets/Mods/Skillsmas/SkillIcons/Uprooting.png");
			skillDef.activationStateMachineName = "Weapon";
			skillDef.activationState = new SerializableEntityStateType(typeof(FireRoot));
			skillDef.interruptPriority = (InterruptPriority)0;
			SetUpValuesAndOptions("REX: Uprooting", 0f, 1, 1, 1, 1, cancelSprintingOnActivation: true, forceSprintDuringState: false, canceledFromSprinting: false, isCombatSkill: true, mustKeyPress: false);
			skillDef.resetCooldownTimerOnUse = false;
			skillDef.fullRestockOnAssign = true;
			skillDef.dontAllowPastMaxStocks = false;
			skillDef.beginSkillCooldownOnSkillEnd = false;
			SkillDef obj = skillDef;
			SteppedSkillDef val = (SteppedSkillDef)(object)((obj is SteppedSkillDef) ? obj : null);
			val.stepCount = 3;
			val.stepGraceDuration = 60f;
			SkillFamily val2 = Addressables.LoadAssetAsync<SkillFamily>((object)"RoR2/Base/Treebot/TreebotBodyPrimaryFamily.asset").WaitForCompletion();
			ArrayUtils.ArrayAppend<Variant>(ref val2.variants, ref skillFamilyVariant);
			SkillsmasContent.Resources.entityStateTypes.Add(typeof(FireRoot));
			GameObject val3 = SkillsmasPlugin.AssetBundle.LoadAsset<GameObject>("Assets/Mods/Skillsmas/Skills/REX/SpikyRoots/SpikyRootGhost.prefab");
			val3.AddComponent<ProjectileGhostController>();
			ObjectTransformCurve val4 = ((Component)val3.transform.Find("Pivot")).gameObject.AddComponent<ObjectTransformCurve>();
			val4.translationCurveX = AnimationCurve.Constant(0f, 1f, 0f);
			val4.translationCurveY = AnimationCurve.EaseInOut(0f, -9f, 1f, 0f);
			val4.translationCurveZ = AnimationCurve.Constant(0f, 1f, 0f);
			val4.useTranslationCurves = true;
			val4.useRotationCurves = false;
			val4.loop = false;
			val4.timeMax = 0.17f;
			ObjectScaleCurve val5 = ((Component)val3.transform.Find("Pivot/Scaler")).gameObject.AddComponent<ObjectScaleCurve>();
			val5.useOverallCurveOnly = false;
			val5.curveX = AnimationCurve.EaseInOut(0.8f, 1f, 1f, 0f);
			val5.curveY = AnimationCurve.EaseInOut(0.5f, 1f, 1f, 0.3f);
			val5.curveZ = AnimationCurve.EaseInOut(0.8f, 1f, 1f, 0f);
			val5.overallCurve = AnimationCurve.Constant(0f, 1f, 1f);
			val5.timeMax = 0.4f;
			Utils.CopyChildren(SkillsmasPlugin.AssetBundle.LoadAsset<GameObject>("Assets/Mods/Skillsmas/Skills/REX/SpikyRoots/SpikyRootProjectile.prefab"), projectilePrefab, true);
			ProjectileController projectileController = projectilePrefab.AddComponent<ProjectileController>();
			projectileController.allowPrediction = true;
			projectileController.ghostPrefab = val3;
			procCoefficient = ConfigurableValue.CreateFloat("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, "REX: Uprooting", "Proc Coefficient", 1f, 0f, 1000f, "", (List<string>)null, SkillsmasPlugin.ignoreBalanceConfig.bepinexConfigEntry, false, (Action<float>)delegate(float newValue)
			{
				projectileController.procCoefficient = newValue;
			});
			projectilePrefab.AddComponent<ProjectileNetworkTransform>();
			ProjectileSimple val6 = projectilePrefab.AddComponent<ProjectileSimple>();
			val6.desiredForwardSpeed = 0f;
			val6.lifetime = 0.4f;
			ProjectileDamage val7 = projectilePrefab.AddComponent<ProjectileDamage>();
			HitBoxGroup val8 = projectilePrefab.AddComponent<HitBoxGroup>();
			val8.groupName = "Root";
			val8.hitBoxes = (HitBox[])(object)new HitBox[2]
			{
				((Component)projectilePrefab.transform.Find("HitBox")).gameObject.AddComponent<HitBox>(),
				((Component)projectilePrefab.transform.Find("HitBox (1)")).gameObject.AddComponent<HitBox>()
			};
			ProjectileOverlapAttack val9 = projectilePrefab.AddComponent<ProjectileOverlapAttack>();
			val9.damageCoefficient = 1f;
			val9.resetInterval = -1f;
			val9.overlapProcCoefficient = 1f;
			val9.fireFrequency = 20f;
			val9.impactEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Treebot/OmniImpactVFXSlashSyringe.prefab").WaitForCompletion();
			SkillsmasProjectileHealOwnerOnDamageInflicted healOwner = projectilePrefab.AddComponent<SkillsmasProjectileHealOwnerOnDamageInflicted>();
			healOwner.maxInstancesOfHealing = 1;
			ProjectileInflictTimedBuff inflictTimedBuff = projectilePrefab.AddComponent<ProjectileInflictTimedBuff>();
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate
			{
				inflictTimedBuff.buffDef = Buffs.Entangle;
			});
			inflictTimedBuff.duration = 0.5f;
			SkillsmasProjectileSoundAdder skillsmasProjectileSoundAdder = projectilePrefab.AddComponent<SkillsmasProjectileSoundAdder>();
			skillsmasProjectileSoundAdder.projectileOverlapAttack = val9;
			skillsmasProjectileSoundAdder.impactSoundEventDef = ScriptableObject.CreateInstance<NetworkSoundEventDef>();
			skillsmasProjectileSoundAdder.impactSoundEventDef.eventName = "Play_treeBot_m1_impact";
			SkillsmasContent.Resources.networkSoundEventDefs.Add(skillsmasProjectileSoundAdder.impactSoundEventDef);
			healing = ConfigurableValue.CreateFloat("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, "REX: Uprooting", "Healing", 5f, 0f, 1000f, "", (List<string>)null, SkillsmasPlugin.ignoreBalanceConfig.bepinexConfigEntry, false, (Action<float>)delegate(float newValue)
			{
				healOwner.fractionalHealing = newValue / 100f;
			});
			SkillsmasContent.Resources.projectilePrefabs.Add(projectilePrefab);
			rootSpawnEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Treebot/TreebotMortarMuzzleflash.prefab").WaitForCompletion();
		}
	}
	public class WalkingHealer : BaseSkill
	{
		public class WalkingHealerState : GenericCharacterMain
		{
			public static GameObject rangeIndicatorPrefab;

			public static LoopSoundDef loopSoundDef;

			public float duration;

			public SoundLoopPtr soundLoopPtr;

			public SphereSearch allySearch;

			public TeamMask teamMask;

			public Transform rangeIndicator;

			public float rangeIndicatorScaleVelocity;

			public float currentRadius;

			public float healInterval = 0.25f;

			public float healTimer;

			public override void OnEnter()
			{
				//IL_0035: 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_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_007c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0088: Unknown result type (might be due to invalid IL or missing references)
				//IL_008a: Unknown result type (might be due to invalid IL or missing references)
				//IL_008f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0095: 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_00a4: Expected O, but got Unknown
				//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
				((GenericCharacterMain)this).OnEnter();
				duration = ConfigurableValue<float>.op_Implicit(WalkingHealer.duration);
				Util.PlaySound("Play_treeBot_R_impact", ((EntityState)this).gameObject);
				soundLoopPtr = LoopSoundManager.PlaySoundLoopLocal(((EntityState)this).gameObject, loopSoundDef);
				((EntityState)this).PlayAnimation("Gesture, Additive", "FireFlower", "FireFlower.playbackRate", 1f);
				currentRadius = ConfigurableValue<float>.op_Implicit(radius) + ((EntityState)this).characterBody.bestFitRadius;
				allySearch = new SphereSearch
				{
					radius = currentRadius,
					queryTriggerInteraction = (QueryTriggerInteraction)1,
					mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask
				};
				((TeamMask)(ref teamMask)).AddTeam(((EntityState)this).teamComponent.teamIndex);
				rangeIndicator = Object.Instantiate<GameObject>(rangeIndicatorPrefab, ((EntityState)this).characterBody.corePosition, Quaternion.identity).transform;
			}

			public override void Update()
			{
				//IL_0029: 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_0064: Unknown result type (might be due to invalid IL or missing references)
				((GenericCharacterMain)this).Update();
				if (Object.op_Implicit((Object)(object)rangeIndicator))
				{
					((Component)rangeIndicator).transform.position = ((EntityState)this).transform.position;
					float num = Mathf.SmoothDamp(rangeIndicator.localScale.x, currentRadius, ref rangeIndicatorScaleVelocity, 0.2f);
					rangeIndicator.localScale = new Vector3(num, num, num);
				}
			}

			public override void FixedUpdate()
			{
				((GenericCharacterMain)this).FixedUpdate();
				if (NetworkServer.active)
				{
					healTimer -= Time.fixedDeltaTime;
					if (healTimer <= 0f)
					{
						healTimer += healInterval;
						Heal();
					}
				}
				if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}

			public void Heal()
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0047: 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_008d: Unknown result type (might be due to invalid IL or missing references)
				allySearch.origin = ((EntityState)this).characterBody.corePosition;
				allySearch.radius = currentRadius;
				allySearch.RefreshCandidates();
				allySearch.FilterCandidatesByDistinctHurtBoxEntities();
				allySearch.FilterCandidatesByHurtBoxTeam(teamMask);
				HurtBox[] hurtBoxes = allySearch.GetHurtBoxes();
				foreach (HurtBox val in hurtBoxes)
				{
					val.healthComponent.HealFraction(ConfigurableValue<float>.op_Implicit(healing) / 100f * healInterval, default(ProcChainMask));
				}
			}

			public override void OnExit()
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				LoopSoundManager.StopSoundLoopLocal(soundLoopPtr);
				Util.PlaySound("Play_treeBot_sprint_end", ((EntityState)this).gameObject);
				((EntityState)this).PlayAnimation("Gesture, Additive", "FireFlower", "FireFlower.playbackRate", 1f);
				if (Object.op_Implicit((Object)(object)rangeIndicator))
				{
					EntityState.Destroy((Object)(object)((Component)rangeIndicator).gameObject);
				}
				((GenericCharacterMain)this).OnExit();
			}

			public override bool CanExecuteSkill(GenericSkill skillSlot)
			{
				return false;
			}

			public override InterruptPriority GetMinimumInterruptPriority()
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				return (InterruptPriority)3;
			}
		}

		public static ConfigurableValue<float> duration = ConfigurableValue.CreateFloat("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, "REX: DIRECTIVE: Stimulate", "Duration", 8f, 0f, 1000f, "", new List<string> { "TREEBOT_SKILLSMAS_WALKINGHEALER_DESCRIPTION" }, SkillsmasPlugin.ignoreBalanceConfig.bepinexConfigEntry, false, (Action<float>)null);

		public static ConfigurableValue<float> healing = ConfigurableValue.CreateFloat("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, "REX: DIRECTIVE: Stimulate", "Healing", 20f, 0f, 1000f, "", new List<string> { "TREEBOT_SKILLSMAS_WALKINGHEALER_DESCRIPTION" }, SkillsmasPlugin.ignoreBalanceConfig.bepinexConfigEntry, false, (Action<float>)null);

		public static ConfigurableValue<float> radius = ConfigurableValue.CreateFloat("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, "REX: DIRECTIVE: Stimulate", "Radius", 13f, 0f, 1000f, "", (List<string>)null, SkillsmasPlugin.ignoreBalanceConfig.bepinexConfigEntry, false, (Action<float>)null);

		public override void OnLoad()
		{
			//IL_0084: 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_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			skillDef.skillName = "Skillsmas_WalkingHealer";
			skillDef.skillNameToken = "TREEBOT_SKILLSMAS_WALKINGHEALER_NAME";
			skillDef.skillDescriptionToken = "TREEBOT_SKILLSMAS_WALKINGHEALER_DESCRIPTION";
			skillDef.keywordTokens = new string[1] { "KEYWORD_SKILLSMAS_HARMLESS" };
			skillDef.icon = SkillsmasPlugin.AssetBundle.LoadAsset<Sprite>("Assets/Mods/Skillsmas/SkillIcons/DirectiveStimulate.png");
			skillDef.activationStateMachineName = "Weapon";
			skillDef.activationState = new SerializableEntityStateType(typeof(WalkingHealerState));
			skillDef.interruptPriority = (InterruptPriority)1;
			SetUpValuesAndOptions("REX: DIRECTIVE: Stimulate", 12f, 1, 1, 1, 1, cancelSprintingOnActivation: false, forceSprintDuringState: false, canceledFromSprinting: false, isCombatSkill: false, mustKeyPress: true);
			skillDef.resetCooldownTimerOnUse = false;
			skillDef.fullRestockOnAssign = true;
			skillDef.dontAllowPastMaxStocks = false;
			skillDef.beginSkillCooldownOnSkillEnd = true;
			SkillFamily val = Addressables.LoadAssetAsync<SkillFamily>((object)"RoR2/Base/Treebot/TreebotBodySpecialFamily.asset").WaitForCompletion();
			ArrayUtils.ArrayAppend<Variant>(ref val.variants, ref skillFamilyVariant);
			SkillsmasContent.Resources.entityStateTypes.Add(typeof(WalkingHealerState));
			WalkingHealerState.rangeIndicatorPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ShrineHealing/ShrineHealingWard.prefab").WaitForCompletion(), "Skillsmas_WalkingHealerRangeIndicator", false);
			Object.Destroy((Object)(object)WalkingHealerState.rangeIndicatorPrefab.GetComponent<HealingWard>());
			Object.Destroy((Object)(object)WalkingHealerState.rangeIndicatorPrefab.GetComponent<TeamFilter>());
			Object.Destroy((Object)(object)WalkingHealerState.rangeIndicatorPrefab.GetComponent<NetworkIdentity>());
			WalkingHealerState.loopSoundDef = ScriptableObject.CreateInstance<LoopSoundDef>();
			WalkingHealerState.loopSoundDef.startSoundName = "Play_miniMushroom_selfHeal_loop";
			WalkingHealerState.loopSoundDef.stopSoundName = "Stop_miniMushroom_selfHeal_loop";
		}
	}
}
namespace Skillsmas.Skills.Toolbot
{
	public class Crate : BaseSkill
	{
		public class SkillsmasCrateController : MonoBehaviour
		{
			public Rigidbody rigidbody;

			public ProjectileOverlapAttack overlapAttack;

			public Collider disabledCollider;

			public float disabledColliderDuration = 0.1f;

			public void Awake()
			{
				rigidbody = ((Component)this).GetComponent<Rigidbody>();
				overlapAttack = ((Component)this).GetComponent<ProjectileOverlapAttack>();
			}

			public void FixedUpdate()
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				Vector3 velocity = rigidbody.velocity;
				bool enabled = ((Vector3)(ref velocity)).sqrMagnitude >= 25f;
				((Behaviour)overlapAttack).enabled = enabled;
				if (Object.op_Implicit((Object)(object)disabledCollider) && disabledColliderDuration > 0f)
				{
					disabledColliderDuration -= Time.fixedDeltaTime;
					if (disabledColliderDuration <= 0f)
					{
						disabledCollider.enabled = true;
					}
				}
			}
		}

		public class AimCrate : AimThrowableBase
		{
			public override void OnEnter()
			{
				//IL_009e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0086: Unknown result type (might be due to invalid IL or missing references)
				//IL_0091: Unknown result type (might be due to invalid IL or missing references)
				((EntityState)(object)this).LoadConfiguration(typeof(AimStunDrone));
				base.maxDistance = 20f;
				base.rayRadius = 0f;
				base.endpointVisualizerRadiusScale = 0f;
				base.damageCoefficient = ConfigurableValue<float>.op_Implicit(damage) / 100f;
				base.baseMinimumDuration = 0.25f;
				base.projectilePrefab = crateProjectilePrefab;
				((AimThrowableBase)this).OnEnter();
				base.detonationRadius = 3f;
				if (Object.op_Implicit((Object)(object)base.endpointVisualizerTransform))
				{
					base.endpointVisualizerTransform.localScale = Vector3.one * base.detonationRadius;
				}
				((AimThrowableBase)this).UpdateVisualizers(base.currentTrajectoryInfo);
				Util.PlaySound("Play_MULT_m2_aim", ((EntityState)this).gameObject);
				((EntityState)this).PlayAnimation("Gesture, Additive", "PrepBomb", "PrepBomb.playbackRate", base.minimumDuration);
				((EntityState)this).PlayAnimation("Stance, Override", "PutAwayGun");
			}

			public override void OnExit()
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				((EntityState)this).outer.SetNextState((EntityState)new RecoverAimStunDrone());
				Util.PlaySound("Play_MULT_m2_throw", ((EntityState)this).gameObject);
				((AimThrowableBase)this).OnExit();
			}

			public override InterruptPriority GetMinimumInterruptPriority()
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				return (InterruptPriority)2;
			}
		}

		public static GameObject crateProjectilePrefab;

		public static GameObject crateGhostPrefab;

		public static ConfigurableValue<float> damage = ConfigurableValue.CreateFloat("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, "MUL-T: Shipping Crate", "Damage", 400f, 0f, 1000f, "", new List<string> { "TOOLBOT_SKILLSMAS_CRATE_DESCRIPTION" }, SkillsmasPlugin.ignoreBalanceConfig.bepinexConfigEntry, false, (Action<float>)null);

		public static ConfigurableValue<float> pushPower = ConfigurableValue.CreateFloat("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, "MUL-T: Shipping Crate", "Push Power", 1f, 0f, 5f, "Crates can be pushed by attacks. Increase or decrease this to adjust how strongly they should be pushed.", (List<string>)null, SkillsmasPlugin.ignoreBalanceConfig.bepinexConfigEntry, false, (Action<float>)null);

		public static ConfigurableValue<float> lifetime;

		public override void OnPluginAwake()
		{
			((BaseLoadableAsset)this).OnPluginAwake();
			crateProjectilePrefab = Utils.CreateBlankPrefab("Skillsmas_CrateProjectile", true);
			crateProjectilePrefab.GetComponent<NetworkIdentity>().localPlayerAuthority = true;
			crateProjectilePrefab.AddComponent<NetworkTransform>();
		}

		public override void OnLoad()
		{
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_034a: Unknown result type (might be due to invalid IL or missing references)
			//IL_034f: Unknown result type (might be due to invalid IL or missing references)
			//IL_03de: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_046d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0477: Expected O, but got Unknown
			skillDef.skillName = "Skillsmas_Crate";
			skillDef.skillNameToken = "TOOLBOT_SKILLSMAS_CRATE_NAME";
			skillDef.skillDescriptionToken = "TOOLBOT_SKILLSMAS_CRATE_DESCRIPTION";
			skillDef.icon = SkillsmasPlugin.AssetBundle.LoadAsset<Sprite>("Assets/Mods/Skillsmas/SkillIcons/Crate.jpg");
			skillDef.activationStateMachineName = "Weapon";
			skillDef.activationState = new SerializableEntityStateType(typeof(AimCrate));
			skillDef.interruptPriority = (InterruptPriority)1;
			SetUpValuesAndOptions("MUL-T: Shipping Crate", 6f, 1, 1, 1, 1, cancelSprintingOnActivation: true, forceSprintDuringState: false, canceledFromSprinting: false, isCombatSkill: true, mustKeyPress: true);
			skillDef.resetCooldownTimerOnUse = false;
			skillDef.fullRestockOnAssign = true;
			skillDef.dontAllowPastMaxStocks = false;
			skillDef.beginSkillCooldownOnSkillEnd = true;
			SkillFamily val = Addressables.LoadAssetAsync<SkillFamily>((object)"RoR2/Base/Toolbot/ToolbotBodySecondaryFamily.asset").WaitForCompletion();
			ArrayUtils.ArrayAppend<Variant>(ref val.variants, ref skillFamilyVariant);
			SkillsmasContent.Resources.entityStateTypes.Add(typeof(AimCrate));
			crateGhostPrefab = SkillsmasPlugin.AssetBundle.LoadAsset<GameObject>("Assets/Mods/Skillsmas/Skills/MUL-T/Crate/CrateGhost.prefab");
			crateGhostPrefab.AddComponent<ProjectileGhostController>();
			GameObject val2 = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Toolbot/RoboCratePod.prefab").WaitForCompletion(), "Skillsmas_TempCrateCopy");
			Transform val3 = val2.transform.Find("Base/mdlRoboCrate/Base/RobotCrateMesh");
			Object.Destroy((Object)(object)val2);
			((Component)crateGhostPrefab.transform.Find("Mesh")).GetComponent<MeshFilter>().sharedMesh = ((Component)val3).GetComponent<MeshFilter>().sharedMesh;
			((Renderer)((Component)crateGhostPrefab.transform.Find("Mesh")).GetComponent<MeshRenderer>()).sharedMaterial = ((Renderer)((Component)val3).GetComponent<MeshRenderer>()).sharedMaterial;
			Utils.CopyChildren(SkillsmasPlugin.AssetBundle.LoadAsset<GameObject>("Assets/Mods/Skillsmas/Skills/MUL-T/Crate/CrateProjectile.prefab"), crateProjectilePrefab, true);
			ProjectileController val4 = crateProjectilePrefab.AddComponent<ProjectileController>();
			val4.ghostPrefab = crateGhostPrefab;
			val4.allowPrediction = true;
			ProjectileNetworkTransform val5 = crateProjectilePrefab.AddComponent<ProjectileNetworkTransform>();
			val5.allowClientsideCollision = true;
			crateProjectilePrefab.AddComponent<TeamFilter>();
			ProjectileSimple projectileSimple = crateProjectilePrefab.AddComponent<ProjectileSimple>();
			projectileSimple.desiredForwardSpeed = 20f;
			lifetime = ConfigurableValue.CreateFloat("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, "MUL-T: Shipping Crate", "Lifetime", 600f, 0f, 1000f, "", (List<string>)null, SkillsmasPlugin.ignoreBalanceConfig.bepinexConfigEntry, false, (Action<float>)delegate(float newValue)
			{
				projectileSimple.lifetime = newValue;
			});
			ProjectileDamage val6 = crateProjectilePrefab.AddComponent<ProjectileDamage>();
			HitBoxGroup val7 = crateProjectilePrefab.AddComponent<HitBoxGroup>();
			val7.hitBoxes = (HitBox[])(object)new HitBox[1] { ((Component)crateProjectilePrefab.transform.Find("HitBox")).gameObject.AddComponent<HitBox>() };
			ProjectileOverlapAttack projectileOverlapAttack = crateProjectilePrefab.AddComponent<ProjectileOverlapAttack>();
			projectileOverlapAttack.damageCoefficient = 1f;
			ConfigurableValue.CreateFloat("com.themysticsword.skillsmas", "Skillsmas", SkillsmasPlugin.config, "MUL-T: Shipping Crate", "Proc Coefficient", 1f, 0f, 1000f, "", (List<string>)null, SkillsmasPlugin.ignoreBalanceConfig.bepinexConfigEntry, false, (Action<float>)delegate(float newValue)
			{
				projectileOverlapAttack.overlapProcCoefficient = newValue;
			});
			projectileOverlapAttack.resetInterval = 10f;
			projectileOverlapAttack.impactEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Toolbot/ImpactToolbotDash.prefab").WaitForCompletion();
			SkillsmasCrateController skillsmasCrateController = crateProjectilePrefab.AddComponent<SkillsmasCrateController>();
			((Component)crateProjectilePrefab.transform.Find("Collider")).gameObject.AddComponent<EntityLocator>().entity = crateProjectilePrefab;
			((Component)crateProjectilePrefab.transform.Find("Collider/ProjectileBlockingCollider")).gameObject.AddComponent<EntityLocator>().entity = crateProjectilePrefab;
			skillsmasCrateController.disabledCollider = ((Component)crateProjectilePrefab.transform.Find("Collider")).GetComponent<Collider>();
			SurfaceDef surfaceDef = Addressables.LoadAssetAsync<SurfaceDef>((object)"RoR2/Base/Common/sdMetal.asset").WaitForCompletion();
			Collider[] componentsInChildren = ((Component)crateProjectilePrefab.transform.Find("Collider")).GetComponentsInChildren<Collider>();
			foreach (Collider val8 in componentsInChildren)
			{
				SurfaceDefProvider component = ((Component)val8).GetComponent<SurfaceDefProvider>();
				if (!((Object)(object)component != (Object)null))
				{
					component = ((Component)val8).gameObject.AddComponent<SurfaceDefProvider>();
					component.surfaceDef = surfaceDef;
				}
			}
			SkillsmasContent.Resources.projectilePrefabs.Add(crateProjectilePrefab);
			GlobalEventManager.OnHitAll += new hook_OnHitAll(GlobalEventManager_OnHitAll);
		}

		private void GlobalEventManager_OnHitAll(orig_OnHitAll orig, GlobalEventManager self, DamageInfo damageInfo, GameObject hitObject)
		{
			//IL_0046: 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)
			orig.Invoke(self, damageInfo, hitObject);
			if (!Object.op_Implicit((Object)(object)hitObject))
			{
				return;
			}
			GameObject entity = EntityLocator.GetEntity(hitObject);
			if (Object.op_Implicit((Object)(object)entity))
			{
				SkillsmasCrateController component = entity.GetComponent<SkillsmasCrateController>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.rigidbody.AddForce(damageInfo.force * ConfigurableValue<float>.op_Implicit(pushPower), (ForceMode)1);
				}
			}
		}
	}
	public class RobotUpdate : BaseSkill
	{
		public class ToolbotUpdating : BaseCharacterMain
		{
			public static GameObject startEffectPrefab;

			public static GameObject endEffectPrefab;

			public float duration;

			public Vector3 idealDirection;

			public uint soundID;

			public bool buffGranted = false;

			public override void OnEnter()
			{
				//IL_00db: Unknown result type (might be due to invalid IL or missing references)
				//IL_0083: Unknown result type (might be due to invalid IL or missing references)
				//IL_0088: Unknown result type (might be due to invalid IL or missing references)
				//IL_010c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0111: Unknown result type (might be due to invalid IL or missing references)
				//IL_0118: Unknown result type (might be due to invalid IL or missing references)
				//IL_0129: Expected O, but got Unknown
				((BaseCharacterMain)this).OnEnter();
				duration = ConfigurableValue<float>.op_Implicit(updateDuration);
				if (((EntityState)this).isAuthority)
				{
					EntityStateMachine val = EntityStateMachine.FindByCustomName(((EntityState)this).gameObject, "Weapon");
					if (Object.op_Implicit((Object)(object)val))
					{
						val.SetNextStateToMain();
					}
					val = EntityStateMachine.FindByCustomName(((EntityState)this).gameObject, "Weapon2");
					if (Object.op_Implicit((Object)(object)val))
					{
						val.SetNextStateToMain();
					}
					if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
					{
						idealDirection = ((EntityState)this).inputBank.aimDirection;
						idealDirection.y = 0f;
					}
					UpdateDirection();
				}
				if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator))
				{
					((EntityState)this).modelLocator.normalizeToFloor = true;
				}
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
				{
					((EntityState)this).characterDirection.forward = idealDirection;
				}
				if (Object.op_Implicit((Object)(object)startEffectPrefab) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
				{
					EffectManager.SpawnEffect(startEffectPrefab, new EffectData
					{
						origin = ((EntityState)this).characterBody.corePosition
					}, false);
				}
				soundID = Util.PlaySound("Play_MULT_shift_start", ((EntityState)this).gameObject);
				((EntityState)this).PlayCrossfade("Body", "BoxModeEnter", 0.1f);
				((EntityState)this).PlayCrossfade("Stance, Override", "PutAwayGun", 0.1f);
				((BaseCharacterMain)this).modelAnimator.SetFloat("aimWeight", 0f);
			}

			public override void FixedUpdate()
			{
				//IL_008b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0091: Unknown result type (might be due to invalid IL or missing references)
				//IL_0152: Unknown result type (might be due to invalid IL or missing references)
				//IL_0157: Unknown result type (might be due to invalid IL or missing references)
				//IL_0188: Unknown result type (might be due to invalid IL or missing references)
				//IL_018e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0198: Unknown result type (might be due to invalid IL or missing references)
				//IL_019d: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
				((BaseCharacterMain)this).FixedUpdate();
				if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
				{
					if (!buffGranted)
					{
						buffGranted = true;
						if (NetworkServer.active)
						{
							if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody.healthComponent))
							{
								((EntityState)this).characterBody.healthComponent.Heal(ConfigurableValue<float>.op_Implicit(healing) / 100f * ((EntityState)this).characterBody.healthComponent.fullHealth, default(ProcChainMask), true);
							}
							((EntityState)this).characterBody.AddTimedBuff(SkillsmasContent.Buffs.Skillsmas_ToolbotUpdated, ConfigurableValue<float>.op_Implicit(buffDuration));
						}
					}
					((EntityState)this).outer.SetNextStateToMain();
				}
				else
				{
					if (!((EntityState)this).isAuthority)
					{
						return;
					}
					if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
					{
						((EntityState)this).characterBody.isSprinting = false;
					}
					if (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.special) && ((EntityState)this).inputBank.skill4.down)
					{
						((EntityState)this).skillLocator.special.ExecuteIfReady();
					}
					UpdateDirection();
					if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
					{
						((EntityState)this).characterDirection.moveVector = idealDirection;
						if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.disableAirControlUntilCollision)
						{
							CharacterMotor characterMotor = ((EntityState)this).characterMotor;
							characterMotor.rootMotion += GetIdealVelocity() * Time.fixedDeltaTime;
						}
					}
				}
			}

			public void UpdateDirection()
			{
				//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_0021: Unknown result type (might be due to invalid IL or missing references)
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0046: Unknown result type (might be due to invalid IL or missing references)
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_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)
				if (Obje