Decompiled source of Hermit Crab v0.1.3

HermitCrab.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using EntityStates;
using EntityStates.BeetleGuardMonster;
using EntityStates.HermitCrab;
using FubukiMods.Modules;
using HG.BlendableTypes;
using KinematicCharacterController;
using Microsoft.CodeAnalysis;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.Navigation;
using RoR2.Projectile;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[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 = ".NET Standard 2.1")]
[assembly: AssemblyCompany("HermitCrab")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("HermitCrab")]
[assembly: AssemblyTitle("HermitCrab")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace FubukiMods
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Fubuki.HermitCrab", "HermitCrab", "0.1.2")]
	public class MainPlugin : BaseUnityPlugin
	{
		public const string PluginGUID = "Fubuki.HermitCrab";

		public const string PluginAuthor = "Fubuki";

		public const string PluginName = "HermitCrab";

		public const string PluginVersion = "0.1.2";

		public static GameObject hermitPrimaryProjectile;

		public static GameObject hermitSecondaryProjectile;

		public void Awake()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: 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)
			Survivors.Init();
			hermitPrimaryProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/HermitCrab/HermitCrabBombProjectile.prefab").WaitForCompletion(), "FubukiMods/HermitPrimary", true);
			ProjectileImpactExplosion component = hermitPrimaryProjectile.GetComponent<ProjectileImpactExplosion>();
			((ProjectileExplosion)component).blastRadius = ((ProjectileExplosion)component).blastRadius * 2f;
			((ProjectileExplosion)hermitPrimaryProjectile.GetComponent<ProjectileImpactExplosion>()).falloffModel = (FalloffModel)0;
			ContentAddition.AddProjectile(hermitPrimaryProjectile);
			hermitSecondaryProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/HermitCrab/HermitCrabBombProjectile.prefab").WaitForCompletion(), "FubukiMods/HermitPrimary", true);
			ProjectileImpactExplosion component2 = hermitSecondaryProjectile.GetComponent<ProjectileImpactExplosion>();
			((ProjectileExplosion)component2).blastRadius = ((ProjectileExplosion)component2).blastRadius * 3f;
			((ProjectileExplosion)hermitSecondaryProjectile.GetComponent<ProjectileImpactExplosion>()).falloffModel = (FalloffModel)0;
			ContentAddition.AddProjectile(hermitSecondaryProjectile);
		}
	}
}
namespace FubukiMods.Modules
{
	internal static class Skills
	{
		public class HermitPrimary : BaseState
		{
			private readonly float totalDuration = 1.4f;

			private float duration;

			private GameObject myBullet = MainPlugin.hermitPrimaryProjectile;

			private bool wasAnchored;

			public override void OnEnter()
			{
				//IL_00c6: 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_00cd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00df: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
				//IL_0102: Unknown result type (might be due to invalid IL or missing references)
				//IL_0106: Unknown result type (might be due to invalid IL or missing references)
				//IL_010b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0110: Unknown result type (might be due to invalid IL or missing references)
				//IL_0114: Unknown result type (might be due to invalid IL or missing references)
				//IL_011b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0135: Unknown result type (might be due to invalid IL or missing references)
				//IL_0145: Unknown result type (might be due to invalid IL or missing references)
				//IL_0154: 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_0175: Unknown result type (might be due to invalid IL or missing references)
				//IL_0182: Unknown result type (might be due to invalid IL or missing references)
				//IL_018c: 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_01be: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_022a: Unknown result type (might be due to invalid IL or missing references)
				//IL_022f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0233: Unknown result type (might be due to invalid IL or missing references)
				//IL_0235: Unknown result type (might be due to invalid IL or missing references)
				//IL_023a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0244: Unknown result type (might be due to invalid IL or missing references)
				((BaseState)this).OnEnter();
				wasAnchored = ((EntityState)this).GetComponent<HermitComponent>().isAnchored;
				HuntressTracker component = ((EntityState)this).GetComponent<HuntressTracker>();
				if (!Object.op_Implicit((Object)(object)component.GetTrackingTarget()))
				{
					((EntityState)this).outer.SetNextStateToMain();
					return;
				}
				duration = totalDuration / base.attackSpeedStat;
				if (wasAnchored)
				{
					duration *= 0.5f;
				}
				((EntityState)this).PlayCrossfade("Gesture, Additive", "FireMortar", 0f);
				Util.PlaySound(FireMortar.mortarSoundString, ((EntityState)this).gameObject);
				EffectManager.SimpleMuzzleFlash(FireMortar.mortarMuzzleflashEffect, ((EntityState)this).gameObject, FireMortar.mortarMuzzleName, false);
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					Vector3 zero = Vector3.zero;
					Vector3 val = ((Component)component.GetTrackingTarget()).transform.position + zero * 100f;
					float num = 40f;
					float num2 = num;
					Vector3 val2 = val - ((Ray)(ref aimRay)).origin;
					Vector2 val3 = default(Vector2);
					((Vector2)(ref val3))..ctor(val2.x, val2.z);
					float magnitude = ((Vector2)(ref val3)).magnitude;
					float num3 = Trajectory.CalculateInitialYSpeed(magnitude / num2, val2.y);
					Vector3 val4 = default(Vector3);
					((Vector3)(ref val4))..ctor(val3.x / magnitude * num2, num3, val3.y / magnitude * num2);
					num = ((Vector3)(ref val4)).magnitude;
					((Ray)(ref aimRay)).direction = val4 / num;
					FireProjectileInfo val5 = default(FireProjectileInfo);
					val5.position = ((Ray)(ref aimRay)).origin;
					val5.crit = ((EntityState)this).characterBody.RollCrit();
					val5.damage = 3.5f * base.damageStat;
					val5.damageColorIndex = (DamageColorIndex)0;
					val5.owner = ((EntityState)this).gameObject;
					val5.procChainMask = default(ProcChainMask);
					val5.useFuseOverride = false;
					val5.useSpeedOverride = true;
					((FireProjectileInfo)(ref val5)).speedOverride = num;
					val5.damageTypeOverride = DamageTypeCombo.op_Implicit((DamageType)512);
					val5.target = null;
					val5.projectilePrefab = myBullet;
					for (int i = 0; i < 1; i++)
					{
						Vector3 direction = ((Ray)(ref aimRay)).direction;
						val5.rotation = Quaternion.LookRotation(direction);
						ProjectileManager.instance.FireProjectile(val5);
					}
				}
				float num4 = 1f;
				((BaseState)this).AddRecoil(-0.4f * num4, -0.8f * num4, -0.3f * num4, 0.3f * num4);
				((EntityState)this).characterBody.AddSpreadBloom(1f);
				((BaseState)this).StartAimMode(2f, false);
			}

			public override void FixedUpdate()
			{
				((EntityState)this).FixedUpdate();
				if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
				{
					if (wasAnchored)
					{
						((EntityState)this).outer.SetNextState((EntityState)(object)new HermitAnchored());
					}
					else
					{
						((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)2;
			}
		}

		public class HermitSecondary : BaseState
		{
			private float duration;

			private float totalDuration = 0.75f;

			private GameObject myBullet = MainPlugin.hermitSecondaryProjectile;

			private bool wasAnchored;

			public override void OnEnter()
			{
				//IL_0080: Unknown result type (might be due to invalid IL or missing references)
				//IL_0085: Unknown result type (might be due to invalid IL or missing references)
				//IL_0088: Unknown result type (might be due to invalid IL or missing references)
				//IL_0096: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_010b: 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_0136: Unknown result type (might be due to invalid IL or missing references)
				//IL_013b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0140: Unknown result type (might be due to invalid IL or missing references)
				//IL_014a: Unknown result type (might be due to invalid IL or missing references)
				((BaseState)this).OnEnter();
				wasAnchored = ((EntityState)this).GetComponent<HermitComponent>().isAnchored;
				duration = totalDuration / base.attackSpeedStat;
				if (wasAnchored)
				{
					duration *= 0.5f;
				}
				((EntityState)this).PlayCrossfade("Gesture, Additive", "FireMortar", 0f);
				Util.PlaySound(FireMortar.mortarSoundString, ((EntityState)this).gameObject);
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					FireProjectileInfo val = default(FireProjectileInfo);
					val.position = ((EntityState)this).characterBody.corePosition;
					val.crit = ((EntityState)this).characterBody.RollCrit();
					val.damage = 6f * base.damageStat;
					val.damageColorIndex = (DamageColorIndex)0;
					val.owner = ((EntityState)this).gameObject;
					val.procChainMask = default(ProcChainMask);
					val.useFuseOverride = false;
					val.useSpeedOverride = true;
					((FireProjectileInfo)(ref val)).speedOverride = 40f;
					val.damageTypeOverride = DamageTypeCombo.op_Implicit((DamageType)33554944);
					val.target = null;
					val.projectilePrefab = myBullet;
					val.rotation = Quaternion.LookRotation(Vector3.down, Vector3.up);
					ProjectileManager.instance.FireProjectile(val);
					if (!((BaseState)this).isGrounded)
					{
						((EntityState)this).characterMotor.velocity.y = 24f;
					}
				}
				float num = 2f;
				((BaseState)this).AddRecoil(-0.4f * num, -0.8f * num, -0.3f * num, 0.3f * num);
				((EntityState)this).characterBody.AddSpreadBloom(1f);
				Util.PlaySound(((EntityState)this).sfxLocator.barkSound, ((EntityState)this).gameObject);
				((BaseState)this).StartAimMode(2f, false);
			}

			public override void FixedUpdate()
			{
				((EntityState)this).FixedUpdate();
				if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
				{
					if (wasAnchored)
					{
						((EntityState)this).outer.SetNextState((EntityState)(object)new HermitAnchored());
					}
					else
					{
						((EntityState)this).outer.SetNextStateToMain();
					}
				}
			}

			public override void OnExit()
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				((EntityState)this).transform.rotation = Quaternion.identity;
				((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)5;
			}
		}

		public class HermitUtility : BaseState
		{
			private readonly float totalDuration = 1.25f;

			private float duration;

			private Vector3 blinkDestination;

			private Vector3 blinkStart;

			private bool emerged = false;

			private bool successful = false;

			public override void OnEnter()
			{
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0076: 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_0086: 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_009f: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00db: Unknown result type (might be due to invalid IL or missing references)
				//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ec: 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_0102: 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_0111: Unknown result type (might be due to invalid IL or missing references)
				//IL_0116: Unknown result type (might be due to invalid IL or missing references)
				//IL_011d: Expected O, but got Unknown
				//IL_014f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0154: 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_0169: Unknown result type (might be due to invalid IL or missing references)
				//IL_016e: Unknown result type (might be due to invalid IL or missing references)
				//IL_018e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0193: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
				((BaseState)this).OnEnter();
				duration = totalDuration / base.attackSpeedStat * 0.75f;
				if (((BaseState)this).isGrounded)
				{
					successful = true;
					((EntityState)this).skillLocator.utility.DeductStock(1);
					((Behaviour)((EntityState)this).characterMotor).enabled = false;
					((EntityState)this).GetModelTransform().localScale = Vector3.zero;
					Vector3 val = ((EntityState)this).inputBank.moveVector * 4f * base.moveSpeedStat;
					blinkDestination = ((EntityState)this).transform.position;
					blinkStart = ((EntityState)this).transform.position;
					NodeGraph groundNodes = SceneInfo.instance.groundNodes;
					NodeIndex val2 = groundNodes.FindClosestNode(((EntityState)this).transform.position + val, ((EntityState)this).characterBody.hullClassification, float.PositiveInfinity);
					groundNodes.GetNodePosition(val2, ref blinkDestination);
					blinkDestination += ((EntityState)this).transform.position - ((EntityState)this).characterBody.footPosition;
					BlastAttack val3 = new BlastAttack();
					val3.attacker = ((EntityState)this).gameObject;
					val3.baseDamage = 0f;
					val3.baseForce = 0f;
					val3.crit = false;
					val3.damageType = DamageTypeCombo.op_Implicit((DamageType)32);
					val3.falloffModel = (FalloffModel)0;
					val3.position = ((EntityState)this).characterBody.footPosition;
					val3.procCoefficient = 0f;
					val3.radius = 25f;
					val3.teamIndex = ((BaseState)this).GetTeam();
					if (NetworkServer.active)
					{
						((EntityState)this).characterBody.AddBuff(Buffs.Immune);
						((EntityState)this).characterBody.AddBuff(Buffs.Cloak);
					}
					EffectManager.SimpleEffect(GroundSlam.slamEffectPrefab, ((EntityState)this).characterBody.footPosition, Quaternion.identity, false);
					Util.PlaySound(GroundSlam.initialAttackSoundString, ((EntityState)this).gameObject);
				}
				else
				{
					duration = 1f;
					((EntityState)this).outer.SetNextStateToMain();
				}
			}

			public override void FixedUpdate()
			{
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0041: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0082: Unknown result type (might be due to invalid IL or missing references)
				//IL_0087: Unknown result type (might be due to invalid IL or missing references)
				//IL_0099: Unknown result type (might be due to invalid IL or missing references)
				//IL_009e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b2: 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_00c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_016b: Unknown result type (might be due to invalid IL or missing references)
				((EntityState)this).FixedUpdate();
				if (successful)
				{
					if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
					{
						((EntityState)this).characterMotor.velocity = Vector3.zero;
					}
					if (!emerged)
					{
						((BaseCharacterController)((EntityState)this).characterMotor).Motor.SetPositionAndRotation(Vector3.Lerp(blinkStart, blinkDestination, ((EntityState)this).fixedAge / (duration * 0.75f)), Quaternion.identity, true);
						RaycastHit val = default(RaycastHit);
						if (Physics.Raycast(new Ray(((EntityState)this).characterBody.corePosition + Vector3.up * 40f, Vector3.down), ref val, 80f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1))
						{
							EffectManager.SimpleEffect(BurrowOut.burrowPrefab, ((RaycastHit)(ref val)).point, Quaternion.identity, false);
						}
					}
					if ((double)((EntityState)this).fixedAge >= (double)duration * 0.75 && !emerged)
					{
						((Behaviour)((EntityState)this).characterMotor).enabled = true;
						if (NetworkServer.active)
						{
							((EntityState)this).characterBody.RemoveBuff(Buffs.Immune);
							((EntityState)this).characterBody.RemoveBuff(Buffs.Cloak);
						}
						((EntityState)this).GetModelTransform().localScale = Vector3.one;
						Util.PlaySound(SpawnState.spawnSoundString, ((EntityState)this).gameObject);
						((EntityState)this).PlayAnimation("Body", "Spawn", "Spawn.playbackRate", duration * 1f, 0f);
						emerged = true;
					}
				}
				if (((EntityState)this).fixedAge >= totalDuration / base.attackSpeedStat)
				{
					if (((EntityState)this).GetComponent<HermitComponent>().isAnchored)
					{
						((EntityState)this).outer.SetNextState((EntityState)(object)new HermitAnchored());
					}
					else
					{
						((EntityState)this).outer.SetNextStateToMain();
					}
				}
			}

			public override void OnExit()
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				((EntityState)this).GetModelTransform().localScale = Vector3.one;
				((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)5;
			}
		}

		public class HermitSpecial : BaseState
		{
			private readonly float totalDuration = 1f;

			private float duration;

			private bool success = false;

			public override void OnEnter()
			{
				((BaseState)this).OnEnter();
				duration = totalDuration / base.attackSpeedStat;
				if (!((BaseState)this).isGrounded)
				{
					duration = 1f;
					((EntityState)this).outer.SetNextStateToMain();
					return;
				}
				((EntityState)this).PlayCrossfade("Body", "BurrowIn", "BurrowIn.playbackRate", duration, 0.1f);
				Util.PlaySound(BurrowIn.burrowInSoundString, ((EntityState)this).gameObject);
				EffectManager.SimpleMuzzleFlash(BurrowIn.burrowPrefab, ((EntityState)this).gameObject, "BurrowCenter", false);
				success = 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)
				((EntityState)this).FixedUpdate();
				if (((BaseState)this).isGrounded)
				{
					((EntityState)this).characterMotor.velocity = Vector3.zero;
				}
				if (((EntityState)this).fixedAge >= totalDuration / base.attackSpeedStat)
				{
					((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = 0f;
					((EntityState)this).outer.SetNextState((EntityState)(object)new HermitAnchored());
				}
			}

			public override void OnExit()
			{
				if (success)
				{
					((EntityState)this).GetComponent<HermitComponent>().isAnchored = true;
					if (NetworkServer.active)
					{
						((EntityState)this).characterBody.AddBuff(Buffs.ElephantArmorBoost);
					}
				}
				((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;
			}
		}

		public class HermitAnchored : BaseState
		{
			public override void OnEnter()
			{
				((BaseState)this).OnEnter();
				((EntityState)this).PlayCrossfade("Body", "Burrowed", 0.1f);
			}

			public override void FixedUpdate()
			{
				((EntityState)this).FixedUpdate();
				if (((EntityState)this).inputBank.skill1.down && ((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new HermitPrimary());
				}
				if (((EntityState)this).inputBank.skill2.down && ((EntityState)this).skillLocator.secondary.stock > 0 && ((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new HermitSecondary());
					((EntityState)this).skillLocator.secondary.DeductStock(1);
				}
				if (((EntityState)this).inputBank.skill3.down && ((EntityState)this).skillLocator.utility.stock > 0 && ((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new HermitUtility());
					((EntityState)this).skillLocator.utility.DeductStock(1);
				}
				if (((EntityState)this).inputBank.skill4.down && ((EntityState)this).skillLocator.special.stock > 0 && ((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new HermitUnanchor());
					((EntityState)this).skillLocator.special.DeductStock(1);
				}
			}

			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)7;
			}
		}

		public class HermitUnanchor : BaseState
		{
			private readonly float totalDuration = 0.4f;

			private float duration;

			public override void OnEnter()
			{
				((BaseState)this).OnEnter();
				((EntityState)this).GetComponent<HermitComponent>().isAnchored = false;
				if (NetworkServer.active)
				{
					((EntityState)this).characterBody.RemoveBuff(Buffs.ElephantArmorBoost);
				}
				duration = totalDuration / base.attackSpeedStat;
				((EntityState)this).PlayCrossfade("Body", "BurrowOut", "BurrowOut.playbackRate", duration * 2f, 0.1f);
				Util.PlaySound(BurrowOut.burrowOutSoundString, ((EntityState)this).gameObject);
				EffectManager.SimpleMuzzleFlash(BurrowOut.burrowPrefab, ((EntityState)this).gameObject, "BurrowCenter", false);
				((Behaviour)((EntityState)this).characterMotor).enabled = true;
				((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = 1f;
			}

			public override void FixedUpdate()
			{
				((EntityState)this).FixedUpdate();
				if (((EntityState)this).fixedAge >= totalDuration / base.attackSpeedStat)
				{
					((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)7;
			}
		}

		public class HermitComponent : MonoBehaviour
		{
			public bool isAnchored;

			public void Awake()
			{
				isAnchored = false;
			}

			public void FixedUpdate()
			{
				if (isAnchored)
				{
					((Component)this).GetComponent<CharacterMotor>().velocity.x = 0f;
					((Component)this).GetComponent<CharacterMotor>().velocity.z = 0f;
					if (((Behaviour)((Component)this).GetComponent<CharacterMotor>()).enabled)
					{
						((Behaviour)((Component)this).GetComponent<CharacterMotor>()).enabled = false;
					}
				}
				else
				{
					((Component)this).GetComponent<CharacterMotor>().mass = 100f;
				}
			}
		}
	}
	internal class Survivors
	{
		internal static void Init()
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: 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_00d2: 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_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Expected O, but got Unknown
			//IL_013c: Expected O, but got Unknown
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: 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_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0312: Unknown result type (might be due to invalid IL or missing references)
			//IL_0317: Unknown result type (might be due to invalid IL or missing references)
			//IL_032e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0333: Unknown result type (might be due to invalid IL or missing references)
			//IL_034a: Unknown result type (might be due to invalid IL or missing references)
			//IL_034f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0366: Unknown result type (might be due to invalid IL or missing references)
			//IL_036b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0382: Unknown result type (might be due to invalid IL or missing references)
			//IL_0387: Unknown result type (might be due to invalid IL or missing references)
			//IL_039f: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_044b: 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_04e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e7: 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_05bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05db: Unknown result type (might be due to invalid IL or missing references)
			//IL_0633: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0727: Unknown result type (might be due to invalid IL or missing references)
			//IL_07db: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0801: Unknown result type (might be due to invalid IL or missing references)
			//IL_0806: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Tools.CreateBody("FubukiMods/PlayerHermitCrab", "RoR2/Base/HermitCrab/HermitCrabBody.prefab");
			val.AddComponent<Skills.HermitComponent>();
			HuntressTracker val2 = val.AddComponent<HuntressTracker>();
			val2.maxTrackingAngle = 15f;
			val2.maxTrackingDistance = 1000f;
			GameObject val3 = PrefabAPI.InstantiateClone(((Component)val.GetComponent<ModelLocator>().modelBaseTransform).gameObject, "FubukiMods/PlayerHermitCrabDisplay");
			val3.transform.localScale = Vector3.one * 2f;
			val3.AddComponent<NetworkIdentity>();
			GameObject gameObject = ((Component)val.GetComponent<ModelLocator>().modelBaseTransform).gameObject;
			gameObject.transform.localScale = Vector3.one;
			val.GetComponent<CharacterBody>().aimOriginTransform.Translate(new Vector3(0f, 0f, 0f));
			val.GetComponent<Interactor>().maxInteractionDistance = 5f;
			val.GetComponent<CharacterBody>().bodyFlags = (BodyFlags)16;
			EntityStateMachine val4 = val.AddComponent<EntityStateMachine>();
			val4.customName = "Weapon";
			val4.mainStateType = new SerializableEntityStateType(typeof(Idle));
			val4.commonComponents = new CommonComponentCache(val.gameObject);
			val4.initialStateType = new SerializableEntityStateType(typeof(Idle));
			CameraTargetParams component = val.GetComponent<CameraTargetParams>();
			CharacterCameraParams val5 = new CharacterCameraParams();
			CharacterCameraParams val6 = val5;
			component.cameraParams = val5;
			CharacterCameraParams val7 = val6;
			val7.data.idealLocalCameraPos = BlendableVector3.op_Implicit(new Vector3(0f, 0.5f, -12f));
			val7.data.pivotVerticalOffset = BlendableFloat.op_Implicit(2f);
			val.GetComponent<SetStateOnHurt>().canBeHitStunned = false;
			CharacterBody component2 = val.GetComponent<CharacterBody>();
			component2.baseDamage = 12f;
			component2.levelDamage = component2.baseDamage * 0.2f;
			component2.baseCrit = 1f;
			component2.levelCrit = 0f;
			component2.baseMaxHealth = 120f;
			component2.levelMaxHealth = component2.baseMaxHealth * 0.3f;
			component2.baseMaxShield = 0f;
			component2.levelMaxShield = 0f;
			component2.baseArmor = 0f;
			component2.levelArmor = 0f;
			component2.baseRegen = 1f;
			component2.levelRegen = component2.baseRegen * 0.2f;
			component2.baseMoveSpeed = 7f;
			component2.levelMoveSpeed = 0f;
			component2.baseAcceleration = 80f;
			component2.baseJumpCount = 1;
			component2.baseJumpPower = 15f;
			component2.baseAttackSpeed = 1f;
			component2.baseNameToken = "Hermit Crab Survivor";
			Color[] palette = (Color[])(object)new Color[16]
			{
				new Color(0.4f, 0.2f, 0f),
				new Color(0.55f, 0.4f, 0.3f),
				new Color(0.85f, 0.6f, 0.4f),
				new Color(0.3f, 0.05f, 0f),
				new Color(0.6f, 0.3f, 0.25f),
				new Color(0.7f, 0.4f, 0.35f),
				new Color(0f, 0.05f, 0.25f),
				new Color(0.25f, 0.35f, 0.55f),
				new Color(0.5f, 0.6f, 0.9f),
				new Color(0.8f, 0.85f, 1f),
				default(Color),
				default(Color),
				default(Color),
				default(Color),
				default(Color),
				new Color(0f, 0f, 0f, 0f)
			};
			ContentAddition.AddBody(val);
			bool flag = default(bool);
			ContentAddition.AddEntityState<Skills.HermitPrimary>(ref flag);
			SkillDef val8 = ScriptableObject.CreateInstance<SkillDef>();
			val8.activationState = new SerializableEntityStateType(typeof(Skills.HermitPrimary));
			val8.activationStateMachineName = "Weapon";
			val8.baseMaxStock = 1;
			val8.baseRechargeInterval = 1f;
			val8.beginSkillCooldownOnSkillEnd = true;
			val8.canceledFromSprinting = false;
			val8.cancelSprintingOnActivation = true;
			val8.dontAllowPastMaxStocks = false;
			val8.forceSprintDuringState = false;
			val8.fullRestockOnAssign = true;
			val8.interruptPriority = (InterruptPriority)1;
			val8.isCombatSkill = true;
			val8.mustKeyPress = false;
			val8.rechargeStock = val8.baseMaxStock;
			val8.requiredStock = 1;
			val8.stockToConsume = 0;
			val8.skillDescriptionToken = "Fire a projectile at the target that deals <style=cIsDamage>350% damage</style> and causes <style=cIsDamage>splash damage</style>, <style=cIsUtility>slowing</style> targets that are caught in the splash.";
			val8.skillName = "HERMIT_PRIMARY";
			val8.skillNameToken = "Artillery";
			val8.icon = Tools.SpriteFromString("0000000000000001000006666660001000006667876661100000677666676600000668666666786000068666666668661106766666666766001666666666667600067666666666860006866666666676066067666667676606861667887676600060116666666000000116611000100001116676100601001116666111000100", palette);
			Tools.AddSkill(val, val8);
			ContentAddition.AddEntityState<Skills.HermitSecondary>(ref flag);
			SkillDef val9 = ScriptableObject.CreateInstance<SkillDef>();
			val9.activationState = new SerializableEntityStateType(typeof(Skills.HermitSecondary));
			val9.activationStateMachineName = "Weapon";
			val9.baseMaxStock = 1;
			val9.baseRechargeInterval = 5f;
			val9.beginSkillCooldownOnSkillEnd = true;
			val9.canceledFromSprinting = false;
			val9.cancelSprintingOnActivation = false;
			val9.dontAllowPastMaxStocks = false;
			val9.forceSprintDuringState = true;
			val9.fullRestockOnAssign = true;
			val9.interruptPriority = (InterruptPriority)2;
			val9.isCombatSkill = true;
			val9.mustKeyPress = false;
			val9.rechargeStock = val9.baseMaxStock;
			val9.requiredStock = 1;
			val9.stockToConsume = 1;
			val9.skillDescriptionToken = "Expell a burst that <style=cIsUtility>roots</style> enemies on hit, and deals <style=cIsDamage>???% damage</style>.";
			val9.skillName = "HERMIT_SECONDARY";
			val9.skillNameToken = "Spout";
			val9.icon = Tools.SpriteFromString("0000676000000000000006600000068600000066000067690000000600006676660000060006676698660000006666607776600060666600666766000666600000666760066600000000066067600000000000606660700067660066760600000067860676606666000678668666776000666786976786666677899697987777", palette);
			Tools.AddSkill(val, val9, "secondary");
			ContentAddition.AddEntityState<Skills.HermitUtility>(ref flag);
			SkillDef val10 = ScriptableObject.CreateInstance<SkillDef>();
			val10.activationState = new SerializableEntityStateType(typeof(Skills.HermitUtility));
			val10.activationStateMachineName = "Body";
			val10.baseMaxStock = 1;
			val10.baseRechargeInterval = 6f;
			val10.beginSkillCooldownOnSkillEnd = true;
			val10.canceledFromSprinting = false;
			val10.cancelSprintingOnActivation = false;
			val10.dontAllowPastMaxStocks = false;
			val10.forceSprintDuringState = true;
			val10.fullRestockOnAssign = true;
			val10.interruptPriority = (InterruptPriority)2;
			val10.isCombatSkill = false;
			val10.mustKeyPress = false;
			val10.rechargeStock = val10.baseMaxStock;
			val10.requiredStock = 1;
			val10.stockToConsume = 0;
			val10.skillDescriptionToken = "Burrow into the ground and move to a nearby location. <style=cIsUtility>Breaks enemy line-of-sight</style>.";
			val10.skillName = "HERMIT_UTILITY";
			val10.skillNameToken = "Reposition";
			val10.icon = Tools.SpriteFromString("6666666660006661666666602106601066666601006600666666600006600666066600210000106100060100002106101220006406106106112200446600006611122034460222110111223344221000601122112220000066022222211206666622221222112066602100111000020660100600100666660106666000006666", palette);
			Tools.AddSkill(val, val10, "utility");
			ContentAddition.AddEntityState<Skills.HermitSpecial>(ref flag);
			SkillDef val11 = ScriptableObject.CreateInstance<SkillDef>();
			val11.activationState = new SerializableEntityStateType(typeof(Skills.HermitSpecial));
			val11.activationStateMachineName = "Body";
			val11.baseMaxStock = 1;
			val11.baseRechargeInterval = 0.5f;
			val11.beginSkillCooldownOnSkillEnd = false;
			val11.canceledFromSprinting = false;
			val11.cancelSprintingOnActivation = true;
			val11.dontAllowPastMaxStocks = true;
			val11.forceSprintDuringState = false;
			val11.fullRestockOnAssign = true;
			val11.interruptPriority = (InterruptPriority)2;
			val11.isCombatSkill = false;
			val11.mustKeyPress = false;
			val11.rechargeStock = val11.baseMaxStock;
			val11.requiredStock = 1;
			val11.stockToConsume = 0;
			val11.skillDescriptionToken = "Anchor yourself to the ground, <style=cIsUtility>increasing your defense</style> and <style=cIsUtility>doubling your attack speed</style>. <style=cIsHealth>(You can not move while anchored)</style>";
			val11.skillName = "HERMIT_SPECIAL";
			val11.skillNameToken = "Burrow";
			val11.icon = Tools.SpriteFromString("6633300000033366633300044000333633000053350003363300005554000336330060555400033363000645440003336330064544000333633003444430003333000344443000003300033344400000300033444443000030003444444606030003444446466000003344334466345043344344346635443434444444463440", palette);
			Tools.AddSkill(val, val11, "special");
			SurvivorDef val12 = ScriptableObject.CreateInstance<SurvivorDef>();
			val12.bodyPrefab = val;
			val12.descriptionToken = "Hermit Crab is... an actual crab!! <style=cSub>\r\n\r\n < ! > Tips go here." + Environment.NewLine;
			val12.displayPrefab = val3;
			val12.displayPrefab.transform.localScale = Vector3.one * 0.3f;
			val12.primaryColor = new Color(0.9f, 0.8f, 0.2f);
			val12.desiredSortPosition = 44.44f;
			val12.displayNameToken = "Hermit Crab";
			ContentAddition.AddSurvivorDef(val12);
		}
	}
	internal static class Tools
	{
		internal static int Hex2Num(string hex)
		{
			int result = 0;
			hex = hex.ToUpper();
			switch (hex)
			{
			case "1":
				result = 1;
				break;
			case "2":
				result = 2;
				break;
			case "3":
				result = 3;
				break;
			case "4":
				result = 4;
				break;
			case "5":
				result = 5;
				break;
			case "6":
				result = 6;
				break;
			case "7":
				result = 7;
				break;
			case "8":
				result = 8;
				break;
			case "9":
				result = 9;
				break;
			case "A":
				result = 10;
				break;
			case "B":
				result = 11;
				break;
			case "C":
				result = 12;
				break;
			case "D":
				result = 13;
				break;
			case "E":
				result = 14;
				break;
			case "F":
				result = 15;
				break;
			}
			return result;
		}

		internal static string Num2Hex(int num)
		{
			string result = "0";
			switch (num)
			{
			case 1:
				result = "1";
				break;
			case 2:
				result = "2";
				break;
			case 3:
				result = "3";
				break;
			case 4:
				result = "4";
				break;
			case 5:
				result = "5";
				break;
			case 6:
				result = "6";
				break;
			case 7:
				result = "7";
				break;
			case 8:
				result = "8";
				break;
			case 9:
				result = "9";
				break;
			case 10:
				result = "A";
				break;
			case 11:
				result = "B";
				break;
			case 12:
				result = "C";
				break;
			case 13:
				result = "D";
				break;
			case 14:
				result = "E";
				break;
			case 15:
				result = "F";
				break;
			}
			return result;
		}

		public static Sprite SpriteFromString(string texture, Color[] palette, bool Flipped = false)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			int num = (int)Math.Floor(Math.Pow(texture.Length, 0.5));
			Texture2D val = new Texture2D(num, num, (TextureFormat)4, false);
			((Texture)val).filterMode = (FilterMode)0;
			((Texture)val).wrapMode = (TextureWrapMode)1;
			int num2 = 0;
			int i = 0;
			int num3 = 0;
			for (; i < num; i++)
			{
				for (num2 = 0; num2 < num; num2++)
				{
					if (!Flipped)
					{
						val.SetPixel(num - 1 - num2, i, palette[Hex2Num(texture.Substring(num3, 1))]);
					}
					else
					{
						val.SetPixel(num2, num - 1 - i, palette[Hex2Num(texture.Substring(num3, 1))]);
					}
					num3++;
				}
			}
			val.Apply();
			return Sprite.Create(val, new Rect((float)num, (float)num, (float)(-num), (float)(-num)), new Vector2((float)num * 0.5f, (float)num * 0.5f), (float)num);
		}

		internal static GameObject VoxelSprite(string texture, Color[] palette, Transform rootTransform)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0029: 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_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject();
			val.transform.parent = rootTransform;
			val.transform.localPosition = new Vector3(0f, 0f, 0f);
			val.transform.localScale = new Vector3(0.25f, 0.25f, 0.25f);
			int num = -4;
			int i = -4;
			int num2 = 0;
			for (; i < 4; i++)
			{
				for (num = -4; num < 4; num++)
				{
					if (Hex2Num(texture.Substring(num2, 1)) != 0)
					{
						GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)3);
						((Renderer)val2.GetComponent<MeshRenderer>()).material.shader = Resources.Load<Shader>("Shaders/Deferred/HGStandard");
						val2.transform.parent = val.transform;
						val2.transform.localPosition = new Vector3((float)(-num) - 0.5f, (float)(-i), 0f);
						val2.transform.localScale = new Vector3(1f, 1f, 1f);
						val2.transform.localRotation = Quaternion.identity;
						val2.GetComponent<Renderer>().material.color = palette[Hex2Num(texture.Substring(num2, 1))];
						val2.gameObject.layer = LayerIndex.noCollision.intVal;
					}
					num2++;
				}
			}
			return val;
		}

		internal static GameObject CreateBody(string BodyName, string BodyDirectory = "RoR2/Base/Commando/CommandoBody.prefab")
		{
			//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)
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)BodyDirectory).WaitForCompletion();
			GameObject val2 = PrefabAPI.InstantiateClone(val, "FubukiMods/" + BodyName);
			KinematicCharacterMotor component = val2.GetComponent<KinematicCharacterMotor>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.playerCharacter = true;
			}
			GenericSkill[] componentsInChildren = val2.GetComponentsInChildren<GenericSkill>();
			foreach (GenericSkill val3 in componentsInChildren)
			{
				Object.DestroyImmediate((Object)(object)val3);
			}
			SkillLocator component2 = val2.GetComponent<SkillLocator>();
			Reflection.SetFieldValue<GenericSkill[]>((object)component2, "allSkills", (GenericSkill[])(object)new GenericSkill[0]);
			component2.primary = val2.AddComponent<GenericSkill>();
			SkillFamily val4 = ScriptableObject.CreateInstance<SkillFamily>();
			val4.variants = (Variant[])(object)new Variant[1];
			ContentAddition.AddSkillFamily(val4);
			Reflection.SetFieldValue<SkillFamily>((object)component2.primary, "_skillFamily", val4);
			component2.secondary = val2.AddComponent<GenericSkill>();
			SkillFamily val5 = ScriptableObject.CreateInstance<SkillFamily>();
			val5.variants = (Variant[])(object)new Variant[1];
			ContentAddition.AddSkillFamily(val5);
			Reflection.SetFieldValue<SkillFamily>((object)component2.secondary, "_skillFamily", val5);
			component2.utility = val2.AddComponent<GenericSkill>();
			SkillFamily val6 = ScriptableObject.CreateInstance<SkillFamily>();
			val6.variants = (Variant[])(object)new Variant[1];
			ContentAddition.AddSkillFamily(val6);
			Reflection.SetFieldValue<SkillFamily>((object)component2.utility, "_skillFamily", val6);
			component2.special = val2.AddComponent<GenericSkill>();
			SkillFamily val7 = ScriptableObject.CreateInstance<SkillFamily>();
			val7.variants = (Variant[])(object)new Variant[1];
			ContentAddition.AddSkillFamily(val7);
			Reflection.SetFieldValue<SkillFamily>((object)component2.special, "_skillFamily", val7);
			return val2;
		}

		internal static bool CreateIDR(List<KeyAssetRuleGroup> ItemDisplayRules, ItemDef Item)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			ItemDisplayRules.Add(new KeyAssetRuleGroup
			{
				keyAsset = (Object)(object)Item,
				displayRuleGroup = new DisplayRuleGroup
				{
					rules = (ItemDisplayRule[])(object)new ItemDisplayRule[1]
					{
						new ItemDisplayRule
						{
							ruleType = (ItemDisplayRuleType)0,
							followerPrefab = null,
							childName = "Muzzle",
							localPos = new Vector3(0f, 0.2091f, -0.3642f),
							localAngles = new Vector3(0f, 0f, 0f),
							localScale = new Vector3(0.15f, 0.15f, 0.15f),
							limbMask = (LimbFlags)0
						}
					}
				}
			});
			return true;
		}

		internal static void AddIDR(string AttachPoint, Vector3 Position, Vector3 Rotation, Vector3 Scale)
		{
		}

		internal static bool AddSkill(GameObject Body, SkillDef SkillDef, string Slot = "primary", int Variant = 0)
		{
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Expected O, but got Unknown
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Expected O, but got Unknown
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			ContentAddition.AddSkillDef(SkillDef);
			SkillLocator component = Body.GetComponent<SkillLocator>();
			Reflection.SetFieldValue<GenericSkill[]>((object)component, "allSkills", (GenericSkill[])(object)new GenericSkill[0]);
			GenericSkill val;
			if (Slot.ToLower() == "primary")
			{
				val = component.primary;
			}
			else if (Slot.ToLower() == "secondary")
			{
				val = component.secondary;
			}
			else if (Slot.ToLower() == "utility")
			{
				val = component.utility;
			}
			else
			{
				if (!(Slot.ToLower() == "special"))
				{
					MonoBehaviour.print((object)"[FUBUKI ERROR:] Unrecognized slot.");
					return false;
				}
				val = component.special;
			}
			Variant val2;
			if (Variant == 0)
			{
				SkillFamily skillFamily = val.skillFamily;
				Variant[] variants = skillFamily.variants;
				val2 = new Variant
				{
					skillDef = SkillDef
				};
				((Variant)(ref val2)).viewableNode = new Node(SkillDef.skillName + "_TEST", false, (Node)null);
				variants[0] = val2;
				MonoBehaviour.print((object)("Skill Added: " + Slot + " - " + SkillDef.skillName));
				return true;
			}
			SkillFamily skillFamily2 = val.skillFamily;
			Array.Resize(ref skillFamily2.variants, skillFamily2.variants.Length + 1);
			Variant[] variants2 = skillFamily2.variants;
			val2 = new Variant
			{
				skillDef = SkillDef
			};
			((Variant)(ref val2)).viewableNode = new Node(SkillDef.skillName + "_TEST", false, (Node)null);
			variants2[Variant] = val2;
			MonoBehaviour.print((object)("Alt Skill Added: " + Slot + " - " + SkillDef.skillName));
			return true;
		}
	}
}