Decompiled source of SpaceMarine v1.0.1

SpaceMarine.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using EntityStates;
using EntityStates.Commando;
using EntityStates.Merc;
using EntityStates.Toolbot;
using KinematicCharacterController;
using On.RoR2;
using R2API;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("SpaceMarine")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SpaceMarine")]
[assembly: AssemblyTitle("SpaceMarine")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace SpaceMarine;

internal class Assets
{
	public static AssetBundle MainAssetBundle;

	public static T Load<T>(string name) where T : Object
	{
		return MainAssetBundle.LoadAsset<T>(name);
	}

	public static void PopulateAssets()
	{
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		if ((Object)(object)MainAssetBundle == (Object)null)
		{
			using Stream stream = executingAssembly.GetManifestResourceStream("SpaceMarine.AssetBundle." + "SpaceMarine".ToLower() + "assets");
			MainAssetBundle = AssetBundle.LoadFromStream(stream);
		}
		using Stream stream2 = executingAssembly.GetManifestResourceStream("SpaceMarine.SpaceMarine.bnk");
		byte[] array = new byte[stream2.Length];
		stream2.Read(array, 0, array.Length);
		SoundBanks.Add(array);
	}
}
internal class CrosshairBehaviour : CrosshairController
{
	private InputBankTest input;

	public GameObject off;

	public GameObject on;

	private void Start()
	{
		HudElement component = ((Component)this).GetComponent<HudElement>();
		if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.targetBodyObject))
		{
			input = component.targetBodyObject.GetComponent<InputBankTest>();
		}
	}

	private void FixedUpdate()
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)input))
		{
			float num = 0f;
			RaycastHit val = default(RaycastHit);
			bool flag = Physics.Raycast(CameraRigController.ModifyAimRayIfApplicable(input.GetAimRay(), ((Component)this).gameObject, ref num), ref val, 250f + num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask));
			off.SetActive(!flag);
			on.SetActive(flag);
		}
	}
}
internal class Hook
{
	internal static void Hooks()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Expected O, but got Unknown
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Expected O, but got Unknown
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
		HealthComponent.TakeDamageForce_DamageInfo_bool_bool += new hook_TakeDamageForce_DamageInfo_bool_bool(HealthComponent_TakeDamageForce_DamageInfo_bool_bool);
		HealthComponent.TakeDamageForce_Vector3_bool_bool += new hook_TakeDamageForce_Vector3_bool_bool(HealthComponent_TakeDamageForce_Vector3_bool_bool);
	}

	private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
	{
		if (sender.HasBuff(Prefabs.speed))
		{
			args.moveSpeedMultAdd += 0.5f;
		}
	}

	private static void HealthComponent_TakeDamageForce_Vector3_bool_bool(orig_TakeDamageForce_Vector3_bool_bool orig, HealthComponent self, Vector3 force, bool alwaysApply, bool disableAirControlUntilCollision)
	{
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(Prefabs.knockback))
		{
			force = Vector3.zero;
			disableAirControlUntilCollision = false;
		}
		orig.Invoke(self, force, alwaysApply, disableAirControlUntilCollision);
	}

	private static void HealthComponent_TakeDamageForce_DamageInfo_bool_bool(orig_TakeDamageForce_DamageInfo_bool_bool orig, HealthComponent self, DamageInfo damageInfo, bool alwaysApply, bool disableAirControlUntilCollision)
	{
		//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)
		if (Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(Prefabs.knockback))
		{
			damageInfo.force = Vector3.zero;
			disableAirControlUntilCollision = false;
		}
		orig.Invoke(self, damageInfo, alwaysApply, disableAirControlUntilCollision);
	}
}
[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.Dragonyck.SpaceMarine", "SpaceMarine", "1.0.0")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class MainPlugin : BaseUnityPlugin
{
	public const string MODUID = "com.Dragonyck.SpaceMarine";

	public const string MODNAME = "SpaceMarine";

	public const string VERSION = "1.0.0";

	public const string SURVIVORNAME = "SpaceMarine";

	public const string SURVIVORNAMEKEY = "SPACEMARINE";

	public static GameObject characterPrefab;

	public static readonly Color characterColor = Color32.op_Implicit(new Color32((byte)11, (byte)125, (byte)172, byte.MaxValue));

	private void Awake()
	{
		Assets.PopulateAssets();
		Prefabs.CreatePrefabs();
		CreatePrefab();
		RegisterStates();
		RegisterCharacter();
		Hook.Hooks();
	}

	internal static void CreatePrefab()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Expected O, but got Unknown
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: 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_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_0128: Expected O, but got Unknown
		//IL_014f: 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_0171: Unknown result type (might be due to invalid IL or missing references)
		//IL_0194: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_0220: Unknown result type (might be due to invalid IL or missing references)
		//IL_0351: Unknown result type (might be due to invalid IL or missing references)
		//IL_0397: Unknown result type (might be due to invalid IL or missing references)
		//IL_039c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0432: Unknown result type (might be due to invalid IL or missing references)
		//IL_0437: Unknown result type (might be due to invalid IL or missing references)
		//IL_0464: Unknown result type (might be due to invalid IL or missing references)
		//IL_0469: Unknown result type (might be due to invalid IL or missing references)
		//IL_0512: Unknown result type (might be due to invalid IL or missing references)
		//IL_0532: Unknown result type (might be due to invalid IL or missing references)
		//IL_053f: Unknown result type (might be due to invalid IL or missing references)
		//IL_05c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_063b: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_09a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_09b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_09da: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b31: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b36: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b59: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b5e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b8c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b91: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoBody.prefab").WaitForCompletion();
		characterPrefab = PrefabAPI.InstantiateClone(val, "SpaceMarineBody", true);
		characterPrefab.GetComponent<NetworkIdentity>().localPlayerAuthority = true;
		Object.Destroy((Object)(object)((Component)characterPrefab.transform.Find("ModelBase")).gameObject);
		Object.Destroy((Object)(object)((Component)characterPrefab.transform.Find("CameraPivot")).gameObject);
		Object.Destroy((Object)(object)((Component)characterPrefab.transform.Find("AimOrigin")).gameObject);
		GameObject val2 = Assets.MainAssetBundle.LoadAsset<GameObject>("marineMdl");
		val2.AddComponent<AnimationEvents>().soundCenter = val2;
		GameObject val3 = new GameObject("ModelBase");
		val3.transform.parent = characterPrefab.transform;
		val3.transform.localPosition = new Vector3(0f, -0.94f, 0f);
		val3.transform.localRotation = Quaternion.identity;
		val3.transform.localScale = Vector3.one * 1.25f;
		GameObject val4 = new GameObject("AimOrigin");
		val4.transform.parent = val3.transform;
		val4.transform.localPosition = new Vector3(0f, 1.6f, 0f);
		val4.transform.localRotation = Quaternion.identity;
		val4.transform.localScale = Vector3.one;
		Transform transform = val2.transform;
		transform.parent = val3.transform;
		transform.localPosition = Vector3.zero;
		transform.localScale = Vector3.one;
		transform.localRotation = Quaternion.identity;
		CharacterDirection component = characterPrefab.GetComponent<CharacterDirection>();
		component.targetTransform = val3.transform;
		component.modelAnimator = val2.GetComponentInChildren<Animator>();
		component.turnSpeed = 720f;
		CharacterBody component2 = characterPrefab.GetComponent<CharacterBody>();
		((Object)component2).name = "SpaceMarineBody";
		component2.baseNameToken = "SPACEMARINE_NAME";
		component2.subtitleNameToken = "SPACEMARINE_SUBTITLE";
		component2.bodyFlags = (BodyFlags)16;
		component2.rootMotionInMainState = false;
		component2.mainRootSpeed = 0f;
		component2.baseMaxHealth = 110f;
		component2.levelMaxHealth = 50f;
		component2.baseRegen = 1.5f;
		component2.levelRegen = 0.2f;
		component2.baseMaxShield = 0f;
		component2.levelMaxShield = 0f;
		component2.baseMoveSpeed = 7f;
		component2.levelMoveSpeed = 0f;
		component2.baseAcceleration = 110f;
		component2.baseJumpPower = 15f;
		component2.levelJumpPower = 0f;
		component2.baseDamage = 12f;
		component2.levelDamage = 2.4f;
		component2.baseAttackSpeed = 1f;
		component2.levelAttackSpeed = 0f;
		component2.baseCrit = 1f;
		component2.levelCrit = 0f;
		component2.baseArmor = 0f;
		component2.levelArmor = 1f;
		component2.baseJumpCount = 1;
		component2.sprintingSpeedMultiplier = 1.45f;
		component2.wasLucky = false;
		component2.hideCrosshair = false;
		component2.aimOriginTransform = val4.transform;
		component2.hullClassification = (HullClassification)0;
		component2.portraitIcon = (Texture)(object)Assets.MainAssetBundle.LoadAsset<Sprite>("portrait").texture;
		component2._defaultCrosshairPrefab = Prefabs.crosshair;
		component2.isChampion = false;
		component2.currentVehicle = null;
		component2.skinIndex = 0u;
		component2.bodyColor = characterColor;
		HealthComponent component3 = characterPrefab.GetComponent<HealthComponent>();
		component3.health = component2.baseMaxHealth;
		component3.shield = 0f;
		component3.barrier = 0f;
		CharacterMotor component4 = characterPrefab.GetComponent<CharacterMotor>();
		component4.walkSpeedPenaltyCoefficient = 1f;
		component4.characterDirection = component;
		component4.muteWalkMotion = false;
		component4.mass = 160f;
		component4.airControl = 0.25f;
		component4.disableAirControlUntilCollision = false;
		component4.generateParametersOnAwake = true;
		InputBankTest component5 = characterPrefab.GetComponent<InputBankTest>();
		component5.moveVector = Vector3.zero;
		CameraTargetParams component6 = characterPrefab.GetComponent<CameraTargetParams>();
		component6.cameraParams = val.GetComponent<CameraTargetParams>().cameraParams;
		component6.cameraPivotTransform = null;
		component6.recoil = Vector2.zero;
		component6.dontRaycastToPivot = false;
		ModelLocator component7 = characterPrefab.GetComponent<ModelLocator>();
		component7.modelTransform = transform;
		component7.modelBaseTransform = val3.transform;
		component7.dontReleaseModelOnDeath = false;
		component7.autoUpdateModelTransform = true;
		component7.dontDetatchFromParent = false;
		component7.noCorpse = false;
		component7.normalizeToFloor = false;
		component7.preserveModel = false;
		ChildLocator component8 = val2.GetComponent<ChildLocator>();
		CharacterModel val5 = val2.AddComponent<CharacterModel>();
		SkinnedMeshRenderer[] componentsInChildren = val2.GetComponentsInChildren<SkinnedMeshRenderer>();
		List<RendererInfo> list = new List<RendererInfo>();
		foreach (SkinnedMeshRenderer val6 in componentsInChildren)
		{
			((Renderer)val6).material = Utils.InstantiateMaterial(((Renderer)val6).material.mainTexture);
			list.Add(new RendererInfo
			{
				renderer = (Renderer)(object)val6,
				defaultMaterial = ((Renderer)val6).material,
				defaultShadowCastingMode = (ShadowCastingMode)1,
				ignoreOverlays = false
			});
		}
		RendererInfo[] array = list.ToArray();
		val5.body = component2;
		val5.baseRendererInfos = array;
		val5.autoPopulateLightInfos = true;
		val5.invisibilityCount = 0;
		val5.temporaryOverlays = new List<TemporaryOverlayInstance>();
		val5.mainSkinnedMeshRenderer = componentsInChildren[0];
		LanguageAPI.Add("SPACEMARINEBODY_DEFAULT_SKIN_NAME", "Default");
		ModelSkinController val7 = val2.AddComponent<ModelSkinController>();
		val7.skins = (SkinDef[])(object)new SkinDef[1] { Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(val2, "SPACEMARINEBODY_DEFAULT_SKIN_NAME", array)) };
		Collider[] componentsInChildren2 = val2.GetComponentsInChildren<Collider>();
		HurtBoxGroup val8 = val2.AddComponent<HurtBoxGroup>();
		List<HurtBox> list2 = new List<HurtBox>();
		Collider[] array2 = componentsInChildren2;
		foreach (Collider val9 in array2)
		{
			HurtBox val10 = ((Component)val9).gameObject.AddComponent<HurtBox>();
			((Component)val10).gameObject.layer = LayerIndex.entityPrecise.intVal;
			val10.healthComponent = component3;
			val10.isBullseye = true;
			val10.damageModifier = (DamageModifier)0;
			val10.hurtBoxGroup = val8;
			val10.indexInGroup = 0;
			val8.mainHurtBox = val10;
			val8.bullseyeCount = 1;
			list2.Add(val10);
		}
		val8.hurtBoxes = list2.ToArray();
		KinematicCharacterMotor component9 = characterPrefab.GetComponent<KinematicCharacterMotor>();
		component9.CharacterController = (ICharacterController)(object)component4;
		component9.playerCharacter = true;
		Transform parent = component8.FindChild("MECH_spine");
		component8.FindChild("rig_spine").parent = parent;
		component8.FindChild("rig_spine1").parent = parent;
		PhysicMaterial val11 = Addressables.LoadAssetAsync<PhysicMaterial>((object)"RoR2/Base/Common/physmatRagdoll.physicMaterial").WaitForCompletion();
		List<Transform> list3 = new List<Transform>();
		List<string> list4 = new List<string>
		{
			"BASE", "DEF_hips", "DEF_hipLegstretch.L", "DEF_leg_upper.L", "DEF_leg_lower.L", "DEF_hipLegstretch.R", "DEF_leg_upper.R", "DEF_leg_lower.R", "MECH_spine", "MECH_spine_1",
			"rig_spine_2", "TWEAK_spine_2", "DEF_spine_2", "DEF_collar_L", "DEF_arm_upper.L", "DEF_arm_lower.L", "DEF_collar_R", "DEF_arm_upper.R", "DEF_arm_lower.R"
		};
		Transform[] componentsInChildren3 = val2.GetComponentsInChildren<Transform>(true);
		foreach (Transform val12 in componentsInChildren3)
		{
			string name = ((Object)val12).name;
			if (!list4.Contains(name))
			{
				continue;
			}
			list3.Add(val12);
			GameObject gameObject = ((Component)val12).gameObject;
			gameObject.layer = LayerIndex.ragdoll.intVal;
			if (!Object.op_Implicit((Object)(object)gameObject.GetComponent<Rigidbody>()))
			{
				gameObject.AddComponent<Rigidbody>();
			}
			CapsuleCollider val13 = gameObject.AddComponent<CapsuleCollider>();
			val13.radius = 0.4f;
			val13.height = 3.7f;
			switch (name)
			{
			default:
				if (!(name == "spine_top"))
				{
					break;
				}
				goto case "BASE";
			case "BASE":
			case "rig_spine_2":
			case "TWEAK_spine_2":
			case "DEF_hipLegstretch.L":
			case "DEF_hipLegstretch.R":
			case "DEF_spine_2":
				val13.radius = 0.5f;
				val13.height = 0.5f;
				break;
			}
			((Collider)val13).material = val11;
			((Collider)val13).sharedMaterial = val11;
			Rigidbody component10 = ((Component)val12.parent).GetComponent<Rigidbody>();
			if (Object.op_Implicit((Object)(object)component10))
			{
				CharacterJoint val14 = gameObject.AddComponent<CharacterJoint>();
				((Joint)val14).autoConfigureConnectedAnchor = true;
				((Joint)val14).enablePreprocessing = true;
				((Joint)val14).connectedBody = component10;
			}
		}
		RagdollController val15 = val2.AddComponent<RagdollController>();
		val15.bones = list3.ToArray();
		Utils.CreateHitbox("Swing", val2.transform, new Vector3(5.2f, 6.5f, 9f), new Vector3(0f, 1.2f, 3.5f));
		Utils.CreateHitbox("Dash", val2.transform, new Vector3(5f, 6f, 5f), new Vector3(0f, 1.2f, 1f));
		characterPrefab.GetComponent<Interactor>().maxInteractionDistance = 3f;
		characterPrefab.GetComponent<InteractionDriver>().highlightInteractor = true;
		SfxLocator component11 = characterPrefab.GetComponent<SfxLocator>();
		component11.deathSound = "Play_ui_player_death";
		component11.barkSound = "";
		component11.openSound = "";
		component11.landingSound = "Play_SpaceMarine_Impact";
		component11.fallDamageSound = "Play_SpaceMarine_Impact_Heavy";
		component11.aliveLoopStart = "";
		component11.aliveLoopStop = "";
		characterPrefab.GetComponent<Rigidbody>().mass = component4.mass;
		AimAnimator val16 = val2.AddComponent<AimAnimator>();
		val16.inputBank = component5;
		val16.directionComponent = component;
		val16.pitchRangeMin = -60f;
		val16.pitchRangeMax = 60f;
		val16.yawRangeMin = -90f;
		val16.yawRangeMax = 90f;
		val16.pitchGiveupRange = 30f;
		val16.yawGiveupRange = 10f;
		val16.giveupDuration = 3f;
		FootstepHandler val17 = val2.AddComponent<FootstepHandler>();
		val17.baseFootstepString = "Play_SpaceMarine_Footsteps";
		val17.sprintFootstepOverrideString = "";
		val17.enableFootstepDust = true;
		val17.footstepDustPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/GenericFootstepDust.prefab").WaitForCompletion();
		EntityStateMachine component12 = ((Component)component2).GetComponent<EntityStateMachine>();
		component12.mainStateType = new SerializableEntityStateType(typeof(CharacterMain));
		CharacterDeathBehavior component13 = characterPrefab.GetComponent<CharacterDeathBehavior>();
		component13.deathStateMachine = characterPrefab.GetComponent<EntityStateMachine>();
		component13.deathState = new SerializableEntityStateType(typeof(DeathState));
		Utils.NewStateMachine<PassiveBarrier>(characterPrefab, "Passive");
		NetworkStateMachine component14 = ((Component)component2).GetComponent<NetworkStateMachine>();
		component14.stateMachines = ((Component)component2).GetComponents<EntityStateMachine>();
		ContentAddition.AddBody(characterPrefab);
	}

	private void RegisterCharacter()
	{
		//IL_0088: 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)
		string text = " <style=cSub>\r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n";
		string text2 = "..and so he left.";
		string text3 = "..and so he vanished.";
		string text4 = "";
		LanguageAPI.Add("SPACEMARINE_NAME", "SpaceMarine");
		LanguageAPI.Add("SPACEMARINE_DESCRIPTION", text);
		LanguageAPI.Add("SPACEMARINE_SUBTITLE", "Primaris Astartes");
		LanguageAPI.Add("SPACEMARINE_OUTRO", text2);
		LanguageAPI.Add("SPACEMARINE_FAIL", text3);
		SurvivorDef val = ScriptableObject.CreateInstance<SurvivorDef>();
		val.cachedName = "SPACEMARINE_NAME";
		val.unlockableDef = null;
		val.descriptionToken = "SPACEMARINE_DESCRIPTION";
		val.primaryColor = characterColor;
		val.bodyPrefab = characterPrefab;
		val.displayPrefab = Utils.NewDisplayModel(((Component)characterPrefab.GetComponent<ModelLocator>().modelBaseTransform).gameObject, "SpaceMarineDisplay");
		val.outroFlavorToken = "SPACEMARINE_OUTRO";
		val.desiredSortPosition = 22f;
		val.mainEndingEscapeFailureFlavorToken = "SPACEMARINE_FAIL";
		ContentAddition.AddSurvivorDef(val);
		SkillSetup();
		GameObject val2 = PrefabAPI.InstantiateClone(Prefabs.Load<GameObject>("RoR2/Base/Commando/CommandoMonsterMaster.prefab"), "SpaceMarineMaster", true);
		ContentAddition.AddMaster(val2);
		CharacterMaster component = val2.GetComponent<CharacterMaster>();
		component.bodyPrefab = characterPrefab;
	}

	private void RegisterStates()
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: 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_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		bool flag = default(bool);
		ContentAddition.AddEntityState<Primary>(ref flag);
		ContentAddition.AddEntityState<Secondary>(ref flag);
		ContentAddition.AddEntityState<Utility>(ref flag);
		ContentAddition.AddEntityState<UtilityImpact>(ref flag);
		ContentAddition.AddEntityState<UtilitySwipe>(ref flag);
		ContentAddition.AddEntityState<Special>(ref flag);
		ContentAddition.AddEntityState<CharacterMain>(ref flag);
		ContentAddition.AddEntityState<PassiveBarrier>(ref flag);
		ContentAddition.AddEntityState<MeleeSkillState>(ref flag);
		ContentAddition.AddEntityState<BasicMeleeSkillState>(ref flag);
	}

	private void SkillSetup()
	{
		GenericSkill[] componentsInChildren = characterPrefab.GetComponentsInChildren<GenericSkill>();
		foreach (GenericSkill val in componentsInChildren)
		{
			Object.DestroyImmediate((Object)(object)val);
		}
		PassiveSetup();
		PrimarySetup();
		SecondarySetup();
		UtilitySetup();
		SpecialSetup();
	}

	private void PassiveSetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("SPACEMARINE_PASSIVE_NAME", "Iron Halo");
		LanguageAPI.Add("SPACEMARINE_PASSIVE_DESCRIPTION", "Slowly generate <style=cIsHealing>barrier</style> passively. Amount generated is a percentage of your <style=cIsHealth>health</style> equal to <style=cIsDamage>double</style> your current level.Gain an additional <style=cIsHealth>15 max health</style> and <style=cIsDamage>1 armor</style> per level.");
		component.passiveSkill.enabled = true;
		component.passiveSkill.skillNameToken = "SPACEMARINE_PASSIVE_NAME";
		component.passiveSkill.skillDescriptionToken = "SPACEMARINE_PASSIVE_DESCRIPTION";
		component.passiveSkill.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("passive");
	}

	private void PrimarySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("SPACEMARINE_M1", "Bolt Rifle");
		LanguageAPI.Add("SPACEMARINE_M1_DESCRIPTION", "Fire an explosive slug that hits for <style=cIsDamage>150% damage</style>, while the blast hits for <style=cIsDamage>50% damage</style> in a small AoE.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Primary), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 0, 0, 0, Assets.MainAssetBundle.LoadAsset<Sprite>("primary"), "SPACEMARINE_M1_DESCRIPTION", "SPACEMARINE_M1", Array.Empty<string>());
		component.primary = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void SecondarySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("SPACEMARINE_M2", "Frag Grenades");
		LanguageAPI.Add("SPACEMARINE_M2_DESCRIPTION", "Throw a grenade with a large blast radius dealing <style=cIsDamage>250% damage</style>.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Secondary), "Weapon", 1, 5f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("secondary"), "SPACEMARINE_M2_DESCRIPTION", "SPACEMARINE_M2", new string[1] { "KEYWORD_HEAVY" });
		component.secondary = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void UtilitySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("SPACEMARINE_UTIL", "Charge");
		LanguageAPI.Add("SPACEMARINE_UTIL_DESCRIPTION", "<style=cIsUtility>Heavy</style>. Charge forward gaining <style=cIsUtility>50% movement speed</style>. Deals <style=cIsDamage>300% damage</style> to enemies. Hitting a large enemy stops the charge and deals <style=cIsDamage>1200% damage</style>. Can be canceled prematurely, swiping forward and dealing <style=cIsDamage>300% damage</style>.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Utility), "Body", 1, 5f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("utility"), "SPACEMARINE_UTIL_DESCRIPTION", "SPACEMARINE_UTIL", Array.Empty<string>());
		component.utility = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void SpecialSetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("SPACEMARINE_SPEC", "Iron Resolve");
		LanguageAPI.Add("SPACEMARINE_SPEC_DESCRIPTION", "Become <style=cIsDamage>immune</style> to knockback effects, and create a regeneration field around yourself that <style=cIsHealing>heals 10%</style> of your <style=cIsHealing>max health</style> every <style=cIsUtility>2s</style> for <style=cIsUtility>10s + level</style>.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Special), "Slide", 1, 30f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)0, isCombatSkill: false, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("special"), "SPACEMARINE_SPEC_DESCRIPTION", "SPACEMARINE_SPEC", Array.Empty<string>());
		component.special = Utils.NewGenericSkill(characterPrefab, skill);
	}
}
internal class Prefabs
{
	internal static GameObject crosshair;

	internal static GameObject grenade;

	internal static GameObject grenadeGhost;

	internal static GameObject areaIndicator;

	internal static GameObject tracer;

	internal static GameObject grenadeExplosion;

	internal static GameObject impact;

	internal static GameObject impactHeavy;

	internal static BuffDef knockback;

	internal static BuffDef speed;

	internal static T Load<T>(string path)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		return Addressables.LoadAssetAsync<T>((object)path).WaitForCompletion();
	}

	internal static void CreatePrefabs()
	{
		//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_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		//IL_014e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Expected O, but got Unknown
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f1: Expected O, but got Unknown
		//IL_020f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0214: Unknown result type (might be due to invalid IL or missing references)
		//IL_0252: Unknown result type (might be due to invalid IL or missing references)
		//IL_0257: Unknown result type (might be due to invalid IL or missing references)
		//IL_027f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0289: Expected O, but got Unknown
		//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d6: Expected O, but got Unknown
		//IL_036d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0374: Expected O, but got Unknown
		//IL_0498: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e1: Expected O, but got Unknown
		//IL_04e1: Unknown result type (might be due to invalid IL or missing references)
		knockback = Utils.NewBuffDef("Iron Resolve", stack: false, hidden: false, Assets.Load<Sprite>("buffIcon"), Color32.op_Implicit(new Color32((byte)241, (byte)177, (byte)0, byte.MaxValue)));
		speed = Utils.NewBuffDef("Charge", stack: false, hidden: false, Load<Sprite>("RoR2/Base/Common/texMovespeedBuffIcon.tif"), MainPlugin.characterColor);
		impact = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Loader/OmniImpactVFXLoader.prefab"), "ImpactEffect", false);
		Utils.RegisterEffect(impact, -1f, "Play_SpaceMarine_Impact");
		impactHeavy = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Loader/OmniImpactVFXLoader.prefab"), "HeavyImpactEffect", false);
		Utils.RegisterEffect(impactHeavy, -1f, "Play_SpaceMarine_Impact_Heavy", applyScale: true);
		grenadeExplosion = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/LemurianBruiser/OmniExplosionVFXLemurianBruiserFireballImpact.prefab"), "GrenadeExplosion", false);
		Utils.RegisterEffect(grenadeExplosion, -1f, "Play_SpaceMarine_Grenade_Explosion", applyScale: true);
		tracer = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Junk/Commando/TracerBarrage.prefab"), "Tracer", false);
		LineRenderer component = tracer.GetComponent<LineRenderer>();
		component.startColor = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)83, (byte)0, byte.MaxValue));
		component.endColor = component.startColor;
		ParticleSystemRenderer componentInChildren = tracer.GetComponentInChildren<ParticleSystemRenderer>();
		((Renderer)componentInChildren).material = new Material(((Renderer)componentInChildren).material);
		((Renderer)componentInChildren).material.DisableKeyword("VERTEXCOLOR");
		((Renderer)componentInChildren).material.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampParentEyes.png"));
		MainModule main = ((Component)componentInChildren).GetComponent<ParticleSystem>().main;
		((MainModule)(ref main)).simulationSpeed = 2f;
		ContentAddition.AddEffect(tracer);
		Texture2D val = Load<Texture2D>("RoR2/DLC1/Common/ColorRamps/texRampConstructLaserTypeB.png");
		areaIndicator = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Huntress/HuntressArrowRainIndicator.prefab"), "AreaIndicator", false);
		MeshRenderer componentInChildren2 = areaIndicator.GetComponentInChildren<MeshRenderer>(false);
		((Renderer)componentInChildren2).material = new Material(Load<Material>("RoR2/Base/Common/VFX/matAreaIndicatorIntersectionOnly.mat"));
		((Renderer)componentInChildren2).material.SetColor("_TintColor", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)170, (byte)40, byte.MaxValue)));
		((Renderer)componentInChildren2).material.SetTexture("_RemapTex", (Texture)(object)val);
		GameObject val2 = Object.Instantiate<GameObject>(((Component)Load<GameObject>("RoR2/Base/Mushroom/MushroomWard.prefab").GetComponentsInChildren<ParticleSystem>()[1]).gameObject, areaIndicator.transform.position, Quaternion.identity, areaIndicator.transform);
		ParticleSystemRenderer component2 = val2.GetComponent<ParticleSystemRenderer>();
		((Renderer)component2).material = new Material(((Renderer)component2).material);
		((Renderer)component2).material.SetTexture("_RemapTex", (Texture)(object)val);
		grenadeGhost = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Commando/CommandoGrenadeGhost.prefab"), "GrenadeProjectileGhost", false);
		ParticleSystemRenderer componentInChildren3 = grenadeGhost.GetComponentInChildren<ParticleSystemRenderer>();
		((Renderer)componentInChildren3).material = new Material(((Renderer)componentInChildren3).material);
		((Renderer)componentInChildren3).material.DisableKeyword("VERTEXCOLOR");
		((Renderer)componentInChildren3).material.SetTexture("_MainTex", (Texture)(object)Assets.Load<Texture2D>("pulseMask"));
		((Renderer)componentInChildren3).material.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampParentEyes.png"));
		((Renderer)grenadeGhost.GetComponentInChildren<TrailRenderer>()).material = ((Renderer)componentInChildren).material;
		GameObject val3 = Assets.Load<GameObject>("grenade");
		MeshFilter componentInChildren4 = grenadeGhost.GetComponentInChildren<MeshFilter>();
		componentInChildren4.mesh = val3.GetComponentInChildren<MeshFilter>().mesh;
		Material val4 = new Material(Assets.Load<Material>("diffuse"));
		val4.shader = Load<Shader>("RoR2/Base/Shaders/HGStandard.shader");
		((Renderer)((Component)componentInChildren4).GetComponent<MeshRenderer>()).material = val4;
		grenade = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Commando/CommandoGrenadeProjectile.prefab"), "GrenadeProjectile", true);
		grenade.GetComponent<ProjectileController>().ghostPrefab = grenadeGhost;
		ProjectileImpactExplosion component3 = grenade.GetComponent<ProjectileImpactExplosion>();
		component3.timerAfterImpact = false;
		component3.destroyOnEnemy = true;
		component3.destroyOnWorld = true;
		component3.impactEffect = grenadeExplosion;
		ContentAddition.AddProjectile(grenade);
		crosshair = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("crosshair"), "Crosshair", false);
		ChildLocator component4 = crosshair.GetComponent<ChildLocator>();
		CrosshairBehaviour crosshairBehaviour = crosshair.AddComponent<CrosshairBehaviour>();
		crosshairBehaviour.off = ((Component)component4.FindChild("bgOff")).gameObject;
		crosshairBehaviour.on = ((Component)component4.FindChild("bgOn")).gameObject;
		((CrosshairController)crosshairBehaviour).maxSpreadAngle = 18f;
		List<SpritePosition> list = new List<SpritePosition>();
		Image[] componentsInChildren = ((Component)component4.FindChild("nibs")).GetComponentsInChildren<Image>();
		foreach (Image val5 in componentsInChildren)
		{
			list.Add(new SpritePosition
			{
				zeroPosition = ((Component)val5).transform.localPosition * 0.28571f,
				onePosition = ((Component)val5).transform.localPosition,
				target = (RectTransform)((Component)val5).transform
			});
		}
		((CrosshairController)crosshairBehaviour).spriteSpreadPositions = list.ToArray();
	}
}
internal class BasicMeleeSkillState : BaseSkillState
{
	private float duration = 0.2f;

	private Vector3 dir;

	private OverlapAttack attack;

	private float damageCoefficient = 4.2f;

	private GameObject hitEffectPrefab = null;

	private bool parried;

	public Animator animator;

	private uint ID;

	private string hitboxGroupName = "";

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

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

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

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)1;
	}
}
internal class CharacterMain : GenericCharacterMain
{
	public override void FixedUpdate()
	{
		((GenericCharacterMain)this).FixedUpdate();
		((BaseCharacterMain)this).modelAnimator.SetFloat("inCombat", (float)((!((EntityState)this).characterBody.outOfCombat) ? 1 : 0));
	}
}
internal class PassiveBarrier : Idle
{
	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (NetworkServer.active && ((EntityState)this).fixedAge >= 5f)
		{
			((EntityState)this).fixedAge = 0f;
			((EntityState)this).healthComponent.AddBarrier(((EntityState)this).healthComponent.fullCombinedHealth * (0.01f * ((EntityState)this).characterBody.level));
		}
	}
}
internal class MeleeSkillState : BaseCharacterMain
{
	public float attackDuration;

	public float earlyExitDuration;

	private bool hopped;

	private bool hasSwung;

	public bool isInHitPause;

	public float hitPauseDuration;

	public float hopVelocity;

	public float hitPauseTimer;

	public float stopwatch;

	public HitStopCachedState hitStopCachedState;

	public OverlapAttack overlapAttack;

	public bool hasHit;

	private bool hasAnimParameter;

	private float attackSpeedScaling;

	public Animator animator;

	public List<HurtBox> hitList = new List<HurtBox>();

	public virtual float baseAttackDuration => 0f;

	public virtual float baseEarlyExitDuration => 0f;

	public virtual float damageCoefficient => 0f;

	public virtual float forceMagnitude => 440f;

	public virtual float rootMotionSpeed => 25f;

	public virtual float baseHopVelocity => 4f;

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

	public virtual string animationStateName => "";

	public virtual string animParameter => "M1";

	public virtual string hitBoxGroupName => animationStateName;

	public virtual string hitBoxActiveParameter => "Curve";

	public virtual string swingMuzzle => animationStateName + "Muzzle";

	public virtual GameObject swingEffectPrefab => null;

	public virtual bool hopOnHit => true;

	public virtual bool rootMotion => true;

	public virtual bool rootMotionWhileHitting => false;

	public virtual bool forceFire => false;

	public virtual uint swingSound => 0u;

	public virtual DamageType damageType => (DamageType)0;

	public virtual DamageColorIndex damageColor => (DamageColorIndex)0;

	public virtual Vector3 bonusForce => Vector3.zero;

	public virtual GameObject hitEffectPrefab => null;

	public virtual float maxAttackSpeedScaling => 5.95f;

	public override void OnEnter()
	{
		((BaseCharacterMain)this).OnEnter();
		attackSpeedScaling = Math.Min(((BaseState)this).attackSpeedStat, maxAttackSpeedScaling);
		attackDuration = baseAttackDuration / attackSpeedScaling;
		earlyExitDuration = baseEarlyExitDuration / attackSpeedScaling;
		hitPauseDuration = GroundLight.hitPauseDuration / attackSpeedScaling;
		hopVelocity = baseHopVelocity / attackSpeedScaling;
		((EntityState)this).PlayAnimation(layerName, "BufferEmpty");
		animator = ((EntityState)this).GetModelAnimator();
		animator.SetFloat(hitBoxActiveParameter, 0f);
		((BaseState)this).StartAimMode(attackDuration + 1f, false);
		overlapAttack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, hitEffectPrefab, ((EntityState)this).GetModelTransform(), hitBoxGroupName);
		overlapAttack.pushAwayForce = 1f;
		hasAnimParameter = !Utility.IsNullOrWhiteSpace(animParameter);
		if (hasAnimParameter && !Utility.IsNullOrWhiteSpace(animationStateName))
		{
			((EntityState)this).PlayCrossfade(layerName, animationStateName, animParameter, attackDuration, 0.1f);
		}
	}

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

	public override void FixedUpdate()
	{
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Unknown result type (might be due to invalid IL or missing references)
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0183: 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_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
		((BaseCharacterMain)this).FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			bool flag = FireMeleeAttack(overlapAttack, animator, hitBoxActiveParameter, forceMagnitude, bonusForce);
			hasHit = flag;
			if (hasHit)
			{
				if (hopOnHit && !((EntityState)this).characterMotor.isGrounded && !hopped)
				{
					((BaseState)this).SmallHop(((EntityState)this).characterMotor, hopVelocity);
					hopped = true;
				}
				if (!rootMotionWhileHitting && !isInHitPause && hasAnimParameter)
				{
					hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, animParameter);
					isInHitPause = true;
				}
			}
			if (animator.GetFloat(hitBoxActiveParameter) > 0.1f && rootMotion && !isInHitPause && !hasHit)
			{
				Vector3 val = rootMotionDirection();
				Vector3 val2 = default(Vector3);
				((Vector3)(ref val2))..ctor(val.x, 0f, val.z);
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += val2 * rootMotionSpeed * Time.fixedDeltaTime;
			}
			if (hitPauseTimer >= hitPauseDuration && isInHitPause)
			{
				((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator);
				isInHitPause = false;
				animator.speed = 1f;
			}
			if (!isInHitPause)
			{
				stopwatch += Time.fixedDeltaTime;
			}
			else
			{
				hitPauseTimer += Time.fixedDeltaTime;
				((EntityState)this).characterMotor.velocity = Vector3.zero;
				animator.speed = 0f;
			}
			if (stopwatch >= attackDuration - earlyExitDuration)
			{
				if (((EntityState)this).inputBank.skill1.down)
				{
					SetState();
				}
				if (stopwatch >= attackDuration)
				{
					BaseSkillState val3 = StateOverride();
					if (val3 != null)
					{
						((EntityState)this).outer.SetNextState((EntityState)(object)val3);
					}
					else
					{
						((EntityState)this).outer.SetNextStateToMain();
					}
					return;
				}
			}
		}
		if (animator.GetFloat(hitBoxActiveParameter) >= 0.11f && !hasSwung)
		{
			hasSwung = true;
			AkSoundEngine.PostEvent(swingSound, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)swingEffectPrefab) && !Utility.IsNullOrWhiteSpace(swingMuzzle))
			{
				EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, swingMuzzle, false);
			}
		}
	}

	public bool FireMeleeAttack(OverlapAttack attack, Animator animator, string mecanimHitboxActiveParameter, float forceMagnitude, Vector3 bonusForce)
	{
		//IL_0056: 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_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_0049: 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)
		bool result = false;
		if ((Object.op_Implicit((Object)(object)animator) && animator.GetFloat(mecanimHitboxActiveParameter) > 0.1f) || forceFire)
		{
			attack.forceVector = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : (((EntityState)this).transform.forward * forceMagnitude + bonusForce));
			result = attack.Fire(hitList);
		}
		return result;
	}

	public virtual void SetState()
	{
	}

	public virtual BaseSkillState StateOverride()
	{
		return null;
	}

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

	private float baseDuration = 0.25f;

	private float damageCoefficient = 1.5f;

	private float explosionDamageCoefficient = 0.5f;

	private bool bulletHit;

	private Vector3 hitPoint;

	public override void OnEnter()
	{
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_00d7: 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_00e5: 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_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_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0113: 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_011a: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Unknown result type (might be due to invalid IL or missing references)
		//IL_0150: Unknown result type (might be due to invalid IL or missing references)
		//IL_015c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0180: Unknown result type (might be due to invalid IL or missing references)
		//IL_0186: Unknown result type (might be due to invalid IL or missing references)
		//IL_0191: Unknown result type (might be due to invalid IL or missing references)
		//IL_019c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f8: Expected O, but got Unknown
		//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0204: Unknown result type (might be due to invalid IL or missing references)
		//IL_0218: Unknown result type (might be due to invalid IL or missing references)
		//IL_021d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0229: Unknown result type (might be due to invalid IL or missing references)
		//IL_022b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Unknown result type (might be due to invalid IL or missing references)
		//IL_0243: Unknown result type (might be due to invalid IL or missing references)
		//IL_024f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0251: Unknown result type (might be due to invalid IL or missing references)
		//IL_0256: Unknown result type (might be due to invalid IL or missing references)
		//IL_025b: Unknown result type (might be due to invalid IL or missing references)
		//IL_025d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0262: Unknown result type (might be due to invalid IL or missing references)
		//IL_0264: Unknown result type (might be due to invalid IL or missing references)
		//IL_0269: Unknown result type (might be due to invalid IL or missing references)
		//IL_026e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: Unknown result type (might be due to invalid IL or missing references)
		//IL_0284: Unknown result type (might be due to invalid IL or missing references)
		//IL_028b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0290: Unknown result type (might be due to invalid IL or missing references)
		//IL_0295: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c8: Expected O, but got Unknown
		((BaseState)this).OnEnter();
		((BaseState)this).StartAimMode(2f, true);
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		((EntityState)this).PlayAnimation("Gesture, Override", "Fire", "M1", duration, 0f);
		EffectManager.SimpleMuzzleFlash(Prefabs.Load<GameObject>("RoR2/Base/Common/VFX/Muzzleflash1.prefab"), ((EntityState)this).gameObject, "gunMuzzle", false);
		float num = 1.2f;
		((BaseState)this).AddRecoil(-1f * num, -1.5f * num, -0.25f * num, 0.25f * num);
		((EntityState)this).characterBody.AddSpreadBloom(2f);
		AkSoundEngine.PostEvent(Sounds.Play_SpaceMarine_Bolt_Fire, ((EntityState)this).gameObject);
		if (!((EntityState)this).isAuthority)
		{
			return;
		}
		Ray aimRay = ((BaseState)this).GetAimRay();
		float num2 = 0.0425f;
		new BulletAttack
		{
			bulletCount = 1u,
			aimVector = ((Ray)(ref aimRay)).direction,
			origin = ((Ray)(ref aimRay)).origin,
			damage = ((BaseState)this).damageStat * damageCoefficient,
			damageColorIndex = (DamageColorIndex)0,
			damageType = DamageTypeCombo.op_Implicit((DamageType)0),
			falloffModel = (FalloffModel)1,
			maxDistance = 250f,
			force = 20f,
			hitMask = CommonMasks.bullet,
			minSpread = 0f - num2,
			maxSpread = num2,
			isCrit = ((BaseState)this).RollCrit(),
			owner = ((EntityState)this).gameObject,
			muzzleName = "gunMuzzle",
			smartCollision = false,
			procChainMask = default(ProcChainMask),
			procCoefficient = 1f,
			radius = 0.08f,
			sniper = false,
			stopperMask = CommonMasks.bullet,
			weapon = null,
			tracerEffectPrefab = Prefabs.tracer,
			spreadPitchScale = 1f,
			spreadYawScale = 1f,
			hitEffectPrefab = Prefabs.Load<GameObject>("RoR2/Base/Common/VFX/OmniImpactVFX.prefab"),
			hitCallback = (HitCallback)delegate(BulletAttack _bulletAttack, ref BulletHit info)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				if (info.point != Vector3.zero)
				{
					hitPoint = info.point;
				}
				return BulletAttack.defaultHitCallback.Invoke(_bulletAttack, ref info);
			}
		}.Fire();
		if (hitPoint != Vector3.zero)
		{
			new BlastAttack
			{
				attacker = ((EntityState)this).gameObject,
				attackerFiltering = (AttackerFiltering)2,
				baseDamage = ((BaseState)this).damageStat * explosionDamageCoefficient,
				crit = ((BaseState)this).RollCrit(),
				damageType = DamageTypeCombo.op_Implicit((DamageType)0),
				falloffModel = (FalloffModel)0,
				position = hitPoint,
				procCoefficient = 0.25f,
				radius = 4f,
				teamIndex = ((EntityState)this).teamComponent.teamIndex
			}.Fire();
			EffectManager.SpawnEffect(Prefabs.Load<GameObject>("RoR2/Base/Common/VFX/OmniExplosionVFXQuick.prefab"), new EffectData
			{
				origin = hitPoint,
				scale = 2f
			}, true);
		}
	}

	public override void FixedUpdate()
	{
		//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_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)
		//IL_002b: 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_002d: 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_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
		{
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector2 val = Util.Vector3XZToVector2XY(((Ray)(ref aimRay)).direction);
			if (val != Vector2.zero)
			{
				((Vector2)(ref val)).Normalize();
				Vector3 val2 = new Vector3(val.x, 0f, val.y);
				Vector3 normalized = ((Vector3)(ref val2)).normalized;
				((EntityState)this).characterDirection.moveVector = normalized;
			}
		}
		((EntityState)this).characterBody.isSprinting = false;
		((EntityState)this).skillLocator.primary.rechargeStopwatch = 0f;
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

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

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

	private float baseDuration = 0.4f;

	private float damageCoefficient = 2.5f;

	private Animator animator;

	private bool hasFired;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		((EntityState)this).PlayAnimation("Gesture, Override", "Throw", "M2", duration, 0f);
		animator = ((EntityState)this).GetModelAnimator();
		animator.SetFloat("Curve", 0f);
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		AkSoundEngine.PostEvent(Sounds.Play_SpaceMarine_Grenade_Throw, ((EntityState)this).gameObject);
	}

	public override void FixedUpdate()
	{
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority && animator.GetFloat("Curve") >= 0.1f && !hasFired)
		{
			hasFired = true;
			Ray aimRay = ((BaseState)this).GetAimRay();
			ProjectileManager.instance.FireProjectile(Prefabs.grenade, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * damageCoefficient, 680f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f);
			EffectManager.SimpleMuzzleFlash(Prefabs.Load<GameObject>("RoR2/Base/Common/VFX/MuzzleflashSmokeRing.prefab"), ((EntityState)this).gameObject, "hand.l", true);
		}
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

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

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

	private SphereSearch search = new SphereSearch();

	private Vector3 pos;

	private GameObject areaIndicator;

	private TeamMask mask;

	private float stopwatch;

	private float radius = 9f;

	private uint ID;

	public override void OnEnter()
	{
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: 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_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: 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)
		((BaseState)this).OnEnter();
		duration = 10f + ((EntityState)this).characterBody.level;
		areaIndicator = Object.Instantiate<GameObject>(Prefabs.areaIndicator, ((EntityState)this).transform.position, Quaternion.identity, ((EntityState)this).transform);
		areaIndicator.transform.localScale = Vector3.one * radius;
		if (NetworkServer.active)
		{
			((EntityState)this).characterBody.AddTimedBuff(Prefabs.knockback, duration);
			search.origin = pos;
			search.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask;
			search.radius = radius;
			mask = default(TeamMask);
			((TeamMask)(ref mask)).AddTeam((TeamIndex)1);
			search.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask;
		}
		ID = AkSoundEngine.PostEvent(Sounds.Play_SpaceMarine_HealField, ((EntityState)this).gameObject);
	}

	public override void FixedUpdate()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		pos = ((EntityState)this).transform.position;
		if (NetworkServer.active)
		{
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= 1f)
			{
				stopwatch = 0f;
				search.origin = pos;
				HurtBox[] hurtBoxes = search.RefreshCandidates().FilterCandidatesByHurtBoxTeam(mask).OrderCandidatesByDistance()
					.FilterCandidatesByDistinctHurtBoxEntities()
					.GetHurtBoxes();
				foreach (HurtBox val in hurtBoxes)
				{
					val.healthComponent.Heal(((EntityState)this).healthComponent.fullCombinedHealth * 0.1f, default(ProcChainMask), true);
					val.healthComponent.body.AddTimedBuff(Prefabs.knockback, 1.5f);
				}
			}
		}
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		AkSoundEngine.StopPlayingID(ID);
		AkSoundEngine.PostEvent(Sounds.Play_SpaceMarine_HealField_End, ((EntityState)this).gameObject);
		if (Object.op_Implicit((Object)(object)areaIndicator))
		{
			EntityState.Destroy((Object)(object)areaIndicator);
		}
		((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)7;
	}
}
internal class Utility : MeleeSkillState
{
	private Vector3 direction;

	private AimRequest request;

	public override float baseAttackDuration => 3f;

	public override string animParameter => "Utility";

	public override float forceMagnitude => 2600f;

	public override float damageCoefficient => 3f;

	public override GameObject hitEffectPrefab => Prefabs.impact;

	public override GameObject swingEffectPrefab => null;

	public override DamageType damageType => (DamageType)0;

	public override string hitBoxGroupName => "Dash";

	public override float maxAttackSpeedScaling => 1f;

	public override bool forceFire => false;

	public override bool rootMotion => false;

	public override void OnEnter()
	{
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		base.OnEnter();
		animator.SetBool("charging", true);
		((EntityState)this).PlayAnimation("Gesture, Override", "Charge", "Utility", baseAttackDuration, 0f);
		if (((EntityState)this).isAuthority)
		{
			direction = ((EntityState)this).inputBank.aimDirection;
			direction.y = 0f;
			UpdateDirection();
		}
		((EntityState)this).characterDirection.forward = direction;
		((EntityState)this).modelLocator.normalizeToFloor = true;
		if (NetworkServer.active)
		{
			((EntityState)this).characterBody.AddBuff(Prefabs.speed);
		}
		request = ((EntityState)this).cameraTargetParams.RequestAimType((AimType)2);
	}

	public override void FixedUpdate()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		base.FixedUpdate();
		direction = ((EntityState)this).inputBank.aimDirection;
		UpdateDirection();
		if (!((EntityState)this).isAuthority)
		{
			return;
		}
		if (((EntityState)this).fixedAge >= 0.25f && ((EntityState)this).inputBank.skill3.down)
		{
			((EntityState)this).outer.SetNextState((EntityState)(object)new UtilitySwipe());
			return;
		}
		((EntityState)this).characterBody.isSprinting = true;
		if (!isInHitPause)
		{
			((EntityState)this).characterDirection.moveVector = direction;
			if (!((EntityState)this).characterMotor.disableAirControlUntilCollision)
			{
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += GetIdealVelocity() * Time.fixedDeltaTime;
			}
		}
		else
		{
			((EntityState)this).characterMotor.velocity = Vector3.zero;
		}
		if (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.special) && ((EntityState)this).inputBank.skill4.down)
		{
			((EntityState)this).skillLocator.special.ExecuteIfReady();
		}
		if (!hasHit)
		{
			return;
		}
		for (int i = 0; i < hitList.Count; i++)
		{
			float num = 0f;
			HurtBox val = hitList[i];
			if (!Object.op_Implicit((Object)(object)val.healthComponent))
			{
				continue;
			}
			CharacterMotor component = ((Component)val.healthComponent).GetComponent<CharacterMotor>();
			if (Object.op_Implicit((Object)(object)component))
			{
				num = component.mass;
			}
			else
			{
				Rigidbody component2 = ((Component)val.healthComponent).GetComponent<Rigidbody>();
				if (Object.op_Implicit((Object)(object)component2))
				{
					num = component2.mass;
				}
			}
			if (num >= 250f)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new UtilityImpact
				{
					victim = val.healthComponent
				});
				break;
			}
		}
	}

	private 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 (Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
		{
			Vector2 val = Util.Vector3XZToVector2XY(((EntityState)this).inputBank.moveVector);
			if (val != Vector2.zero)
			{
				((Vector2)(ref val)).Normalize();
				Vector3 val2 = new Vector3(val.x, 0f, val.y);
				direction = ((Vector3)(ref val2)).normalized;
			}
		}
	}

	private Vector3 GetIdealVelocity()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		return ((EntityState)this).characterDirection.forward * ((EntityState)this).characterBody.moveSpeed;
	}

	public override void OnExit()
	{
		//IL_0060: 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_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
		{
			request.Dispose();
		}
		if (NetworkServer.active)
		{
			((EntityState)this).characterBody.RemoveBuff(Prefabs.speed);
		}
		((EntityState)this).modelLocator.normalizeToFloor = false;
		if (!((EntityState)this).characterMotor.disableAirControlUntilCollision)
		{
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.velocity += GetIdealVelocity();
		}
		animator.SetFloat("Utility", 1f);
		animator.SetBool("charging", false);
		((EntityState)this).PlayAnimation("Gesture, Override", "ChargeMiss");
		((BaseCharacterMain)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)5;
	}
}
internal class UtilityImpact : BaseSkillState
{
	public HealthComponent victim;

	public override void OnSerialize(NetworkWriter writer)
	{
		((BaseSkillState)this).OnSerialize(writer);
		writer.Write(Object.op_Implicit((Object)(object)victim) ? ((Component)victim).gameObject : null);
	}

	public override void OnDeserialize(NetworkReader reader)
	{
		((BaseSkillState)this).OnDeserialize(reader);
		GameObject val = reader.ReadGameObject();
		victim = (Object.op_Implicit((Object)(object)val) ? val.GetComponent<HealthComponent>() : null);
	}

	public override void OnEnter()
	{
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0151: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_016a: Unknown result type (might be due to invalid IL or missing references)
		//IL_016f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: Unknown result type (might be due to invalid IL or missing references)
		//IL_018a: Expected O, but got Unknown
		//IL_0106: 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_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Expected O, but got Unknown
		((BaseState)this).OnEnter();
		Animator modelAnimator = ((EntityState)this).GetModelAnimator();
		modelAnimator.SetFloat("Utility", 1f);
		modelAnimator.SetBool("charging", false);
		((EntityState)this).PlayAnimation("Gesture, Override", "ChargeMiss");
		if (NetworkServer.active)
		{
			if (Object.op_Implicit((Object)(object)victim))
			{
				DamageInfo val = new DamageInfo
				{
					attacker = ((EntityState)this).gameObject,
					damage = ((BaseState)this).damageStat * 12f,
					crit = ((BaseState)this).RollCrit(),
					procCoefficient = 1f,
					damageColorIndex = (DamageColorIndex)3,
					damageType = DamageTypeCombo.op_Implicit((DamageType)32),
					position = ((EntityState)this).characterBody.corePosition
				};
				victim.TakeDamage(val);
				GlobalEventManager.instance.OnHitEnemy(val, ((Component)victim).gameObject);
				GlobalEventManager.instance.OnHitAll(val, ((Component)victim).gameObject);
			}
			((EntityState)this).healthComponent.TakeDamageForce(((EntityState)this).characterDirection.forward * (0f - ToolbotDash.knockbackForce), true, false);
		}
		if (((EntityState)this).isAuthority)
		{
			((BaseState)this).AddRecoil(-1.5f, -1.5f, -4f, 1.5f);
			EffectManager.SpawnEffect(Prefabs.impactHeavy, new EffectData
			{
				origin = ((EntityState)this).characterBody.corePosition,
				rotation = Util.QuaternionSafeLookRotation(((EntityState)this).characterDirection.forward),
				scale = 4f
			}, true);
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	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)5;
	}
}
internal class UtilitySwipe : MeleeSkillState
{
	public override float baseAttackDuration => GroundLight.baseComboAttackDuration;

	public override string layerName => "FullBody, Override";

	public override string animationStateName => "Swipe";

	public override string animParameter => "Utility";

	public override string hitBoxGroupName => "Swing";

	public override float forceMagnitude => 4800f;

	public override string swingMuzzle => "";

	public override float damageCoefficient => 3f;

	public override uint swingSound => Sounds.Play_SpaceMarine_Swing;

	public override float baseHopVelocity => 6f;

	public override bool rootMotion => true;

	public override float rootMotionSpeed => 42f;

	public override GameObject hitEffectPrefab => Prefabs.impact;

	public override GameObject swingEffectPrefab => null;

	public override DamageType damageType => (DamageType)0;

	public override void OnEnter()
	{
		base.OnEnter();
	}
}
internal class Sounds
{
	public static readonly uint Play_SpaceMarine_Grenade_Explosion_Emp = 973356658u;

	public static readonly uint Play_SpaceMarine_Grenade_Explosion = 2288588393u;

	public static readonly uint Play_SpaceMarine_Display = 2536094593u;

	public static readonly uint Play_SpaceMarine_Grenade_Throw = 3016545988u;

	public static readonly uint Play_SpaceMarine_Impact = 3038657859u;

	public static readonly uint Play_SpaceMarine_Bolt_Fire = 3371325911u;

	public static readonly uint Play_SpaceMarine_Impact_Heavy = 3441669515u;

	public static readonly uint Play_SpaceMarine_Footsteps = 4015382410u;

	public static readonly uint Play_SpaceMarine_Swing = 1899423449u;

	public static readonly uint Play_SpaceMarine_HealField = 2119041049u;

	public static readonly uint Play_SpaceMarine_HealField_End = 818088731u;
}
internal static class Extensions
{
	public static GameObject NewSyringe(this GameObject g, params Material[] m)
	{
		((Renderer)g.GetComponentsInChildren<MeshRenderer>(false)[0]).material = m[0];
		((Renderer)g.GetComponent<TrailRenderer>()).material = m[1];
		((Renderer)g.GetComponent<ParticleSystemRenderer>()).material = m[2];
		return g;
	}

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

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

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

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

	public static void SetStrings(this TooltipProvider t, string title, string body)
	{
		t.overrideTitleText = title;
		t.overrideBodyText = body;
	}
}
internal class Utils
{
	public static SkillDef NewSkillDef<T>(Type activationState, string activationStateMachineName, int baseMaxStock, float baseRechargeInterval, bool beginSkillCooldownOnSkillEnd, bool canceledFromSprinting, bool fullRestockOnAssign, InterruptPriority interruptPriority, bool isCombatSkill, bool mustKeyPress, bool cancelSprintingOnActivation, int rechargeStock, int requiredStock, int stockToConsume, Sprite icon, string skillDescriptionToken, string skillName, params string[] keywordTokens) where T : SkillDef
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		T val = ScriptableObject.CreateInstance<T>();
		((SkillDef)val).activationState = new SerializableEntityStateType(activationState);
		((SkillDef)val).activationStateMachineName = activationStateMachineName;
		((SkillDef)val).baseMaxStock = baseMaxStock;
		((SkillDef)val).baseRechargeInterval = baseRechargeInterval;
		((SkillDef)val).beginSkillCooldownOnSkillEnd = beginSkillCooldownOnSkillEnd;
		((SkillDef)val).canceledFromSprinting = canceledFromSprinting;
		((SkillDef)val).fullRestockOnAssign = fullRestockOnAssign;
		((SkillDef)val).interruptPriority = interruptPriority;
		((SkillDef)val).isCombatSkill = isCombatSkill;
		((SkillDef)val).mustKeyPress = mustKeyPress;
		((SkillDef)val).cancelSprintingOnActivation = cancelSprintingOnActivation;
		((SkillDef)val).rechargeStock = rechargeStock;
		((SkillDef)val).requiredStock = requiredStock;
		((SkillDef)val).stockToConsume = stockToConsume;
		((SkillDef)val).icon = icon;
		((SkillDef)val).skillDescriptionToken = skillDescriptionToken;
		((SkillDef)val).skillName = skillName;
		((SkillDef)val).skillNameToken = ((SkillDef)val).skillName;
		((SkillDef)val).keywordTokens = keywordTokens;
		ContentAddition.AddSkillDef((SkillDef)(object)val);
		return (SkillDef)(object)val;
	}

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

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

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

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

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

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

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

	public static GameObject NewDisplayModel(GameObject model, string name)
	{
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Expected O, but got Unknown
		GameObject val = PrefabAPI.InstantiateClone(model, name, false);
		val.GetComponentInChildren<Animator>().runtimeAnimatorController = Assets.Load<RuntimeAnimatorController>("displayAnimator");
		((Behaviour)val.GetComponentInChildren<CharacterModel>()).enabled = false;
		SkinnedMeshRenderer[] componentsInChildren = val.GetComponentsInChildren<SkinnedMeshRenderer>(true);
		foreach (SkinnedMeshRenderer val2 in componentsInChildren)
		{
			((Renderer)val2).material = new Material(((Renderer)val2).material);
			((Renderer)val2).material.DisableKeyword("DITHER");
		}
		return val;
	}

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

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

	internal static SkinDefInfo CreateNewSkinDefInfo(GameObject rootObject, string skinName, RendererInfo[] rendererInfos, UnlockableDef unlockableDef = null)
	{
		//IL_0003: 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_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		SkinDefInfo result = default(SkinDefInfo);
		result.BaseSkins = Array.Empty<SkinDef>();
		result.MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0];
		result.ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0];
		result.GameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[0];
		result.Icon = Assets.MainAssetBundle.LoadAsset<Sprite>("skinIcon");
		result.MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[0];
		result.Name = skinName;
		result.NameToken = skinName;
		result.RendererInfos = rendererInfos;
		result.RootObject = rootObject;
		result.UnlockableDef = unlockableDef;
		return result;
	}

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

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

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

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

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

	internal static EffectComponent RegisterEffect(GameObject effect, float duration, string soundName = "", bool applyScale = false, bool parentToReferencedTransform = true, bool positionAtReferencedTransform = true)
	{
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		EffectComponent val = effect.GetComponent<EffectComponent>();
		if (!Object.op_Implicit((Object)(object)val))
		{
			val = effect.AddComponent<EffectComponent>();
		}
		if (duration != -1f)
		{
			DestroyOnTimer component = effect.GetComponent<DestroyOnTimer>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				effect.AddComponent<DestroyOnTimer>().duration = duration;
			}
			else
			{
				component.duration = duration;
			}
		}
		if (!Object.op_Implicit((Object)(object)effect.GetComponent<NetworkIdentity>()))
		{
			effect.AddComponent<NetworkIdentity>();
		}
		if (!Object.op_Implicit((Object)(object)effect.GetComponent<VFXAttributes>()))
		{
			effect.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
		}
		val.applyScale = applyScale;
		val.effectIndex = (EffectIndex)(-1);
		val.parentToReferencedTransform = parentToReferencedTransform;
		val.positionAtReferencedTransform = positionAtReferencedTransform;
		val.soundName = soundName;
		ContentAddition.AddEffect(effect);
		return val;
	}

	public static Material InstantiateMaterial(Texture tex)
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		Material val = Object.Instantiate<Material>(Prefabs.Load<Material>("RoR2/Base/Commando/matCommandoDualies.mat"));
		if (Object.op_Implicit((Object)(object)val))
		{
			val.SetColor("_Color", Color.white);
			val.SetTexture("_MainTex", tex);
			val.SetColor("_EmColor", Color.black);
			val.SetFloat("_EmPower", 0f);
			val.SetTexture("_EmTex", (Texture)null);
			val.SetFloat("_NormalStrength", 1f);
			val.SetTexture("_NormalTex", (Texture)null);
			return val;
		}
		return val;
	}

	public static Material InstantiateMaterial(Color color, Texture tex, Color emColor, float emPower, Texture emTex, float normStr, Texture normTex)
	{
		//IL_0037: 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)
		Material val = Object.Instantiate<Material>(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren<CharacterModel>().baseRendererInfos[0].defaultMaterial);
		if (Object.op_Implicit((Object)(object)val))
		{
			val.SetColor("_Color", color);
			val.SetTexture("_MainTex", tex);
			val.SetColor("_EmColor", emColor);
			val.SetFloat("_EmPower", emPower);
			val.SetTexture("_EmTex", emTex);
			val.SetFloat("_NormalStrength", 1f);
			val.SetTexture("_NormalTex", normTex);
			return val;
		}
		return val;
	}

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