Decompiled source of TestChar v1.1.5

plugins/BastionMod.dll

Decompiled 4 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BastionMod.Modules;
using BastionMod.Modules.Achievements;
using BastionMod.Modules.Characters;
using BastionMod.Survivors.Bastion;
using BastionMod.Survivors.Bastion.Achievements;
using BastionMod.Survivors.Bastion.Components;
using BastionMod.Survivors.Bastion.SkillStates;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.AI.Walker;
using EntityStates.Commando.CommandoWeapon;
using EntityStates.Drone.DroneWeapon;
using EntityStates.FalseSonBoss;
using EntityStates.Huntress;
using HG;
using HG.BlendableTypes;
using Microsoft.CodeAnalysis;
using On.RoR2;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using RoR2;
using RoR2.Achievements;
using RoR2.Audio;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Navigation;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using RoR2BepInExPack.GameAssetPathsBetter;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyCompany("BastionMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+d3749b505c19c0395cc591c0e46c627b97c2b725")]
[assembly: AssemblyProduct("BastionMod")]
[assembly: AssemblyTitle("BastionMod")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace BastionMod
{
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.HasteReapr.BastionMod", "BastionMod", "1.1.5")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class BastionPlugin : BaseUnityPlugin
	{
		public const string MODUID = "com.HasteReapr.BastionMod";

		public const string MODNAME = "BastionMod";

		public const string MODVERSION = "1.1.5";

		public const string DEVELOPER_PREFIX = "HASTEREAPR";

		public static BastionPlugin instance;

		internal static string bodyName = "BastionRobot";

		internal static BodyIndex bodyIndex => BodyCatalog.FindBodyIndex(bodyName);

		private void Awake()
		{
			instance = this;
			Log.Init(((BaseUnityPlugin)this).Logger);
			Language.Init();
			new BastionSurvivor().Initialize();
			new ContentPacks().Initialize();
			Hook();
			BastionModdedDisplayHider.Init();
			BastionHitboxDiag.Init();
			BastionSounds.Init();
			BastionCompat.Init();
			Language.WriteTranslationTemplate();
		}

		private void Hook()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
			SceneDirector.Start += new hook_Start(SceneDirector_Start);
		}

		private void SceneDirector_Start(orig_Start orig, SceneDirector self)
		{
			//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_004a: 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)
			orig.Invoke(self);
			Scene activeScene = SceneManager.GetActiveScene();
			string name = ((Scene)(ref activeScene)).name;
			if (NetworkServer.active && name == "foggyswamp" && !((Object)(object)BastionAssets.bas10Interactable == (Object)null))
			{
				NetworkServer.Spawn(Object.Instantiate<GameObject>(BastionAssets.bas10Interactable, new Vector3(128.675f, -111.2f, -72.7934f), Quaternion.Euler(0f, 120f, 0f)));
			}
		}

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (!Object.op_Implicit((Object)(object)self) || !self.HasBuff(BastionBuffs.turretRootDef))
			{
				return;
			}
			if (BastionTank.IsTank(self))
			{
				if (self.isSprinting && self.sprintingSpeedMultiplier > 0f)
				{
					self.moveSpeed /= self.sprintingSpeedMultiplier;
				}
				self.moveSpeed *= 0.6f;
				self.jumpPower = 0f;
				self.maxJumpCount = 0;
			}
			else
			{
				self.moveSpeed = 0f;
			}
			self.acceleration = 80f;
		}
	}
	internal static class Log
	{
		internal static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void Debug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void Error(object data)
		{
			_logSource.LogError(data);
		}

		internal static void ErrorAssetBundle(string assetName, string bundleName)
		{
			Error("failed to load asset, " + assetName + ", because it does not exist in asset bundle, " + bundleName);
		}

		internal static void Fatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
}
namespace BastionMod.Survivors.Bastion
{
	public class ArtilleryEntryGateSkillDef : SkillDef
	{
		public override bool CanExecute(GenericSkill skillSlot)
		{
			if (ArtilleryGateOpen(skillSlot))
			{
				return ((SkillDef)this).CanExecute(skillSlot);
			}
			return false;
		}

		public override bool IsReady(GenericSkill skillSlot)
		{
			if (((SkillDef)this).IsReady(skillSlot))
			{
				return ArtilleryGateOpen(skillSlot);
			}
			return false;
		}

		private static bool ArtilleryGateOpen(GenericSkill skillSlot)
		{
			BastionController bastionController = (Object.op_Implicit((Object)(object)skillSlot) ? ((Component)skillSlot).GetComponent<BastionController>() : null);
			if (!Object.op_Implicit((Object)(object)bastionController))
			{
				return true;
			}
			return bastionController.GetStoredSpecialCooldownRemaining() <= 0f;
		}
	}
	public static class BastionAI
	{
		public static void Init(GameObject bodyPrefab, string masterName)
		{
			//IL_0035: 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_00cb: 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_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: 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_019e: 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_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: 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_022a: 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_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			GameObject obj = Prefabs.CreateBlankMasterPrefab(bodyPrefab, masterName);
			BaseAI component = obj.GetComponent<BaseAI>();
			component.aimVectorDampTime = 0.1f;
			component.aimVectorMaxSpeed = 360f;
			AISkillDriver obj2 = obj.AddComponent<AISkillDriver>();
			obj2.customName = "Use Primary Swing";
			obj2.skillSlot = (SkillSlot)0;
			obj2.requiredSkill = null;
			obj2.requireSkillReady = false;
			obj2.requireEquipmentReady = false;
			obj2.minUserHealthFraction = float.NegativeInfinity;
			obj2.maxUserHealthFraction = float.PositiveInfinity;
			obj2.minTargetHealthFraction = float.NegativeInfinity;
			obj2.maxTargetHealthFraction = float.PositiveInfinity;
			obj2.minDistance = 0f;
			obj2.maxDistance = 8f;
			obj2.selectionRequiresTargetLoS = false;
			obj2.selectionRequiresOnGround = false;
			obj2.selectionRequiresAimTarget = false;
			obj2.maxTimesSelected = -1;
			obj2.moveTargetType = (TargetType)0;
			obj2.activationRequiresTargetLoS = false;
			obj2.activationRequiresAimTargetLoS = false;
			obj2.activationRequiresAimConfirmation = false;
			obj2.movementType = (MovementType)1;
			obj2.moveInputScale = 1f;
			obj2.aimType = (AimType)1;
			obj2.ignoreNodeGraph = false;
			obj2.shouldSprint = false;
			obj2.shouldFireEquipment = false;
			obj2.buttonPressType = (ButtonPressType)0;
			obj2.driverUpdateTimerOverride = -1f;
			obj2.resetCurrentEnemyOnNextDriverSelection = false;
			obj2.noRepeat = false;
			obj2.nextHighPriorityOverride = null;
			AISkillDriver obj3 = obj.AddComponent<AISkillDriver>();
			obj3.customName = "Use Secondary Shoot";
			obj3.skillSlot = (SkillSlot)1;
			obj3.requireSkillReady = true;
			obj3.minDistance = 0f;
			obj3.maxDistance = 25f;
			obj3.selectionRequiresTargetLoS = false;
			obj3.selectionRequiresOnGround = false;
			obj3.selectionRequiresAimTarget = false;
			obj3.maxTimesSelected = -1;
			obj3.moveTargetType = (TargetType)0;
			obj3.activationRequiresTargetLoS = false;
			obj3.activationRequiresAimTargetLoS = false;
			obj3.activationRequiresAimConfirmation = true;
			obj3.movementType = (MovementType)1;
			obj3.moveInputScale = 1f;
			obj3.aimType = (AimType)1;
			obj3.buttonPressType = (ButtonPressType)0;
			AISkillDriver obj4 = obj.AddComponent<AISkillDriver>();
			obj4.customName = "Use Utility Roll";
			obj4.skillSlot = (SkillSlot)2;
			obj4.requireSkillReady = true;
			obj4.minDistance = 8f;
			obj4.maxDistance = 20f;
			obj4.selectionRequiresTargetLoS = true;
			obj4.selectionRequiresOnGround = false;
			obj4.selectionRequiresAimTarget = false;
			obj4.maxTimesSelected = -1;
			obj4.moveTargetType = (TargetType)0;
			obj4.activationRequiresTargetLoS = false;
			obj4.activationRequiresAimTargetLoS = false;
			obj4.activationRequiresAimConfirmation = false;
			obj4.movementType = (MovementType)2;
			obj4.moveInputScale = 1f;
			obj4.aimType = (AimType)1;
			obj4.buttonPressType = (ButtonPressType)0;
			AISkillDriver obj5 = obj.AddComponent<AISkillDriver>();
			obj5.customName = "Use Special bomb";
			obj5.skillSlot = (SkillSlot)3;
			obj5.requireSkillReady = true;
			obj5.minDistance = 0f;
			obj5.maxDistance = 20f;
			obj5.selectionRequiresTargetLoS = false;
			obj5.selectionRequiresOnGround = false;
			obj5.selectionRequiresAimTarget = false;
			obj5.maxTimesSelected = -1;
			obj5.moveTargetType = (TargetType)0;
			obj5.activationRequiresTargetLoS = false;
			obj5.activationRequiresAimTargetLoS = false;
			obj5.activationRequiresAimConfirmation = false;
			obj5.movementType = (MovementType)1;
			obj5.moveInputScale = 1f;
			obj5.aimType = (AimType)1;
			obj5.buttonPressType = (ButtonPressType)0;
			AISkillDriver obj6 = obj.AddComponent<AISkillDriver>();
			obj6.customName = "Chase";
			obj6.skillSlot = (SkillSlot)(-1);
			obj6.requireSkillReady = false;
			obj6.minDistance = 0f;
			obj6.maxDistance = float.PositiveInfinity;
			obj6.moveTargetType = (TargetType)0;
			obj6.activationRequiresTargetLoS = false;
			obj6.activationRequiresAimTargetLoS = false;
			obj6.activationRequiresAimConfirmation = false;
			obj6.movementType = (MovementType)1;
			obj6.moveInputScale = 1f;
			obj6.aimType = (AimType)1;
			obj6.buttonPressType = (ButtonPressType)0;
		}
	}
	public static class BastionAssets
	{
		[RequireComponent(typeof(ProjectileController))]
		internal class DroneShellImpact : MonoBehaviour, IProjectileImpactBehavior
		{
			public int droneCount = 4;

			public void OnProjectileImpact(ProjectileImpactInfo impactInfo)
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0058: 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_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_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_0072: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: Unknown result type (might be due to invalid IL or missing references)
				//IL_0075: Unknown result type (might be due to invalid IL or missing references)
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0080: Unknown result type (might be due to invalid IL or missing references)
				//IL_0086: Unknown result type (might be due to invalid IL or missing references)
				//IL_0092: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
				ProjectileController component = ((Component)this).GetComponent<ProjectileController>();
				Vector3 position = ((Component)component).transform.position;
				int num = droneCount;
				Vector3 val = default(Vector3);
				for (int i = 0; i < num; i++)
				{
					float num2 = 3f;
					float num3 = MathF.PI * 2f / (float)num;
					((Vector3)(ref val))..ctor(Mathf.Cos(num3 * (float)i) * num2, 0.25f, Mathf.Sin(num3 * (float)i) * num2);
					Vector3 position2 = position + val;
					Inventory component2 = ((Component)new MasterSummon
					{
						masterPrefab = gunnerDroneMaster,
						position = position2,
						rotation = default(Quaternion),
						summonerBodyObject = component.owner,
						ignoreTeamMemberLimit = true,
						useAmbientLevel = true,
						enablePrintController = true
					}.Perform()).GetComponent<Inventory>();
					if (Object.op_Implicit((Object)(object)component2))
					{
						component2.GiveItemPermanent(Items.HealthDecay, 20);
					}
				}
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}

		private static AssetBundle _assetBundle;

		public static GameObject explosion;

		public static GameObject bombardShell;

		public static GameObject artilleryShell;

		public static GameObject droneShell;

		public static GameObject grenadeProjectile;

		public static GameObject grenadeArcVisualizer;

		public static GameObject gunnerDroneMaster;

		public static GameObject gunnerDronePrefab;

		public static GameObject healVFX;

		public static GameObject sparksEffect;

		public static GameObject activateEffect;

		public static GameObject bas10Interactable;

		public static GameObject ganymedePrefab;

		public static RuntimeAnimatorController ganymedeController;

		public static RuntimeAnimatorController ganymedePerchController;

		public static void Init(AssetBundle assetBundle)
		{
			//IL_003a: 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_0123: Expected O, but got Unknown
			_assetBundle = assetBundle;
			bas10Interactable = _assetBundle.LoadAsset<GameObject>("BastionUnlockable");
			bas10Interactable.AddComponent<BastionInteractableComponent>();
			PurchaseInteraction component = bas10Interactable.GetComponent<PurchaseInteraction>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.costType = (CostTypeIndex)0;
				component.cost = 0;
				component.automaticallyScaleCostWithDifficulty = false;
			}
			ganymedePrefab = _assetBundle.LoadAsset<GameObject>("ganamede");
			if (Object.op_Implicit((Object)(object)ganymedePrefab))
			{
				Asset.ConvertAllRenderersToHopooShader(ganymedePrefab);
			}
			ganymedeController = _assetBundle.LoadAsset<RuntimeAnimatorController>("bird");
			if ((Object)(object)ganymedeController != (Object)null)
			{
				AnimationClip val = null;
				AnimationClip val2 = null;
				AnimationClip[] animationClips = ganymedeController.animationClips;
				foreach (AnimationClip val3 in animationClips)
				{
					if (!((Object)(object)val3 == (Object)null))
					{
						if (((Object)val3).name.Contains("Flap"))
						{
							val = val3;
						}
						else if (((Object)val3).name.Contains("Perch"))
						{
							val2 = val3;
						}
					}
				}
				if ((Object)(object)val != (Object)null && (Object)(object)val2 != (Object)null)
				{
					ganymedePerchController = (RuntimeAnimatorController)new AnimatorOverrideController(ganymedeController) { [val] = val2 };
				}
			}
			CreateEffects();
			CreateProjectiles();
			CreateMinions();
		}

		private static void CreateMinions()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			gunnerDronePrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Drones.Drone1Body_prefab).WaitForCompletion(), "BastionGunnerDrone", true);
			Transform transform = gunnerDronePrefab.transform;
			transform.localScale *= 0.6f;
			CharacterBody component = gunnerDronePrefab.GetComponent<CharacterBody>();
			component.baseNameToken = "HASTEREAPR_BASTION_TEMPORARY_DRONE";
			component.baseMaxHealth = 50f;
			component.baseAttackSpeed = 5f;
			component.baseMoveSpeed = 40f;
			component.baseAcceleration = 24f;
			component.baseDamage = 2f;
			gunnerDronePrefab.GetComponent<CharacterDeathBehavior>().deathState = new SerializableEntityStateType(typeof(BastionMinionDeath));
			gunnerDroneMaster = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Drones.Drone1Master_prefab).WaitForCompletion(), "BastionGunnerDroneMaster", true);
			gunnerDroneMaster.GetComponent<CharacterMaster>().bodyPrefab = gunnerDronePrefab;
		}

		private static void CreateEffects()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			explosion = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Common_VFX.ExplosionVFX_prefab).WaitForCompletion(), "BastionExplosion", false);
			Content.CreateAndAddEffectDef(explosion);
			sparksEffect = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Common_VFX.Hitspark1_prefab).WaitForCompletion();
			activateEffect = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Common_VFX.LevelUpEffect_prefab).WaitForCompletion();
			CreateHealing();
		}

		private static void CreateHealing()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			healVFX = _assetBundle.LoadEffect("healing");
			Material material = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)RoR2_Base_Common_VFX.matHealingCross_mat).WaitForCompletion());
			((Renderer)((Component)healVFX.transform.Find("particle")).GetComponent<ParticleSystemRenderer>()).material = material;
		}

		private static void CreateProjectiles()
		{
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			bombardShell = _assetBundle.LoadAsset<GameObject>("bombardShell");
			ProjectileImpactExplosion component = bombardShell.GetComponent<ProjectileImpactExplosion>();
			component.impactEffect = explosion;
			bombardShell.AddComponent<BastionBombardShellComponent>();
			artilleryShell = PrefabAPI.InstantiateClone(_assetBundle.LoadAsset<GameObject>("bombardShell"), "artilleryShell");
			ProjectileImpactExplosion component2 = artilleryShell.GetComponent<ProjectileImpactExplosion>();
			component.impactEffect = explosion;
			((ProjectileExplosion)component2).blastRadius = ((ProjectileExplosion)component2).blastRadius * 0.65f;
			Content.AddProjectilePrefab(bombardShell);
			droneShell = PrefabAPI.InstantiateClone(_assetBundle.LoadAsset<GameObject>("bombardShell"), "droneShell");
			ProjectileImpactExplosion component3 = droneShell.GetComponent<ProjectileImpactExplosion>();
			((ProjectileExplosion)component3).blastRadius = 0f;
			((ProjectileExplosion)component3).blastDamageCoefficient = 0f;
			droneShell.AddComponent<DroneShellImpact>();
			Content.AddProjectilePrefab(droneShell);
			grenadeProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Commando.CommandoGrenadeProjectile_prefab).WaitForCompletion(), "BastionGrenadeProjectile", true);
			ProjectileImpactExplosion component4 = grenadeProjectile.GetComponent<ProjectileImpactExplosion>();
			component4.destroyOnEnemy = false;
			component4.detonateOnEnemy = false;
			component4.destroyOnWorld = false;
			component4.timerAfterImpact = false;
			component4.lifetime = 5f;
			grenadeProjectile.AddComponent<BastionGrenadeKnockback>();
			Content.AddProjectilePrefab(grenadeProjectile);
			grenadeArcVisualizer = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Common_VFX.BasicThrowableVisualizer_prefab).WaitForCompletion();
		}
	}
	public static class BastionAttachmentPoints
	{
		private static readonly (string anchor, string bone)[] points = new(string, string)[11]
		{
			("Head", "Head"),
			("Chest", "Torso"),
			("Back", "Torso"),
			("ShoulderL", "Shoulder.L"),
			("ShoulderR", "Shoulder.R"),
			("Pelvis", "Waist"),
			("GunArm", "GunArm"),
			("HandArm", "HandArm"),
			("Turret", "Turret"),
			("FootL", "Ankle.L"),
			("FootR", "Ankle.R")
		};

		public static void AddTo(CharacterModel model)
		{
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Expected O, but got Unknown
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: 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_0158: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)model))
			{
				return;
			}
			ChildLocator component = ((Component)model).GetComponent<ChildLocator>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				Log.Warning("AttachmentPoints: model has no ChildLocator");
				return;
			}
			List<NameTransformPair> list = new List<NameTransformPair>((IEnumerable<NameTransformPair>)(((object)component.transformPairs) ?? ((object)new NameTransformPair[0])));
			(string, string)[] array = points;
			for (int i = 0; i < array.Length; i++)
			{
				var (anchor, text) = array[i];
				if (!list.Exists((NameTransformPair p) => p.name == anchor))
				{
					Transform val = FindDeep(((Component)model).transform, text);
					if (!Object.op_Implicit((Object)(object)val))
					{
						Log.Warning("AttachmentPoints: bone '" + text + "' not found for anchor '" + anchor + "'");
					}
					else
					{
						GameObject val2 = new GameObject("IDRS_" + anchor);
						val2.transform.SetParent(val, false);
						val2.transform.localPosition = Vector3.zero;
						val2.transform.localRotation = Quaternion.identity;
						val2.transform.localScale = Vector3.one;
						list.Add(new NameTransformPair
						{
							name = anchor,
							transform = val2.transform
						});
					}
				}
			}
			component.transformPairs = list.ToArray();
		}

		private static Transform FindDeep(Transform root, string childName)
		{
			if (((Object)root).name == childName)
			{
				return root;
			}
			for (int i = 0; i < root.childCount; i++)
			{
				Transform val = FindDeep(root.GetChild(i), childName);
				if (Object.op_Implicit((Object)(object)val))
				{
					return val;
				}
			}
			return null;
		}
	}
	public static class BastionBuffs
	{
		public static BuffDef turretRootDef;

		public static BuffDef redLightsDef;

		public static BuffDef tankDef;

		public static void Init(AssetBundle assetBundle)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			turretRootDef = Content.CreateAndAddBuff("BastionTurretBuff", LegacyResourcesAPI.Load<BuffDef>("BuffDefs/HiddenInvincibility").iconSprite, Color.blue, canStack: false, isDebuff: false);
			redLightsDef = Content.CreateAndAddBuff("BastionRedLightsBuff", LegacyResourcesAPI.Load<BuffDef>("BuffDefs/HiddenInvincibility").iconSprite, Color.red, canStack: false, isDebuff: false);
			redLightsDef.isHidden = true;
			tankDef = Content.CreateAndAddBuff("BastionTankBuff", LegacyResourcesAPI.Load<BuffDef>("BuffDefs/HiddenInvincibility").iconSprite, new Color(0.82f, 0.6f, 1f), canStack: false, isDebuff: false);
			tankDef.isHidden = true;
		}
	}
	internal static class BastionCasings
	{
		internal enum Kind
		{
			Rifle,
			Minigun,
			Shotgun,
			Sniper,
			Cannon
		}

		private struct Spec
		{
			public float radius;

			public float length;

			public float back;

			public Color color;

			public bool big;
		}

		internal class Casing : MonoBehaviour
		{
			private MeshRenderer meshRenderer;

			private Rigidbody body;

			private Vector3 fullScale;

			private float age;

			private bool big;

			private bool clinked;

			internal void Bind(MeshRenderer renderer, Rigidbody rigidbody)
			{
				meshRenderer = renderer;
				body = rigidbody;
			}

			internal void Launch(Kind kind, float radius, float length, bool isBig, Material material, Vector3 position, Quaternion rotation, Vector3 velocity)
			{
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_002e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0067: Unknown result type (might be due to invalid IL or missing references)
				//IL_0074: Unknown result type (might be due to invalid IL or missing references)
				//IL_007e: Unknown result type (might be due to invalid IL or missing references)
				big = isBig;
				age = 0f;
				clinked = false;
				fullScale = new Vector3(radius, length, radius);
				((Component)this).transform.SetPositionAndRotation(position, rotation);
				((Component)this).transform.localScale = fullScale;
				((Renderer)meshRenderer).sharedMaterial = material;
				((Component)this).gameObject.SetActive(true);
				body.velocity = velocity;
				body.angularVelocity = Random.insideUnitSphere * 25f;
			}

			private void Update()
			{
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: Unknown result type (might be due to invalid IL or missing references)
				age += Time.deltaTime;
				if (age >= 3.5f)
				{
					((Component)this).gameObject.SetActive(false);
				}
				else if (age > 3.2f)
				{
					((Component)this).transform.localScale = fullScale * ((3.5f - age) / 0.3f);
				}
			}

			private void OnCollisionEnter(Collision collision)
			{
				if (!clinked)
				{
					clinked = true;
					if (BastionConfig.casingSounds != null && BastionConfig.casingSounds.Value && !(Time.time - lastClinkTime < 0.07f))
					{
						lastClinkTime = Time.time;
						Util.PlaySound(big ? "Play_commando_M2_grenade_bounce" : "Play_bandit2_m1_reload_bullet", ((Component)this).gameObject);
					}
				}
			}
		}

		private static readonly Color Brass = new Color(0.8f, 0.6f, 0.24f);

		private static readonly Spec[] Specs = new Spec[5]
		{
			new Spec
			{
				radius = 0.022f,
				length = 0.085f,
				back = 0.45f,
				color = Brass
			},
			new Spec
			{
				radius = 0.02f,
				length = 0.075f,
				back = 0.95f,
				color = Brass
			},
			new Spec
			{
				radius = 0.03f,
				length = 0.1f,
				back = 0.45f,
				color = new Color(0.62f, 0.1f, 0.08f)
			},
			new Spec
			{
				radius = 0.026f,
				length = 0.13f,
				back = 0.45f,
				color = Brass
			},
			new Spec
			{
				radius = 0.075f,
				length = 0.3f,
				back = 1.1f,
				color = new Color(0.66f, 0.5f, 0.22f),
				big = true
			}
		};

		private const int MaxCasings = 96;

		private const float Lifetime = 3.5f;

		private const float FadeTime = 0.3f;

		private const float MaxViewDistance = 70f;

		private const float ClinkGap = 0.07f;

		private static readonly List<Casing> pool = new List<Casing>();

		private static int recycleCursor;

		private static Mesh mesh;

		private static PhysicMaterial bounce;

		private static readonly Material[] materials = (Material[])(object)new Material[5];

		private static float lastClinkTime;

		internal static void Eject(CharacterBody body, string muzzleName, Kind kind)
		{
			//IL_00ba: 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_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: 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_0117: 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_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: 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_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: 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_014a: 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_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: 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_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: 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_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: 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_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: 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)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Unknown result type (might be due to invalid IL or missing references)
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)body) || Application.isBatchMode || BastionConfig.casings == null || !BastionConfig.casings.Value || body.skinIndex == 6)
			{
				return;
			}
			ModelLocator modelLocator = body.modelLocator;
			Transform val = (Object.op_Implicit((Object)(object)modelLocator) ? modelLocator.modelTransform : null);
			ChildLocator val2 = (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponent<ChildLocator>() : null);
			Transform val3 = (Object.op_Implicit((Object)(object)val2) ? val2.FindChild(muzzleName) : null);
			if (!Object.op_Implicit((Object)(object)val3))
			{
				return;
			}
			Camera main = Camera.main;
			if (Object.op_Implicit((Object)(object)main))
			{
				Vector3 val4 = ((Component)main).transform.position - val3.position;
				if (((Vector3)(ref val4)).sqrMagnitude > 4900f)
				{
					return;
				}
			}
			Spec spec = Specs[(int)kind];
			Vector3 corePosition = body.corePosition;
			Vector3 val5 = ((!spec.big && Object.op_Implicit((Object)(object)body.inputBank)) ? body.inputBank.aimDirection : (val3.position - corePosition));
			if (((Vector3)(ref val5)).sqrMagnitude < 0.0001f)
			{
				val5 = val.forward;
			}
			((Vector3)(ref val5)).Normalize();
			Vector3 val6 = Vector3.Cross(Vector3.up, val5);
			if (((Vector3)(ref val6)).sqrMagnitude < 0.0001f)
			{
				val6 = val.right;
			}
			((Vector3)(ref val6)).Normalize();
			if (Vector3.Dot(val3.position - corePosition, val6) < -0.05f)
			{
				val6 = -val6;
			}
			Vector3 position = val3.position - val5 * spec.back + val6 * (spec.radius * 2f);
			Vector3 val7 = val6 * Random.Range(2f, 3.2f) + Vector3.up * Random.Range(1.8f, 3f) - val5 * Random.Range(0f, 0.8f);
			if (spec.big)
			{
				val7 *= 0.7f;
			}
			if (Object.op_Implicit((Object)(object)body.characterMotor))
			{
				val7 += body.characterMotor.velocity;
			}
			Casing casing = Take();
			if (Object.op_Implicit((Object)(object)casing))
			{
				casing.Launch(kind, spec.radius, spec.length, spec.big, GetMaterial(kind), position, Random.rotation, val7);
			}
		}

		private static Casing Take()
		{
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Expected O, but got Unknown
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: 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_00ee: 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_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Expected O, but got Unknown
			//IL_016b: 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_0146: 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_0161: Expected O, but got Unknown
			for (int num = pool.Count - 1; num >= 0; num--)
			{
				if (!Object.op_Implicit((Object)(object)pool[num]))
				{
					pool.RemoveAt(num);
				}
			}
			foreach (Casing item in pool)
			{
				if (!((Component)item).gameObject.activeSelf)
				{
					return item;
				}
			}
			if (pool.Count >= 96)
			{
				recycleCursor = (recycleCursor + 1) % pool.Count;
				return pool[recycleCursor];
			}
			if ((Object)Materials.hotpoo == (Object)null)
			{
				return null;
			}
			GameObject val = new GameObject("BastionCasing")
			{
				layer = LayerIndex.debris.intVal
			};
			val.AddComponent<MeshFilter>().sharedMesh = GetMesh();
			MeshRenderer val2 = val.AddComponent<MeshRenderer>();
			((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0;
			CapsuleCollider obj = val.AddComponent<CapsuleCollider>();
			obj.direction = 1;
			obj.radius = 1f;
			obj.height = 1f;
			if ((Object)bounce == (Object)null)
			{
				bounce = new PhysicMaterial("BastionCasing")
				{
					bounciness = 0.35f,
					dynamicFriction = 0.6f,
					staticFriction = 0.6f
				};
			}
			((Collider)obj).sharedMaterial = bounce;
			Rigidbody val3 = val.AddComponent<Rigidbody>();
			val3.mass = 0.1f;
			val3.drag = 0.2f;
			val3.angularDrag = 1f;
			val3.maxAngularVelocity = 40f;
			Casing casing = val.AddComponent<Casing>();
			casing.Bind(val2, val3);
			pool.Add(casing);
			return casing;
		}

		private static Material GetMaterial(Kind kind)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			Material val = materials[(int)kind];
			if ((Object)val == (Object)null)
			{
				val = new Material(Materials.hotpoo);
				((Object)val).name = "matBastionCasing" + kind;
				val.SetColor("_Color", Specs[(int)kind].color);
				val.SetFloat("_EmPower", 0f);
				val.SetFloat("_SpecularStrength", 0.6f);
				val.SetFloat("_SpecularExponent", 8f);
				materials[(int)kind] = val;
			}
			return val;
		}

		private static Mesh GetMesh()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			//IL_004d: 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_00f5: 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_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: 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_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: 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_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: 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_023a: Expected O, but got Unknown
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)mesh != (Object)null)
			{
				return mesh;
			}
			List<Vector3> list = new List<Vector3>();
			List<int> list2 = new List<int>();
			for (int i = 0; i < 8; i++)
			{
				float num = MathF.PI * 2f * (float)i / 8f;
				float num2 = Mathf.Cos(num);
				float num3 = Mathf.Sin(num);
				list.Add(new Vector3(num2, -0.5f, num3));
				list.Add(new Vector3(num2, 0.5f, num3));
			}
			for (int j = 0; j < 8; j++)
			{
				int num4 = (j + 1) % 8;
				list2.AddRange(new int[6]
				{
					2 * j,
					2 * j + 1,
					2 * num4 + 1,
					2 * j,
					2 * num4 + 1,
					2 * num4
				});
			}
			for (int k = 0; k < 2; k++)
			{
				float num5 = ((k == 0) ? (-0.5f) : 0.5f);
				int count = list.Count;
				list.Add(new Vector3(0f, num5, 0f));
				for (int l = 0; l < 8; l++)
				{
					float num6 = MathF.PI * 2f * (float)l / 8f;
					list.Add(new Vector3(Mathf.Cos(num6), num5, Mathf.Sin(num6)));
				}
				for (int m = 0; m < 8; m++)
				{
					list2.AddRange(new int[3]
					{
						count,
						count + 1 + m,
						count + 1 + (m + 1) % 8
					});
				}
			}
			for (int n = 0; n < list2.Count; n += 3)
			{
				Vector3 val = list[list2[n]];
				Vector3 val2 = list[list2[n + 1]];
				Vector3 val3 = list[list2[n + 2]];
				if (Vector3.Dot(Vector3.Cross(val2 - val, val3 - val), val + val2 + val3) < 0f)
				{
					int value = list2[n + 1];
					list2[n + 1] = list2[n + 2];
					list2[n + 2] = value;
				}
			}
			mesh = new Mesh();
			((Object)mesh).name = "BastionCasing";
			mesh.SetVertices(list);
			mesh.SetTriangles(list2, 0);
			mesh.RecalculateNormals();
			mesh.RecalculateBounds();
			return mesh;
		}
	}
	internal static class BastionCompat
	{
		private const string BetterUIGuid = "com.xoxfaby.BetterUI";

		internal static void Init()
		{
			try
			{
				AddBetterUIProcCoefficients();
			}
			catch (Exception ex)
			{
				Log.Warning("BetterUI proc coefficients not registered: " + ex.Message);
			}
		}

		private static void AddBetterUIProcCoefficients()
		{
			MethodInfo addSkill;
			string prefix;
			if (Chainloader.PluginInfos.TryGetValue("com.xoxfaby.BetterUI", out var value) && Object.op_Implicit((Object)(object)value.Instance))
			{
				Type type = ((object)value.Instance).GetType().Assembly.GetType("BetterUI.ProcCoefficientCatalog");
				addSkill = ((type != null) ? type.GetMethod("AddSkill", new Type[3]
				{
					typeof(string),
					typeof(string),
					typeof(float)
				}) : null);
				if (addSkill == null)
				{
					Log.Warning("BetterUI is installed but ProcCoefficientCatalog.AddSkill(string, string, float) was not found.");
					return;
				}
				prefix = "HASTEREAPR_BASTION_";
				Add("PRIMARY_RECON_NAME", "PROC_BULLET", new Primary().procCoef);
				Add("PRIMARY_RECON_SNIPER_NAME", "PROC_BULLET", new SniperPrimary().procCoef);
				Add("PRIMARY_RECON_SHOTGUN_NAME", "PROC_PELLET", new ShotgunPrimary().procCoef);
				Add("PRIMARY_ASSAULT_NAME", "PROC_BULLET", new AssaultPrimary().procCoef);
				Add("PRIMARY_BOMBARD_NAME", "PROC_SHELL", new BombardPrimary().procCoef);
				Add("PRIMARY_ARTILLERY_NAME", "PROC_SHELL", new ArtilleryPrimary().procCoef);
				Add("PRIMARY_DRONE_NAME", "PROC_SHELL", new ArtilleryDronePrimary().procCoef);
			}
			void Add(string skill, string proc, float coefficient)
			{
				addSkill.Invoke(null, new object[3]
				{
					prefix + skill,
					prefix + proc,
					coefficient
				});
			}
		}
	}
	public static class BastionConfig
	{
		public static ConfigEntry<bool> harvyMode;

		public static ConfigEntry<float> shotgunCycle;

		public static ConfigEntry<float> grenadeCooldown;

		public static ConfigEntry<float> grenadeKnockForce;

		public static ConfigEntry<float> artilleryCooldown;

		public static ConfigEntry<float> heatDecayTime;

		public static ConfigEntry<float> igniteHeatThreshold;

		public static ConfigEntry<float> igniteChance;

		public static ConfigEntry<bool> unlockAllSkins;

		public static ConfigEntry<bool> startWithScepter;

		public static ConfigEntry<bool> casings;

		public static ConfigEntry<bool> casingSounds;

		public static ConfigEntry<bool> deployedHitSound;

		public static ConfigEntry<float> baseHealth;

		public static ConfigEntry<float> healthGrowth;

		public static ConfigEntry<float> baseRegen;

		public static ConfigEntry<float> baseArmor;

		public static ConfigEntry<float> baseDamage;

		public static ConfigEntry<float> damageGrowth;

		public static ConfigEntry<float> baseMoveSpeed;

		public static ConfigEntry<float> baseCrit;

		public static float Stat(ConfigEntry<float> entry, float fallback)
		{
			return entry?.Value ?? fallback;
		}

		public static void Init()
		{
			harvyMode = Config.BindAndOptions("Bastion", "Harvy Mode", defaultValue: false, "Overwatch-faithful tweaks: Operation : Repair has no duration cap - hold to keep healing until you cancel it.");
			unlockAllSkins = Config.BindAndOptions("Bastion", "Unlock All Skins", defaultValue: false, "Makes every BAS-10 skin selectable without earning its achievement (for testing and previewing). Requires restart.", restartRequired: true);
			startWithScepter = Config.BindAndOptions("Bastion", "Start With Ancient Scepter", defaultValue: false, "Player-controlled BAS-10s are given an Ancient Scepter when they spawn, if they have none - for trying the tank forms. Needs the Ancient Scepter mod installed. Host's setting.");
			casings = Config.BindAndOptions("Bastion - Effects", "Shell Casings", defaultValue: true, "His weapons throw out spent casings that bounce on the ground. Cosmetic; each player's own setting.");
			casingSounds = Config.BindAndOptions("Bastion - Effects", "Casing Sounds", defaultValue: true, "Spent casings clink when they land.");
			deployedHitSound = Config.BindAndOptions("Bastion - Effects", "Deployed Hit Sound", defaultValue: true, "Hits on a deployed BAS-10 ring off his armour.");
			baseHealth = Config.BindAndOptions("Bastion - Stats", "Base Health", 175f, "Maximum health at level 1.", restartRequired: true);
			healthGrowth = Config.BindAndOptions("Bastion - Stats", "Health Growth", 25f, "Maximum health gained per level.", restartRequired: true);
			baseRegen = Config.BindAndOptions("Bastion - Stats", "Base Health Regen", 1.5f, "Health regenerated per second at level 1.", restartRequired: true);
			baseArmor = Config.BindAndOptions("Bastion - Stats", "Base Armor", 5f, "Armor in recon form. Deployed forms add their own on top.", restartRequired: true);
			baseDamage = Config.BindAndOptions("Bastion - Stats", "Base Damage", 12f, "Base damage at level 1.", restartRequired: true);
			damageGrowth = Config.BindAndOptions("Bastion - Stats", "Damage Growth", 2.4f, "Base damage gained per level.", restartRequired: true);
			baseMoveSpeed = Config.BindAndOptions("Bastion - Stats", "Base Movement Speed", 8f, "Movement speed in recon form.", restartRequired: true);
			baseCrit = Config.BindAndOptions("Bastion - Stats", "Base Crit", 1f, "Critical strike chance in percent.", restartRequired: true);
			shotgunCycle = Config.BindAndOptions("Bastion - Balance", "Shotgun Cycle Time", 0.65f, "Seconds between Riot Shotgun shots (before attack speed).");
			grenadeCooldown = Config.BindAndOptions("Bastion - Balance", "Concussion Charge Cooldown", 5f, "Concussion Charge cooldown in seconds. Requires restart.");
			grenadeKnockForce = Config.BindAndOptions("Bastion - Balance", "Concussion Charge Knockback", 8000f, "Self-knockback force of the Concussion Charge blast (grenade-jump strength).");
			artilleryCooldown = Config.BindAndOptions("Bastion - Balance", "Artillery Cooldown", 12f, "Cooldown of Configuration : Artillery and Configuration : Deploy in seconds. Requires restart.");
			heatDecayTime = Config.BindAndOptions("Bastion - Balance", "Heat Decay Time", 5f, "Seconds for the gun barrel to cool from max heat to cold.");
			igniteHeatThreshold = Config.BindAndOptions("Bastion - Balance", "Overheat Threshold", 0.95f, "Heat level (0-1) at which the barrel counts as overheated: minigun bullets can ignite and the barrel vents smoke.");
			igniteChance = Config.BindAndOptions("Bastion - Balance", "Overheat Ignite Chance", 20f, "Percent chance per minigun bullet to ignite enemies while the barrel is overheated. 0 disables.");
			BastionEmotes.InitConfig();
		}
	}
	internal static class BastionCrosshairs
	{
		private static readonly Dictionary<Type, string> keys = new Dictionary<Type, string>
		{
			{
				typeof(ShotgunPrimary),
				RoR2_Base_Bandit2.Bandit2Crosshair_prefab
			},
			{
				typeof(SniperPrimary),
				RoR2_Base_UI.SimpleDotCrosshair_prefab
			},
			{
				typeof(AssaultPrimary),
				RoR2_Base_Toolbot.SMGCrosshair_prefab
			},
			{
				typeof(BombardPrimary),
				RoR2_Base_Toolbot.ToolbotGrenadeLauncherCrosshair_prefab
			},
			{
				typeof(ArtilleryPrimary),
				RoR2_Base_UI.WideBracketCrosshair_prefab
			},
			{
				typeof(ArtilleryDronePrimary),
				RoR2_Base_UI.WideBracketCrosshair_prefab
			}
		};

		private static readonly Dictionary<Type, GameObject> loaded = new Dictionary<Type, GameObject>();

		internal static GameObject For(SkillDef primary)
		{
			//IL_0041: 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)
			Type type = (Object.op_Implicit((Object)(object)primary) ? ((SerializableEntityStateType)(ref primary.activationState)).stateType : null);
			if (type == null || !keys.TryGetValue(type, out var value))
			{
				return null;
			}
			if (!loaded.TryGetValue(type, out var value2))
			{
				try
				{
					value2 = Addressables.LoadAssetAsync<GameObject>((object)value).WaitForCompletion();
				}
				catch (Exception ex)
				{
					Log.Warning("Crosshair for " + type.Name + " could not be loaded: " + ex.Message);
				}
				loaded[type] = value2;
			}
			return value2;
		}
	}
	public static class BastionEmotes
	{
		public const int Rest = 0;

		public const int Dance = 1;

		public const int Bird = 2;

		private static readonly string[] names = new string[3] { "rest", "dance", "bird" };

		private static readonly BastionEmoteClip[] clips = new BastionEmoteClip[3];

		private static readonly bool[] loaded = new bool[3];

		public static ConfigEntry<KeyboardShortcut>[] keys;

		public static void InitConfig()
		{
			//IL_001b: 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_005b: Unknown result type (might be due to invalid IL or missing references)
			string section = "Bastion - Emotes";
			keys = new ConfigEntry<KeyboardShortcut>[3]
			{
				Config.BindAndOptions<KeyboardShortcut>(section, "Rest", new KeyboardShortcut((KeyCode)49, Array.Empty<KeyCode>()), "Key for the Rest emote: BAS-10 settles down and powers off until you move."),
				Config.BindAndOptions<KeyboardShortcut>(section, "Robot Dance", new KeyboardShortcut((KeyCode)50, Array.Empty<KeyCode>()), "Key for the Robot Dance emote."),
				Config.BindAndOptions<KeyboardShortcut>(section, "Bird Moment", new KeyboardShortcut((KeyCode)51, Array.Empty<KeyCode>()), "Key for the Bird Moment emote: BAS-10 holds out his hand and his Jade Thrinch perches on it.")
			};
		}

		public static int PressedEmote()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			if (keys == null)
			{
				return -1;
			}
			for (int i = 0; i < keys.Length; i++)
			{
				if (Config.GetKeyPressed(keys[i].Value))
				{
					return i;
				}
			}
			return -1;
		}

		public static BastionEmoteClip GetClip(int index)
		{
			if (index < 0 || index >= names.Length)
			{
				return null;
			}
			if (!loaded[index])
			{
				loaded[index] = true;
				try
				{
					clips[index] = BastionEmoteClip.Load(names[index]);
				}
				catch (Exception ex)
				{
					Log.Error("Emote '" + names[index] + "' failed to load — " + ex);
				}
			}
			return clips[index];
		}
	}
	public class BastionEmoteClip
	{
		public float fps;

		public int introFrames;

		public int loopFrames;

		public string[] bonePaths;

		public Vector3[] positions;

		public Quaternion[] rotations;

		public Vector3[] scales;

		public Vector3[] anchorPositions;

		public Quaternion[] anchorRotations;

		public bool[] hasAnchor;

		public int frameCount => introFrames + loopFrames;

		public void Sample(float time, out int a, out int b, out float t)
		{
			float num = Mathf.Max(0f, time) * fps;
			if (num < (float)introFrames)
			{
				a = Mathf.FloorToInt(num);
				b = Mathf.Min(a + 1, frameCount - 1);
				t = num - (float)a;
			}
			else
			{
				float num2 = Mathf.Repeat(num - (float)introFrames, (float)loopFrames);
				int num3 = Mathf.Min(Mathf.FloorToInt(num2), loopFrames - 1);
				a = introFrames + num3;
				b = introFrames + (num3 + 1) % loopFrames;
				t = num2 - (float)num3;
			}
		}

		public static BastionEmoteClip Load(string name)
		{
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: 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_01a6: 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_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: 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_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			using Stream stream = typeof(BastionEmoteClip).Assembly.GetManifestResourceStream("BastionMod.Emotes." + name + ".emote");
			if (stream == null)
			{
				throw new FileNotFoundException("embedded emote missing: " + name);
			}
			using GZipStream gZipStream = new GZipStream(stream, CompressionMode.Decompress);
			using MemoryStream memoryStream = new MemoryStream();
			gZipStream.CopyTo(memoryStream);
			memoryStream.Position = 0L;
			using BinaryReader binaryReader = new BinaryReader(memoryStream);
			if (new string(binaryReader.ReadChars(4)) != "BEM1")
			{
				throw new InvalidDataException("bad emote header");
			}
			BastionEmoteClip bastionEmoteClip = new BastionEmoteClip();
			bastionEmoteClip.fps = binaryReader.ReadSingle();
			bastionEmoteClip.introFrames = binaryReader.ReadInt32();
			bastionEmoteClip.loopFrames = binaryReader.ReadInt32();
			int num = binaryReader.ReadInt32();
			bastionEmoteClip.bonePaths = new string[num];
			for (int i = 0; i < num; i++)
			{
				bastionEmoteClip.bonePaths[i] = Encoding.UTF8.GetString(binaryReader.ReadBytes(binaryReader.ReadUInt16()));
			}
			int num2 = bastionEmoteClip.frameCount;
			bastionEmoteClip.positions = (Vector3[])(object)new Vector3[num2 * num];
			bastionEmoteClip.rotations = (Quaternion[])(object)new Quaternion[num2 * num];
			bastionEmoteClip.scales = (Vector3[])(object)new Vector3[num2 * num];
			for (int j = 0; j < num2 * num; j++)
			{
				bastionEmoteClip.positions[j] = new Vector3(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle());
				bastionEmoteClip.rotations[j] = new Quaternion(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle());
				bastionEmoteClip.scales[j] = new Vector3(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle());
			}
			bastionEmoteClip.anchorPositions = (Vector3[])(object)new Vector3[num2];
			bastionEmoteClip.anchorRotations = (Quaternion[])(object)new Quaternion[num2];
			bastionEmoteClip.hasAnchor = new bool[num2];
			Vector3 val = default(Vector3);
			Quaternion val2 = default(Quaternion);
			for (int k = 0; k < num2; k++)
			{
				((Vector3)(ref val))..ctor(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle());
				((Quaternion)(ref val2))..ctor(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle());
				bastionEmoteClip.hasAnchor[k] = !float.IsNaN(val.x);
				bastionEmoteClip.anchorPositions[k] = (bastionEmoteClip.hasAnchor[k] ? val : Vector3.zero);
				bastionEmoteClip.anchorRotations[k] = (bastionEmoteClip.hasAnchor[k] ? val2 : Quaternion.identity);
			}
			return bastionEmoteClip;
		}
	}
	internal static class BastionHitboxDiag
	{
		private const float TargetWorldRadius = 0.6f;

		private const string CoreTransformName = "BastionCoreTransform";

		private static bool hooked;

		private static bool logged;

		public static void Init()
		{
			if (!hooked)
			{
				hooked = true;
				CharacterBody.onBodyStartGlobal += OnBodyStart;
			}
		}

		private static void OnBodyStart(CharacterBody body)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: 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_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: 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_0305: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_030e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0324: Unknown result type (might be due to invalid IL or missing references)
			//IL_0329: Unknown result type (might be due to invalid IL or missing references)
			//IL_032d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0343: Unknown result type (might be due to invalid IL or missing references)
			//IL_039a: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)body) || body.bodyIndex != BastionPlugin.bodyIndex)
			{
				return;
			}
			HurtBoxGroup hurtBoxGroup = body.hurtBoxGroup;
			HurtBox val = (Object.op_Implicit((Object)(object)hurtBoxGroup) ? hurtBoxGroup.mainHurtBox : null);
			CapsuleCollider val2 = (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponent<CapsuleCollider>() : null);
			if (!Object.op_Implicit((Object)(object)val2))
			{
				if (!logged)
				{
					logged = true;
					Log.Warning("[BAS10_HITBOX] main hurtbox has no CapsuleCollider — cannot resize.");
				}
				return;
			}
			Transform transform = ((Component)val2).transform;
			Bounds bounds = ((Collider)val2).bounds;
			string text = F(transform.position);
			Bounds bounds2 = default(Bounds);
			bool flag = TryComputeVisibleBounds(body, out bounds2);
			float num = Mathf.Max(transform.lossyScale.x, transform.lossyScale.z);
			val2.direction = 1;
			val2.radius = 0.6f / Mathf.Max(0.0001f, num);
			if (flag)
			{
				Vector3 position = transform.position;
				position.y = ((Bounds)(ref bounds2)).center.y;
				transform.position = position;
				HurtboxAnchor hurtboxAnchor = ((Component)transform).GetComponent<HurtboxAnchor>();
				if ((Object)(object)hurtboxAnchor == (Object)null)
				{
					hurtboxAnchor = ((Component)transform).gameObject.AddComponent<HurtboxAnchor>();
				}
				hurtboxAnchor.anchoredLocalPosition = transform.localPosition;
				val2.center = transform.InverseTransformPoint(((Bounds)(ref bounds2)).center);
				val2.height = ((Bounds)(ref bounds2)).size.y / Mathf.Max(0.0001f, transform.lossyScale.y);
			}
			string text2 = (((Object)(object)body.coreTransform != (Object)null) ? (((Object)body.coreTransform).name + "@" + F(body.corePosition)) : "(null->transform.position)");
			if (flag)
			{
				Transform val3 = body.coreTransform;
				if ((Object)(object)val3 == (Object)null || ((Object)val3).name != "BastionCoreTransform")
				{
					val3 = new GameObject("BastionCoreTransform").transform;
					val3.SetParent(body.transform, false);
					body.coreTransform = val3;
				}
				val3.localPosition = new Vector3(0f, ((Bounds)(ref bounds2)).center.y - body.transform.position.y, 0f);
			}
			else if ((Object)(object)body.coreTransform != (Object)null && ((Object)body.coreTransform).name != "BastionCoreTransform")
			{
				body.coreTransform = null;
			}
			if (!logged)
			{
				logged = true;
				Log.Warning("[BAS10_HITBOX] foot=" + F(body.transform.position) + " core=" + F(body.corePosition));
				Log.Warning("[BAS10_HITBOX] visibleMesh " + (flag ? ("worldBounds c=" + F(((Bounds)(ref bounds2)).center) + " size=" + F(((Bounds)(ref bounds2)).size)) : "(no renderers found)"));
				Log.Warning("[BAS10_HITBOX] hurtbox BEFORE worldBounds c=" + F(((Bounds)(ref bounds)).center) + " size=" + F(((Bounds)(ref bounds)).size));
				string[] obj = new string[12]
				{
					"[BAS10_HITBOX] hurtbox AFTER  worldBounds c=", null, null, null, null, null, null, null, null, null,
					null, null
				};
				Bounds bounds3 = ((Collider)val2).bounds;
				obj[1] = F(((Bounds)(ref bounds3)).center);
				obj[2] = " size=";
				bounds3 = ((Collider)val2).bounds;
				obj[3] = F(((Bounds)(ref bounds3)).size);
				obj[4] = " | local center=";
				obj[5] = F(val2.center);
				obj[6] = " h=";
				obj[7] = val2.height.ToString("F3");
				obj[8] = " r=";
				obj[9] = val2.radius.ToString("F3");
				obj[10] = " lossyScale=";
				obj[11] = F(transform.lossyScale);
				Log.Warning(string.Concat(obj));
				Log.Warning("[BAS10_HITBOX] enemyAimPoint(hurtbox transform) BEFORE " + text + " -> AFTER " + F(transform.position));
				Log.Warning("[BAS10_HITBOX] corePosition BEFORE " + text2 + " -> AFTER " + F(body.corePosition));
				CharacterDeathBehavior component = ((Component)body).GetComponent<CharacterDeathBehavior>();
				ModelLocator modelLocator = body.modelLocator;
				Transform val4 = (Object.op_Implicit((Object)(object)modelLocator) ? modelLocator.modelTransform : null);
				RagdollController val5 = (Object.op_Implicit((Object)(object)val4) ? ((Component)val4).GetComponent<RagdollController>() : null);
				int num2 = ((Object.op_Implicit((Object)(object)val5) && val5.bones != null) ? val5.bones.Length : (-1));
				string text3 = (((Object)(object)component != (Object)null && ((SerializableEntityStateType)(ref component.deathState)).stateType != null) ? ((SerializableEntityStateType)(ref component.deathState)).stateType.FullName : "(none)");
				Log.Warning("[BAS10_DEATH] ragdollController=" + Object.op_Implicit((Object)(object)val5) + " boneCount=" + num2 + " deathState=" + text3);
			}
		}

		private static bool TryComputeVisibleBounds(CharacterBody body, out Bounds bounds)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			bounds = default(Bounds);
			ModelLocator modelLocator = body.modelLocator;
			Transform val = (Object.op_Implicit((Object)(object)modelLocator) ? modelLocator.modelTransform : null);
			if (!Object.op_Implicit((Object)(object)val))
			{
				return false;
			}
			bool flag = false;
			Renderer[] componentsInChildren = ((Component)val).GetComponentsInChildren<Renderer>();
			foreach (Renderer val2 in componentsInChildren)
			{
				if (val2 is SkinnedMeshRenderer || val2 is MeshRenderer)
				{
					SkinnedMeshRenderer val3 = (SkinnedMeshRenderer)(object)((val2 is SkinnedMeshRenderer) ? val2 : null);
					if (val3 != null)
					{
						val3.updateWhenOffscreen = true;
					}
					if (!flag)
					{
						bounds = val2.bounds;
						flag = true;
					}
					else
					{
						((Bounds)(ref bounds)).Encapsulate(val2.bounds);
					}
				}
			}
			return flag;
		}

		private static string F(Vector3 v)
		{
			return "(" + v.x.ToString("F3") + "," + v.y.ToString("F3") + "," + v.z.ToString("F3") + ")";
		}
	}
	internal class HurtboxAnchor : MonoBehaviour
	{
		public Vector3 anchoredLocalPosition;

		private void LateUpdate()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).transform.localPosition = anchoredLocalPosition;
		}
	}
	public class BastionItemDisplays : ItemDisplaysBase
	{
		private static bool dumpedKeyMap;

		protected override void SetItemDisplayRules(List<KeyAssetRuleGroup> itemDisplayRules)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: 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_00de: 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_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: 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)
			//IL_0170: 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_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: 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_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d5: 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_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0329: Unknown result type (might be due to invalid IL or missing references)
			//IL_033d: 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_0356: Unknown result type (might be due to invalid IL or missing references)
			//IL_035b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0360: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0421: Unknown result type (might be due to invalid IL or missing references)
			//IL_0435: Unknown result type (might be due to invalid IL or missing references)
			//IL_0449: Unknown result type (might be due to invalid IL or missing references)
			//IL_044e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0453: Unknown result type (might be due to invalid IL or missing references)
			//IL_0458: Unknown result type (might be due to invalid IL or missing references)
			//IL_049d: 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_04c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0519: Unknown result type (might be due to invalid IL or missing references)
			//IL_052d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0541: Unknown result type (might be due to invalid IL or missing references)
			//IL_0546: Unknown result type (might be due to invalid IL or missing references)
			//IL_054b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0550: Unknown result type (might be due to invalid IL or missing references)
			//IL_0595: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a9: 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_05c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0611: Unknown result type (might be due to invalid IL or missing references)
			//IL_0625: Unknown result type (might be due to invalid IL or missing references)
			//IL_0639: Unknown result type (might be due to invalid IL or missing references)
			//IL_063e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0643: Unknown result type (might be due to invalid IL or missing references)
			//IL_0648: Unknown result type (might be due to invalid IL or missing references)
			//IL_068d: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0709: Unknown result type (might be due to invalid IL or missing references)
			//IL_071d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0731: Unknown result type (might be due to invalid IL or missing references)
			//IL_0736: Unknown result type (might be due to invalid IL or missing references)
			//IL_073b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0740: Unknown result type (might be due to invalid IL or missing references)
			//IL_0785: Unknown result type (might be due to invalid IL or missing references)
			//IL_0799: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bc: 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_0815: Unknown result type (might be due to invalid IL or missing references)
			//IL_0829: Unknown result type (might be due to invalid IL or missing references)
			//IL_082e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0833: Unknown result type (might be due to invalid IL or missing references)
			//IL_0858: Unknown result type (might be due to invalid IL or missing references)
			//IL_086c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0880: Unknown result type (might be due to invalid IL or missing references)
			//IL_0885: Unknown result type (might be due to invalid IL or missing references)
			//IL_088a: Unknown result type (might be due to invalid IL or missing references)
			//IL_088f: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0901: Unknown result type (might be due to invalid IL or missing references)
			//IL_0906: Unknown result type (might be due to invalid IL or missing references)
			//IL_090b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0950: Unknown result type (might be due to invalid IL or missing references)
			//IL_0964: Unknown result type (might be due to invalid IL or missing references)
			//IL_0978: Unknown result type (might be due to invalid IL or missing references)
			//IL_097d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0982: Unknown result type (might be due to invalid IL or missing references)
			//IL_0987: Unknown result type (might be due to invalid IL or missing references)
			//IL_09cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a03: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a48: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a5c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a70: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a75: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a7a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a7f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0afb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b40: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b54: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b68: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b6d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b72: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b77: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bbc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0be4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0be9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c38: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c4c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c60: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c65: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c6a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c6f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cb4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cdc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ce1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ce6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ceb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d30: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d44: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d58: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d5d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d62: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d67: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dac: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dc0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dd4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dd9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dde: Unknown result type (might be due to invalid IL or missing references)
			//IL_0de3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e28: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e50: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e55: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e5a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e7f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e93: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ea7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eac: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eb1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eb6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0efb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f0f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f23: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f28: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f2d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f32: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f77: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f8b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f9f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fa4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fa9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ff3: Unknown result type (might be due to invalid IL or missing references)
			//IL_1007: Unknown result type (might be due to invalid IL or missing references)
			//IL_101b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1020: Unknown result type (might be due to invalid IL or missing references)
			//IL_1025: Unknown result type (might be due to invalid IL or missing references)
			//IL_102a: Unknown result type (might be due to invalid IL or missing references)
			//IL_106f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1083: Unknown result type (might be due to invalid IL or missing references)
			//IL_1097: Unknown result type (might be due to invalid IL or missing references)
			//IL_109c: Unknown result type (might be due to invalid IL or missing references)
			//IL_10a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_10a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_10eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_10ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_1113: Unknown result type (might be due to invalid IL or missing references)
			//IL_1118: Unknown result type (might be due to invalid IL or missing references)
			//IL_111d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1122: Unknown result type (might be due to invalid IL or missing references)
			//IL_1167: Unknown result type (might be due to invalid IL or missing references)
			//IL_117b: Unknown result type (might be due to invalid IL or missing references)
			//IL_118f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1194: Unknown result type (might be due to invalid IL or missing references)
			//IL_1199: Unknown result type (might be due to invalid IL or missing references)
			//IL_119e: Unknown result type (might be due to invalid IL or missing references)
			//IL_11e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_11f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_120b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1210: Unknown result type (might be due to invalid IL or missing references)
			//IL_1215: Unknown result type (might be due to invalid IL or missing references)
			//IL_121a: Unknown result type (might be due to invalid IL or missing references)
			SafeAdd("BFG", "DisplayBFG", "ShoulderL", new Vector3(-0.00112f, -0.00023f, -0.00105f), new Vector3(357.9245f, 86.66082f, 270.8715f), new Vector3(0.006f, 0.006f, 0.006f));
			SafeAdd("Jetpack", "DisplayBugWings", "Back", new Vector3(-1E-05f, -0.00077f, -1E-05f), new Vector3(320.449f, 90.59616f, 179.8104f), new Vector3(0.01f, 0.002f, 0.002f));
			AddFromBody("CommandoBody", "Crowdfunder", "Turret", new Vector3(-0.00034f, 0.00396f, 0.00962f), new Vector3(273.4358f, 179.3558f, 0.60108f), new Vector3(0.002f, 0.002f, 0.002f));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["ArmorPlate"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayRepulsionArmorPlate"), "Head", new Vector3(-0.00038f, 0.00362f, 0.00031f), new Vector3(348.1421f, 180f, 178.3234f), new Vector3(0.0045f, 0.0045f, 0.003f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["ArmorReductionOnHit"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayWarhammer"), "HandArm", new Vector3(-0.00051f, 0.00807f, 0.00565f), new Vector3(1E-05f, 0f, 90f), new Vector3(0.002f, 0.002f, 0.002f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["AttackSpeedOnCrit"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayWolfPelt"), "Head", new Vector3(-1E-05f, 0.00372f, 0.00054f), new Vector3(0f, 0f, 0f), new Vector3(0.007f, 0.007f, 0.007f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["Bandolier"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayBandolier"), "Chest", new Vector3(-0.00029f, 0.00037f, -0.00025f), new Vector3(1.91232f, 52.00823f, 1.3357f), new Vector3(0.009f, 0.011f, 0.011f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["BarrierOnOverHeal"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayAegis"), "GunArm", new Vector3(-0.00121f, 0.00424f, -0.00023f), new Vector3(276.2267f, 90.87523f, 179.0724f), new Vector3(0.003f, 0.003f, 0.004f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["Behemoth"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayBehemoth"), "GunArm", new Vector3(-0.00013f, 0.0059f, 0.00011f), new Vector3(0.10061f, 0.05675f, 180.0234f), new Vector3(0.0011f, 0.001f, 0.0011f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["BleedOnHit"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayTriTip"), "ArtilleryMuzzle", new Vector3(3E-05f, 0.00016f, 0f), new Vector3(270f, 0f, 0f), new Vector3(0.005f, 0.005f, 0.005f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["BounceNearby"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayHook"), "Back", new Vector3(0.00132f, -0.00201f, 0f), new Vector3(270f, 271.6931f, 0f), new Vector3(0.008f, 0.008f, 0.008f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["Clover"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayClover"), "Head", new Vector3(1E-05f, 0.00408f, 9E-05f), new Vector3(0f, 0f, 0f), new Vector3(0.008f, 0.008f, 0.008f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["CritDamage"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayLaserSight"), "Turret", new Vector3(0.00117f, 0.00584f, -0.00063f), new Vector3(0f, 180f, 0f), new Vector3(0.002f, 0.002f, 0.002f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["CritGlasses"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayGlasses"), "Turret", new Vector3(0.00223f, 0.00541f, -0.00051f), new Vector3(0f, 90f, 0f), new Vector3(0.0042f, 0.004f, 0.004f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["CritGlassesVoid"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayGlassesVoid"), "Head", new Vector3(-2E-05f, 0.00261f, 0.00129f), new Vector3(0f, 0f, 0f), new Vector3(0.0015f, 0.0028f, 0.002f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["Dagger"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayDagger"), "Chest", new Vector3(-0.00079f, 2E-05f, 0.0021f), new Vector3(270f, 270f, 0f), new Vector3(0.008f, 0.008f, 0.008f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["EquipmentMagazine"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayBattery"), "Chest", new Vector3(0.00107f, 0.00338f, 7E-05f), new Vector3(292.1796f, 85.54549f, 305.8578f), new Vector3(0.0032f, 0.0032f, 0.0018f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["FallBoots"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayGravBoots"), "FootL", new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0.007f, 0.007f, 0.007f)), ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayGravBoots"), "FootR", new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0.007f, 0.007f, 0.007f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["HealWhileSafe"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplaySnail"), "Chest", new Vector3(0.00089f, -3E-05f, -0.00195f), new Vector3(1.54873f, 12.65052f, 268.7562f), new Vector3(0.001f, 0.001f, 0.001f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["LunarPrimaryReplacement"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayBirdEye"), "Head", new Vector3(0f, 0.0027f, 0.00107f), new Vector3(277.3237f, 354.4643f, 5.18912f), new Vector3(0.0025f, 0.0025f, 0.0025f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["Mushroom"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayMushroom"), "ShoulderL", new Vector3(0.00045f, 0.00318f, -0.00214f), new Vector3(0f, 90f, 270f), new Vector3(0.001f, 0.001f, 0.001f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["MushroomVoid"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayMushroomVoid"), "ShoulderL", new Vector3(0.00045f, 0.00318f, -0.00214f), new Vector3(0f, 90f, 270f), new Vector3(0.001f, 0.001f, 0.001f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["PersonalShield"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayShieldGenerator"), "Chest", new Vector3(-0.00212f, 0.00268f, 3E-05f), new Vector3(11.91875f, 269.9003f, 179.9076f), new Vector3(0.002f, 0.002f, 0.002f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["Phasing"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayStealthkit"), "Pelvis", new Vector3(0.00143f, 0.0011f, 4E-05f), new Vector3(90f, 270f, 0f), new Vector3(0.0031f, 0.005f, 0.0031f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["ShockNearby"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayTeslaCoil"), "Pelvis", new Vector3(-0.00024f, 0.00034f, 0f), new Vector3(0f, 0f, 180f), new Vector3(0.0055f, 0.004f, 0.0055f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["UtilitySkillMagazine"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayAfterburnerShoulderRing"), "Turret", new Vector3(-0.0031f, 0.0041f, -0.0006f), new Vector3(0f, 0f, 270f), new Vector3(0.009f, 0.008f, 0.009f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["BossHunter"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayTricornGhost"), "Head", new Vector3(0.00012f, 0.00456f, 0.00075f), new Vector3(0f, 180f, 0f), new Vector3(0.008f, 0.008f, 0.008f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["BossHunterConsumed"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayTricornUsed"), "Head", new Vector3(0.00012f, 0.00456f, 0.00075f), new Vector3(0f, 180f, 0f), new Vector3(0.008f, 0.008f, 0.008f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["Cleanse"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayWaterPack"), "Back", new Vector3(-0.00594f, -0.00195f, 3E-05f), new Vector3(90f, 80f, 0f), new Vector3(0.0013f, 0.0013f, 0.0013f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["EliteFireEquipment"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayEliteHorn"), "Head", new Vector3(0.00023f, 0.00326f, 8E-05f), new Vector3(79.30444f, 229.0373f, 173.918f), new Vector3(0.001f, 0.001f, 0.001f)), ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayEliteHorn"), "Head", new Vector3(-5E-05f, 0.00342f, -0.00017f), new Vector3(79.99999f, 91.65634f, 180f), new Vector3(0.001f, 0.001f, 0.001f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["EliteHauntedEquipment"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayEliteStealthCrown"), "Head", new Vector3(-0.00011f, 0.00801f, -0.00039f), new Vector3(0f, 0f, 0f), new Vector3(0.001f, 0.001f, 0.001f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["EliteIceEquipment"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayEliteIceCrown"), "Head", new Vector3(-5E-05f, 0.00409f, -0.0002f), new Vector3(270f, 0f, 0f), new Vector3(0.0003f, 0.0003f, 0.0003f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["EliteLunarEquipment"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayEliteLunar,Eye"), "Head", new Vector3(-4E-05f, 0.00345f, -0.00197f), new Vector3(90f, 0f, 0f), new Vector3(0.008f, 0.009f, 0.008f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["ElitePoisonEquipment"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayEliteUrchinCrown"), "Head", new Vector3(-4E-05f, 0.00415f, -4E-05f), new Vector3(270f, 1E-05f, 0f), new Vector3(0.0005f, 0.0005f, 0.0005f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["QuestVolatileBattery"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayBatteryArray"), "Turret", new Vector3(-0.00027f, 0.00671f, -0.00064f), new Vector3(270f, 0f, 0f), new Vector3(0.0023f, 0.0023f, 0.0022f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["Saw"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplaySawmerangFollower"), "Chest", new Vector3(0.00197f, -0.01323f, -0.00353f), new Vector3(359.0983f, 264.1153f, 0.04938f), new Vector3(0.002f, 0.002f, 0.002f))));
			itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["Scanner"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayScanner"), "ShoulderR", new Vector3(0f, 0f, 0f), new Vector3(0f, 270f, 90f), new Vector3(0.004f, 0.004f, 0.004f))));
			void AddFromBody(string bodyName, string keyName, string child, Vector3 pos, Vector3 rot, Vector3 scale)
			{
				//IL_0