Decompiled source of RiskOfImpact v0.1.0

RiskOfImpact.dll

Decompiled 5 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using EntityStates;
using HG;
using LookingGlass.ItemStatsNameSpace;
using On.RoR2;
using On.RoR2.Items;
using On.RoR2.Orbs;
using On.RoR2.Projectile;
using R2API;
using RoR2;
using RoR2.ContentManagement;
using RoR2.ExpansionManagement;
using RoR2.Items;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace RiskOfImpact;

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

		public static StatHookEventHandler <>9__24_0;

		internal void <FinalizeAsync>b__24_0(CharacterBody body, StatHookEventArgs statArgs)
		{
			if (!Object.op_Implicit((Object)(object)body.inventory))
			{
				return;
			}
			int itemCountEffective = body.inventory.GetItemCountEffective(_mug);
			if (itemCountEffective > 0)
			{
				statArgs.moveSpeedMultAdd += 0.69f * (float)itemCountEffective;
				statArgs.attackSpeedMultAdd += 0.69f * (float)itemCountEffective;
			}
			int itemCountEffective2 = body.inventory.GetItemCountEffective(_comboStarItem);
			if (itemCountEffective2 <= 0)
			{
				return;
			}
			int buffCount = body.GetBuffCount(_comboStarBuff);
			if (buffCount > 0)
			{
				float num = (0.03f + (float)(itemCountEffective2 - 1) * 0.005f) * (float)buffCount;
				statArgs.damageMultAdd += num;
				if (body.GetBuffCount(_comboStarMaxBuff) > 0)
				{
					statArgs.critAdd += 5f + (float)(itemCountEffective2 - 1) * 2.5f;
				}
			}
		}
	}

	private static ItemDef _mug;

	private static EquipmentDef _lanceEquipmentDef;

	private static AssetBundle _myBundle;

	private static GameObject _lanceProjectilePrefab;

	private static GameObject _lanceGhost;

	private static ItemDef _comboStarItem;

	private static BuffDef _comboStarBuff;

	private static BuffDef _comboStarMaxBuff;

	private static GameObject _comboStarDisplayPrefab;

	private static GameObject _mugDisplayPrefab;

	private static ItemDef _redshifter;

	private static GameObject _redshifterDisplayPrefab;

	private static GameObject _redshifterDisplayFollowerPrefab;

	private static ItemDef _bioticShell;

	private static GameObject _bioticShellDisplayPrefab;

	public string identifier => "com.MrE42.RiskOfImpact";

	public static ReadOnlyContentPack readOnlyContentPack => new ReadOnlyContentPack(RiskOfImpactContentPack);

	internal static ContentPack RiskOfImpactContentPack { get; } = new ContentPack();


	public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
	{
		AssetBundleCreateRequest asyncOperation = AssetBundle.LoadFromFileAsync(RiskOfImpactMain.assetBundleDir);
		while (!((AsyncOperation)asyncOperation).isDone)
		{
			args.ReportProgress(((AsyncOperation)asyncOperation).progress);
			yield return null;
		}
		_myBundle = asyncOperation.assetBundle;
		_mug = _myBundle.LoadAsset<ItemDef>("Mug");
		_mugDisplayPrefab = _myBundle.LoadAsset<GameObject>("PickupDD");
		_comboStarItem = _myBundle.LoadAsset<ItemDef>("ComboStar");
		_comboStarBuff = _myBundle.LoadAsset<BuffDef>("ComboStarBuff");
		_comboStarMaxBuff = _myBundle.LoadAsset<BuffDef>("MaxStarBuff");
		_comboStarDisplayPrefab = _myBundle.LoadAsset<GameObject>("PickupCS");
		_redshifter = _myBundle.LoadAsset<ItemDef>("Redshifter");
		_redshifterDisplayPrefab = _myBundle.LoadAsset<GameObject>("PlayerDisplayRS");
		_redshifterDisplayFollowerPrefab = _myBundle.LoadAsset<GameObject>("DisplayFollowerRS");
		_bioticShell = _myBundle.LoadAsset<ItemDef>("BioticShell");
		_bioticShell.requiredExpansion = Addressables.LoadAssetAsync<ExpansionDef>((object)"RoR2/DLC1/Common/DLC1.asset").WaitForCompletion();
		_bioticShellDisplayPrefab = _myBundle.LoadAsset<GameObject>("PickupBS");
		_lanceEquipmentDef = _myBundle.LoadAsset<EquipmentDef>("LanceOfLonginusEquipmentDef");
		_lanceProjectilePrefab = _myBundle.LoadAsset<GameObject>("LanceProjectilePrefab");
		ExpansionDef val = _myBundle.LoadAsset<ExpansionDef>("RiskOfImpactExpansion");
		ExpansionDef val2 = _myBundle.LoadAsset<ExpansionDef>("ExtraExpansion");
		_lanceGhost = _myBundle.LoadAsset<GameObject>("LanceGhost");
		_lanceProjectilePrefab.GetComponent<ProjectileController>().ghostPrefab = _lanceGhost;
		ItemDisplayRuleDict val3 = new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		ItemDisplayRuleDict val4 = new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		ItemDisplayRuleDict val5 = new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		ItemDisplayRuleDict val6 = new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		ItemDisplayRuleDict val7 = new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		val4.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(0.20239f, -0.06471f, -0.01451f),
				localAngles = new Vector3(7.55425f, 100.9208f, 181.4531f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val3.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(-0.22258f, -0.06758f, 0.03077f),
				localAngles = new Vector3(353.157f, 193.3047f, 206.7511f),
				localScale = new Vector3(0.1f, 0.1f, 0.1f)
			}
		});
		val5.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "Base",
				localPos = new Vector3(0.659f, 0.394f, -0.787f),
				localAngles = new Vector3(90.0003f, 180.079f, 180.4018f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(-3E-05f, 0.32895f, 0.17171f),
				localAngles = new Vector3(344.5746f, 359.8877f, 359.99f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val4.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(0.18116f, -0.05787f, 0.01043f),
				localAngles = new Vector3(32.08101f, 101.53f, 186.5844f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val3.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(-0.18304f, -0.07066f, -0.03466f),
				localAngles = new Vector3(1.01352f, 196.2477f, 177.5963f),
				localScale = new Vector3(0.1f, 0.1f, 0.1f)
			}
		});
		val5.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "Base",
				localPos = new Vector3(0.659f, 0.394f, -0.787f),
				localAngles = new Vector3(90.0003f, 180.079f, 180.4018f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(-0.00947f, 0.15638f, 0.17891f),
				localAngles = new Vector3(337.9482f, 358.7204f, 52.48233f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val4.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(0.20239f, -0.06471f, -0.01451f),
				localAngles = new Vector3(7.55425f, 100.9208f, 181.4531f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val3.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(-0.24089f, -0.03475f, -0.08941f),
				localAngles = new Vector3(351.2207f, 180.0096f, 189.8164f),
				localScale = new Vector3(0.1f, 0.1f, 0.1f)
			}
		});
		val5.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "ROOT",
				localPos = new Vector3(-0.36643f, 1.76863f, 0.55818f),
				localAngles = new Vector3(0.0713f, 344.7929f, 0f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "UpperArmR",
				localPos = new Vector3(-0.00694f, 0.18783f, -0.07376f),
				localAngles = new Vector3(337.5303f, 183.404f, 317.6291f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val4.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(2.66884f, 1.38091f, 1.85382f),
				localAngles = new Vector3(0f, 90f, 0f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val3.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Hip",
				localPos = new Vector3(2.45337f, 0.28995f, -0.52838f),
				localAngles = new Vector3(353.157f, 15.00789f, 206.7511f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val5.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(5.86281f, 6.67238f, 1.90503f),
				localAngles = new Vector3(0f, 90f, 0f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(-0.06f, 1.16f, 3.24f),
				localAngles = new Vector3(8.85492f, 346.6888f, 13.30589f),
				localScale = new Vector3(0.5f, 0.5f, 0.5f)
			}
		});
		val4.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(0.24459f, -0.04413f, -0.01453f),
				localAngles = new Vector3(7.55425f, 100.9208f, 181.4531f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val3.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(-0.27511f, -0.00163f, 0.03076f),
				localAngles = new Vector3(353.157f, 193.3047f, 206.7511f),
				localScale = new Vector3(0.1f, 0.1f, 0.1f)
			}
		});
		val5.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "Base",
				localPos = new Vector3(0.659f, 0.394f, -0.787f),
				localAngles = new Vector3(90.0003f, 180.079f, 180.4018f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(-0.0041f, 0.2951f, 0.2481f),
				localAngles = new Vector3(337.6299f, 359.5753f, 0.39165f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val4.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(0.20239f, -0.06471f, -0.01451f),
				localAngles = new Vector3(7.55425f, 100.9208f, 181.4531f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val3.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(-0.22258f, -0.06758f, 0.03077f),
				localAngles = new Vector3(353.157f, 193.3047f, 206.7511f),
				localScale = new Vector3(0.1f, 0.1f, 0.1f)
			}
		});
		val5.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "Base",
				localPos = new Vector3(0.659f, 0.394f, -0.787f),
				localAngles = new Vector3(90.0003f, 180.079f, 180.4018f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(-0.006f, 0.202f, 0.135f),
				localAngles = new Vector3(328.7007f, 21.62506f, 345.3727f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val4.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(0.21235f, 0.06133f, -0.02965f),
				localAngles = new Vector3(15.33725f, 100.263f, 182.9367f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val3.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(-0.23385f, 0.04143f, -0.05599f),
				localAngles = new Vector3(353.3026f, 173.733f, 204.3656f),
				localScale = new Vector3(0.1f, 0.1f, 0.1f)
			}
		});
		val5.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "Base",
				localPos = new Vector3(0.659f, 0.394f, -0.787f),
				localAngles = new Vector3(90.0003f, 180.079f, 180.4018f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(0.024f, 0.206f, 0.174f),
				localAngles = new Vector3(324.9625f, 6.28376f, 355.0841f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val4.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "PlatformBase",
				localPos = new Vector3(0.7219f, 0.13116f, 0.2195f),
				localAngles = new Vector3(351.8981f, 73.25513f, 358.5338f),
				localScale = new Vector3(0.4f, 0.4f, 0.4f)
			}
		});
		val3.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "PlatformBase",
				localPos = new Vector3(-0.75075f, 0.07669f, 0.03075f),
				localAngles = new Vector3(5.2294f, 355.3522f, 20.07811f),
				localScale = new Vector3(0.4f, 0.4f, 0.4f)
			}
		});
		val5.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "PlatformBase",
				localPos = new Vector3(2.24017f, 2.11404f, 0.21945f),
				localAngles = new Vector3(351.8981f, 73.25513f, 358.5338f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "PlatformBase",
				localPos = new Vector3(0.661f, -0.186f, 0.157f),
				localAngles = new Vector3(352.855f, 89.99998f, 351.2419f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val4.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(0.23944f, 0.01208f, -0.05754f),
				localAngles = new Vector3(0f, 90f, 0f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val3.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(-0.2722f, -0.06754f, 0.03045f),
				localAngles = new Vector3(6.94817f, 3.35957f, 26.3395f),
				localScale = new Vector3(0.1f, 0.1f, 0.1f)
			}
		});
		val5.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(0.79858f, 0.55478f, 0.42963f),
				localAngles = new Vector3(6.94817f, 3.35957f, 26.3395f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(-0.25771f, 0.01213f, -0.06079f),
				localAngles = new Vector3(0f, 90f, 0f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val4.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Hip",
				localPos = new Vector3(1.94228f, 0.39972f, -0.40409f),
				localAngles = new Vector3(7.55425f, 100.9208f, 181.4531f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val3.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Hip",
				localPos = new Vector3(-2.45304f, 0.54139f, 0.25251f),
				localAngles = new Vector3(19.53804f, 194.0312f, 213.1425f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val5.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "Base",
				localPos = new Vector3(-5.04f, -3.02f, 5.34f),
				localAngles = new Vector3(84.9998f, 359.9714f, 359.584f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(-2.55f, 2.94f, -0.59f),
				localAngles = new Vector3(356.9059f, 69.76768f, 25.01778f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val4.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(0.2758f, -0.10375f, -0.02017f),
				localAngles = new Vector3(7.55425f, 100.9208f, 181.4531f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val3.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(-0.30334f, -0.12005f, 0.02085f),
				localAngles = new Vector3(356.783f, 191.9943f, 191.5501f),
				localScale = new Vector3(0.1f, 0.1f, 0.1f)
			}
		});
		val5.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "Base",
				localPos = new Vector3(0.659f, 0.394f, -0.787f),
				localAngles = new Vector3(90.0003f, 180.079f, 180.4018f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(-0.00288f, 0.22976f, 0.21501f),
				localAngles = new Vector3(343.283f, 350.7494f, 320.7523f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val4.Add("mdlHeretic", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(-0.16834f, 0.20744f, -0.3221f),
				localAngles = new Vector3(321.7271f, 192.0575f, 270.6939f),
				localScale = new Vector3(0.2f, 0.2f, 0.2f)
			}
		});
		val3.Add("mdlHeretic", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(-0.21054f, 0.08455f, 0.4505f),
				localAngles = new Vector3(281.3847f, 102.9863f, 13.02637f),
				localScale = new Vector3(0.2f, 0.2f, 0.2f)
			}
		});
		val5.Add("mdlHeretic", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(-0.68984f, -1.22926f, -1.79202f),
				localAngles = new Vector3(295.4063f, 217.6076f, 232.8437f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val4.Add("mdlRailGunner", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "GunRoot",
				localPos = new Vector3(0f, -0.12961f, 0.06076f),
				localAngles = new Vector3(0f, 0f, 180f),
				localScale = new Vector3(0.05f, 0.05f, 0.05f)
			}
		});
		val3.Add("mdlRailGunner", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Backpack",
				localPos = new Vector3(0.37979f, -0.509f, 0.0309f),
				localAngles = new Vector3(24.20953f, 182.6858f, 49.19599f),
				localScale = new Vector3(0.1f, 0.1f, 0.1f)
			}
		});
		val5.Add("mdlRailGunner", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "Base",
				localPos = new Vector3(0.799f, 0.04025f, -0.28362f),
				localAngles = new Vector3(90.00027f, 180.079f, 180.4018f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlRailGunner", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "UpperArmL",
				localPos = new Vector3(0.00072f, 0.08052f, 0.06183f),
				localAngles = new Vector3(5.06661f, 358.0723f, 116.7787f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val4.Add("mdlVoidSurvivor", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(-0.00645f, 0.02082f, 0.15709f),
				localAngles = new Vector3(11.41105f, 359.2993f, 165.3926f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val3.Add("mdlVoidSurvivor", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(0.03053f, 0.00479f, -0.20481f),
				localAngles = new Vector3(10.27088f, 86.79462f, 192.5363f),
				localScale = new Vector3(0.1f, 0.1f, 0.1f)
			}
		});
		val5.Add("mdlVoidSurvivor", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "Base",
				localPos = new Vector3(0.81593f, 0.92553f, 0.42535f),
				localAngles = new Vector3(88.27319f, 357.384f, 352.9297f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlVoidSurvivor", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "UpperArmR",
				localPos = new Vector3(0.21565f, -0.04918f, 0.00468f),
				localAngles = new Vector3(10.95605f, 105.0443f, 191.8376f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val4.Add("mdlSeeker", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(0.22783f, 0.02224f, -0.00465f),
				localAngles = new Vector3(339.8495f, 78.9239f, 353.0269f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val3.Add("mdlSeeker", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(-0.26268f, 0.04164f, -0.02405f),
				localAngles = new Vector3(354.4812f, 351.9723f, 342.0317f),
				localScale = new Vector3(0.1f, 0.1f, 0.1f)
			}
		});
		val5.Add("mdlSeeker", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "Base",
				localPos = new Vector3(0.649f, 1.727f, -0.109f),
				localAngles = new Vector3(14.33531f, 0.39733f, 0.22404f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlSeeker", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(-0.0041f, 0.07456f, 0.1186f),
				localAngles = new Vector3(352.4757f, 353.3727f, 4.8746f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val4.Add("mdlFalseSon", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(0.31534f, 0.11852f, -0.14177f),
				localAngles = new Vector3(339.1165f, 125.6798f, 352.5457f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val3.Add("mdlFalseSon", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(-0.27259f, 0.11521f, -0.22216f),
				localAngles = new Vector3(358.424f, 318.1652f, 346.5849f),
				localScale = new Vector3(0.1f, 0.1f, 0.1f)
			}
		});
		val5.Add("mdlFalseSon", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "Root",
				localPos = new Vector3(0.966f, 3.37f, -0.347f),
				localAngles = new Vector3(11.01017f, 359.0091f, 0.39317f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlFalseSon", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(0.02305f, 0.42224f, 0.16099f),
				localAngles = new Vector3(308.0242f, 354.2237f, 354.7403f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val4.Add("mdlChef", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(0.1323f, 0.20992f, -0.3466f),
				localAngles = new Vector3(352.6544f, 180.1904f, 314.3582f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val3.Add("mdlChef", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "OvenDoor",
				localPos = new Vector3(-0.58416f, 0.06339f, 0.09305f),
				localAngles = new Vector3(4.14493f, 2.58369f, 8.85832f),
				localScale = new Vector3(0.1f, 0.1f, 0.1f)
			}
		});
		val5.Add("mdlChef", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "Root",
				localPos = new Vector3(-0.787f, 1.34229f, 0.41002f),
				localAngles = new Vector3(0.11209f, 89.41496f, 19.53264f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlChef", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(-0.2804f, 0.1809f, 0.0058f),
				localAngles = new Vector3(359.487f, 89.95702f, 183.1426f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val4.Add("mdlDroneTech", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(0.18679f, 0.07799f, 0.0409f),
				localAngles = new Vector3(347.8549f, 103.8105f, 359.8152f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val3.Add("mdlDroneTech", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(-0.14239f, 0.08143f, 0.07492f),
				localAngles = new Vector3(26.93316f, 359.0482f, 33.11788f),
				localScale = new Vector3(0.1f, 0.1f, 0.1f)
			}
		});
		val5.Add("mdlDroneTech", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "Base",
				localPos = new Vector3(-0.568f, 1.189f, 0f),
				localAngles = new Vector3(350.118f, 180f, 180f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlDroneTech", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(-0.001f, -0.0999f, -0.0822f),
				localAngles = new Vector3(286.3296f, 353.8997f, 22.19561f),
				localScale = new Vector3(0.06f, 0.06f, 0.06f)
			}
		});
		val4.Add("mdlDrifter", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(-0.1024f, 0.00187f, -0.37851f),
				localAngles = new Vector3(357.0724f, 189.1636f, 280.7911f),
				localScale = new Vector3(0.12f, 0.12f, 0.12f)
			}
		});
		val3.Add("mdlDrifter", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Pelvis",
				localPos = new Vector3(-0.18712f, -0.06656f, 0.3887f),
				localAngles = new Vector3(275.4132f, 1.23565f, 85.85339f),
				localScale = new Vector3(0.1f, 0.1f, 0.1f)
			}
		});
		val5.Add("mdlDrifter", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "Base",
				localPos = new Vector3(0.39681f, -0.65566f, 0.66076f),
				localAngles = new Vector3(318.5939f, 293.7787f, 169.5416f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlDrifter", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "Chest",
				localPos = new Vector3(-0.03096f, 0.27478f, -0.01272f),
				localAngles = new Vector3(315.9871f, 247.1702f, 194.6353f),
				localScale = new Vector3(0.06f, 0.06f, 0.06f)
			}
		});
		val4.Add("mdlBasicTank", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Bruiser_Hull",
				localPos = new Vector3(-0.94709f, 0.66307f, 0.0552f),
				localAngles = new Vector3(0f, 270f, 0f),
				localScale = new Vector3(0.2f, 0.2f, 0.2f)
			}
		});
		val3.Add("mdlBasicTank", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "CannonMuzzle0",
				localPos = new Vector3(0f, 0.16607f, -0.07901f),
				localAngles = new Vector3(0f, 270f, 0f),
				localScale = new Vector3(0.1f, 0.1f, 0.1f)
			}
		});
		val5.Add("mdlBasicTank", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "ROOT",
				localPos = new Vector3(1.50346f, 2.04334f, -0.38996f),
				localAngles = new Vector3(-1E-05f, 180f, 180f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val3.Add("mdlDefectiveUnit (1)", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Body",
				localPos = new Vector3(0.53761f, 0.58974f, 0.39026f),
				localAngles = new Vector3(307.4664f, 2.9877f, 336.0304f),
				localScale = new Vector3(0.2f, 0.2f, 0.2f)
			}
		});
		val4.Add("mdlEngiTurret", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _comboStarDisplayPrefab,
				childName = "Head",
				localPos = new Vector3(0f, 0.83617f, -0.7562f),
				localAngles = new Vector3(298.6673f, 0f, 1E-05f),
				localScale = new Vector3(0.3f, 0.3f, 0.3f)
			}
		});
		val3.Add("mdlEngiTurret", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _mugDisplayPrefab,
				childName = "Head",
				localPos = new Vector3(0f, 0.84778f, -1.66701f),
				localAngles = new Vector3(0f, 270f, 20.28025f),
				localScale = new Vector3(0.3f, 0.3f, 0.3f)
			}
		});
		val5.Add("mdlEngiTurret", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _redshifterDisplayPrefab,
				childName = "Base",
				localPos = new Vector3(2.07f, 3.72f, 0.41f),
				localAngles = new Vector3(-0.0003f, 180.079f, 180.4018f),
				localScale = new Vector3(1f, 1f, 1f)
			}
		});
		val6.Add("mdlEngiTurret", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
		{
			new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = _bioticShellDisplayPrefab,
				childName = "Head",
				localPos = new Vector3(0f, 0f, -0.326f),
				localAngles = new Vector3(358.6553f, 0f, 0f),
				localScale = new Vector3(0.42f, 0.42f, 0.42f)
			}
		});
		ItemAPI.Add(new CustomItem(_mug, val3));
		ItemAPI.Add(new CustomItem(_comboStarItem, val4));
		ItemAPI.Add(new CustomItem(_redshifter, val5));
		ItemAPI.Add(new CustomItem(_bioticShell, val6));
		ItemAPI.Add(new CustomEquipment(_lanceEquipmentDef, val7));
		RiskOfImpactContentPack.itemDefs.Add((ItemDef[])(object)new ItemDef[1] { _mug });
		RiskOfImpactContentPack.itemDefs.Add((ItemDef[])(object)new ItemDef[1] { _comboStarItem });
		RiskOfImpactContentPack.buffDefs.Add((BuffDef[])(object)new BuffDef[1] { _comboStarBuff });
		RiskOfImpactContentPack.buffDefs.Add((BuffDef[])(object)new BuffDef[1] { _comboStarMaxBuff });
		RiskOfImpactContentPack.itemDefs.Add((ItemDef[])(object)new ItemDef[1] { _redshifter });
		RiskOfImpactContentPack.itemDefs.Add((ItemDef[])(object)new ItemDef[1] { _bioticShell });
		RiskOfImpactContentPack.equipmentDefs.Add((EquipmentDef[])(object)new EquipmentDef[1] { _lanceEquipmentDef });
		RiskOfImpactContentPack.projectilePrefabs.Add((GameObject[])(object)new GameObject[1] { _lanceProjectilePrefab });
		RiskOfImpactContentPack.expansionDefs.Add((ExpansionDef[])(object)new ExpansionDef[1] { val });
		RiskOfImpactContentPack.expansionDefs.Add((ExpansionDef[])(object)new ExpansionDef[1] { val2 });
		LanguageAPI.Add("EQUIPMENT_LANCEOFLONGINUS_NAME", "Lance of Longinus");
		LanguageAPI.Add("EQUIPMENT_LANCEOFLONGINUS_PICKUP", "Throw a mighty lance that impales enemies and can be retrieved, <style=cIsLunar>but at a cost</style>.");
		LanguageAPI.Add("EQUIPMENT_LANCEOFLONGINUS_DESC", "Throw a spear for <style=cIsDamage>9000%</style> damage, <style=cIsLunar>but</style> lose <style=cIsHealth>20%</style> maximum health.");
		LanguageAPI.Add("DD_NAME", "Cheerful Mug");
		LanguageAPI.Add("DD_PICKUP", "Wait, are those marshmallows or sugar cubes?");
		LanguageAPI.Add("DD_DESC", "Gain <style=cIsUtility>69%</style> (<style=cStack>+69% per stack</style>) movement and attack speed");
		LanguageAPI.Add("COMBOSTAR_NAME", "Combo Star");
		LanguageAPI.Add("COMBOSTAR_PICKUP", "Hitting enemies builds damage, missing a hit resets it.");
		LanguageAPI.Add("COMBOSTAR_DESC", "Hitting an enemy increases your damage by <style=cIsDamage>3%</style> (<style=cStack>+0.5% per stack</style>), up to <style=cIsUtility>20</style> (<style=cStack>+10 per stack</style>). Missing a skill hit <style=cDeath>resets all stacks</style>. At maximum stacks, gain <style=cIsDamage>5%</style> (<style=cStack>+2.5% per stack</style>) crit chance.");
		LanguageAPI.Add("RS_NAME", "Redshifter");
		LanguageAPI.Add("RS_PICKUP", "Expand space to your benefit");
		LanguageAPI.Add("RS_DESC", "Gain <style=cIsUtility>50%</style> (<style=cStack>+50% per stack</style>) radius and range bonuses");
		LanguageAPI.Add("BIOTICSHELL_NAME", "Biotic Shell");
		LanguageAPI.Add("BIOTICSHELL_PICKUP", "<style=cIsVoid>Corrupts all Personal Shield Generators.</style>\nSlows the degradation of temporary barriers.");
		LanguageAPI.Add("BIOTICSHELL_DESC", "<style=cIsVoid>Corrupts all Personal Shield Generators.</style>\nTemporary barriers decay <style=cIsUtility>12%</style> <style=cStack>(+12% per stack)</style> slower.");
		ItemRelationshipType relationshipType = Addressables.LoadAssetAsync<ItemRelationshipType>((object)"RoR2/DLC1/Common/ContagiousItem.asset").WaitForCompletion();
		ItemDef val8 = Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/Base/PersonalShield/PersonalShield.asset").WaitForCompletion();
		if (!Object.op_Implicit((Object)(object)val8) || !Object.op_Implicit((Object)(object)_bioticShell))
		{
			Debug.LogError((object)"[RiskOfImpact] BioticShell void corruption failed: missing PersonalShield or BioticShell ItemDef.");
		}
		else
		{
			ItemRelationshipProvider val9 = ScriptableObject.CreateInstance<ItemRelationshipProvider>();
			val9.relationshipType = relationshipType;
			val9.relationships = (Pair[])(object)new Pair[1]
			{
				new Pair
				{
					itemDef1 = val8,
					itemDef2 = _bioticShell
				}
			};
			RiskOfImpactContentPack.itemRelationshipProviders.Add((ItemRelationshipProvider[])(object)new ItemRelationshipProvider[1] { val9 });
		}
		Debug.Log((object)"[RiskOfImpactContent] Assets and language tokens registered.");
	}

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

	public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
	{
		object obj = <>c.<>9__24_0;
		if (obj == null)
		{
			StatHookEventHandler val = delegate(CharacterBody body, StatHookEventArgs statArgs)
			{
				if (Object.op_Implicit((Object)(object)body.inventory))
				{
					int itemCountEffective = body.inventory.GetItemCountEffective(_mug);
					if (itemCountEffective > 0)
					{
						statArgs.moveSpeedMultAdd += 0.69f * (float)itemCountEffective;
						statArgs.attackSpeedMultAdd += 0.69f * (float)itemCountEffective;
					}
					int itemCountEffective2 = body.inventory.GetItemCountEffective(_comboStarItem);
					if (itemCountEffective2 > 0)
					{
						int buffCount = body.GetBuffCount(_comboStarBuff);
						if (buffCount > 0)
						{
							float num = (0.03f + (float)(itemCountEffective2 - 1) * 0.005f) * (float)buffCount;
							statArgs.damageMultAdd += num;
							if (body.GetBuffCount(_comboStarMaxBuff) > 0)
							{
								statArgs.critAdd += 5f + (float)(itemCountEffective2 - 1) * 2.5f;
							}
						}
					}
				}
			};
			<>c.<>9__24_0 = val;
			obj = (object)val;
		}
		RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj;
		args.ReportProgress(1f);
		yield break;
	}

	private void AddSelf(AddContentPackProviderDelegate addContentPackProvider)
	{
		addContentPackProvider.Invoke((IContentPackProvider)(object)this);
	}

	internal RiskOfImpactContent()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown
		ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(AddSelf);
	}

	public static EquipmentDef GetLanceEquipmentDef()
	{
		return _lanceEquipmentDef;
	}

	public static GameObject GetLanceProjectilePrefab()
	{
		return _lanceProjectilePrefab;
	}

	public static ItemDef GetComboStarItemDef()
	{
		return _comboStarItem;
	}

	public static BuffDef GetComboStarBuffDef()
	{
		return _comboStarBuff;
	}

	public static BuffDef GetComboStarMaxBuffDef()
	{
		return _comboStarMaxBuff;
	}

	public static ItemDef GetMugItemDef()
	{
		return _mug;
	}

	public static ItemDef GetRedshifterItemDef()
	{
		return _redshifter;
	}

	public static ItemDef GetBioticShellItemDef()
	{
		return _bioticShell;
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.MrE42.RiskOfImpact", "Risk Of Impact", "0.1.0")]
public class RiskOfImpactMain : BaseUnityPlugin
{
	public const string GUID = "com.MrE42.RiskOfImpact";

	public const string MODNAME = "Risk Of Impact";

	public const string VERSION = "0.1.0";

	public static PluginInfo pluginInfo { get; private set; }

	public static RiskOfImpactMain instance { get; private set; }

	internal static AssetBundle assetBundle { get; private set; }

	internal static string assetBundleDir => Path.Combine(Path.GetDirectoryName(pluginInfo.Location), "RiskOfImpactAssets");

	public static bool IsLookingGlassInstalled => Chainloader.PluginInfos.ContainsKey("droppod.lookingglass");

	private void Awake()
	{
		instance = this;
		pluginInfo = ((BaseUnityPlugin)this).Info;
		Debug.Log((object)"[RiskOfImpactMain] Awake: Initializing mod...");
		new RiskOfImpactContent();
		Debug.Log((object)"[RiskOfImpactMain] Content loaded. Initializing Equipment Hook...");
		if (IsLookingGlassInstalled)
		{
			LookingGlassCompat.Init();
		}
		LanceOfLonginusEquipmentHook.Init();
		ComboStarHooks.Init();
		RedshifterHooks.Init();
		BioticShellHooks.Init();
		StartItemTester.Init();
	}

	internal static void LogFatal(object data)
	{
		((BaseUnityPlugin)instance).Logger.LogFatal(data);
	}

	internal static void LogError(object data)
	{
		((BaseUnityPlugin)instance).Logger.LogError(data);
	}

	internal static void LogWarning(object data)
	{
		((BaseUnityPlugin)instance).Logger.LogWarning(data);
	}

	internal static void LogMessage(object data)
	{
		((BaseUnityPlugin)instance).Logger.LogMessage(data);
	}

	internal static void LogInfo(object data)
	{
		((BaseUnityPlugin)instance).Logger.LogInfo(data);
	}

	internal static void LogDebug(object data)
	{
		((BaseUnityPlugin)instance).Logger.LogDebug(data);
	}
}
public static class BioticShellHooks
{
	private const float k = 0.12f;

	public static void Init()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		HealthComponent.GetBarrierDecayRate += new hook_GetBarrierDecayRate(HealthComponent_GetBarrierDecayRate);
	}

	private static float HealthComponent_GetBarrierDecayRate(orig_GetBarrierDecayRate orig, HealthComponent self)
	{
		float num = orig.Invoke(self);
		CharacterBody obj = self?.body;
		Inventory val = ((obj != null) ? obj.inventory : null);
		ItemDef bioticShellItemDef = RiskOfImpactContent.GetBioticShellItemDef();
		if ((Object)(object)val != (Object)null && (Object)(object)bioticShellItemDef != (Object)null)
		{
			int itemCount = val.GetItemCount(bioticShellItemDef);
			if (itemCount > 0)
			{
				float num2 = 1f / (1f + 0.12f * (float)itemCount);
				num *= num2;
			}
		}
		return num;
	}
}
public static class ComboStarHooks
{
	public const int BaseMaxStacks = 20;

	public const int ExtraStacksPerItem = 10;

	public const float SkillHitTimeout = 5f;

	public static void Init()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Expected O, but got Unknown
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Expected O, but got Unknown
		RiskOfImpactMain.LogInfo("[ComboStar] Init: registering hooks.");
		CharacterBody.onBodyStartGlobal += OnBodyStart;
		GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(GlobalEventManager_OnHitEnemy);
		GenericSkill.OnExecute += new hook_OnExecute(GenericSkill_OnExecute);
	}

	private static bool SkillCountsForCombo(GenericSkill skill)
	{
		if (!Object.op_Implicit((Object)(object)skill) || (Object)(object)skill.skillDef == (Object)null)
		{
			RiskOfImpactMain.LogDebug("[ComboStar] SkillCountsForCombo: skill or skillDef is null -> false");
			return false;
		}
		SkillDef skillDef = skill.skillDef;
		string skillNameToken = skillDef.skillNameToken;
		switch (skillNameToken)
		{
		case "RAILGUNNER_SECONDARY_NAME":
			RiskOfImpactMain.LogDebug("[ComboStar] SkillCountsForCombo: " + skillNameToken + " is blacklisted (setup skill) -> false");
			return false;
		case "RAILGUNNER_SPECIAL_NAME":
			RiskOfImpactMain.LogDebug("[ComboStar] SkillCountsForCombo: " + skillNameToken + " is blacklisted (setup skill) -> false");
			return false;
		default:
			if (skillNameToken.StartsWith("CHEESEWITHHOLES_BASICTANK_BODY_UTILITY"))
			{
				RiskOfImpactMain.LogDebug("[ComboStar] SkillCountsForCombo: " + skillNameToken + " is exempt (tank utility) -> false");
				return false;
			}
			break;
		case null:
			break;
		}
		if (!skillDef.isCombatSkill)
		{
			RiskOfImpactMain.LogDebug("[ComboStar] SkillCountsForCombo: " + skillNameToken + " isCombatSkill=false -> false");
			return false;
		}
		RiskOfImpactMain.LogDebug("[ComboStar] SkillCountsForCombo: " + skillNameToken + " isCombatSkill=true -> true");
		return true;
	}

	private static void OnBodyStart(CharacterBody body)
	{
		if (!Object.op_Implicit((Object)(object)((Component)body).GetComponent<ComboStarTracker>()))
		{
			((Component)body).gameObject.AddComponent<ComboStarTracker>();
		}
	}

	private static void GlobalEventManager_OnHitEnemy(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
	{
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		orig.Invoke(self, damageInfo, victim);
		if (!Object.op_Implicit((Object)(object)damageInfo.attacker))
		{
			RiskOfImpactMain.LogDebug("[ComboStar] OnHitEnemy: attacker is null, ignoring.");
			return;
		}
		if (damageInfo.rejected || damageInfo.damage <= 0f)
		{
			RiskOfImpactMain.LogDebug($"[ComboStar] OnHitEnemy: hit rejected or zero damage (rejected={damageInfo.rejected}, damage={damageInfo.damage}), ignoring.");
			return;
		}
		if (DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)67108864)) != 0L)
		{
			RiskOfImpactMain.LogDebug("[ComboStar] OnHitEnemy: DoT damage type, ignoring for Combo Star.");
			return;
		}
		CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
		if (!Object.op_Implicit((Object)(object)component))
		{
			RiskOfImpactMain.LogDebug("[ComboStar] OnHitEnemy: attacker has no CharacterBody, ignoring.");
			return;
		}
		ComboStarTracker component2 = ((Component)component).GetComponent<ComboStarTracker>();
		if ((Object)(object)component2 != (Object)null)
		{
			RiskOfImpactMain.LogDebug($"[ComboStar] OnHitEnemy: registering hit for body={component.GetDisplayName()}, damage={damageInfo.damage}");
			component2.RegisterHit();
		}
		else
		{
			RiskOfImpactMain.LogDebug("[ComboStar] OnHitEnemy: no ComboStarTracker found on " + component.GetDisplayName());
		}
	}

	private static void GenericSkill_OnExecute(orig_OnExecute orig, GenericSkill self)
	{
		CharacterBody characterBody = self.characterBody;
		if (Object.op_Implicit((Object)(object)characterBody) && SkillCountsForCombo(self))
		{
			ComboStarTracker component = ((Component)characterBody).GetComponent<ComboStarTracker>();
			if ((Object)(object)component != (Object)null)
			{
				RiskOfImpactMain.LogDebug("[ComboStar] GenericSkill_OnExecute: eligible skill executed. body=" + characterBody.GetDisplayName() + ", skill=" + self.skillDef.skillNameToken);
				component.OnEligibleSkillExecuted(self);
			}
			else
			{
				RiskOfImpactMain.LogDebug("[ComboStar] GenericSkill_OnExecute: no ComboStarTracker on body=" + characterBody.GetDisplayName());
			}
		}
		orig.Invoke(self);
	}
}
public class ComboStarTracker : MonoBehaviour
{
	private struct Bucket
	{
		public float expiresAt;

		public bool hadHit;
	}

	private CharacterBody body;

	private readonly Queue<Bucket> buckets = new Queue<Bucket>();

	private float currentBucketStartTime = -999f;

	private bool stackGrantedThisSkill;

	private const float BucketSeconds = 0.12f;

	private float lastEligibleExecuteTime = -1f;

	private float ewmaExecuteInterval = 0.12f;

	private const float ExecuteIntervalAlpha = 0.2f;

	private const float ActiveMinTimeout = 0.35f;

	private const float ActiveMaxTimeout = 2f;

	private const float ActiveBaseTimeout = 0.1f;

	private const float ActiveIntervalMultiplier = 4f;

	private void Awake()
	{
		body = ((Component)this).GetComponent<CharacterBody>();
	}

	private void OnEnable()
	{
		ResetCombo("OnEnable");
	}

	private void OnDisable()
	{
		ResetCombo("OnDisable");
	}

	private float ComputeBucketTimeoutSeconds(bool comboActive)
	{
		if (!comboActive)
		{
			return 5f;
		}
		return Mathf.Clamp(0.1f + 4f * ewmaExecuteInterval, 0.35f, Mathf.Min(2f, 5f));
	}

	public void OnEligibleSkillExecuted(GenericSkill skill)
	{
		if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory) || body.inventory.GetItemCountEffective(RiskOfImpactContent.GetComboStarItemDef()) <= 0)
		{
			return;
		}
		BuffDef comboStarBuffDef = RiskOfImpactContent.GetComboStarBuffDef();
		int buffCount = body.GetBuffCount(comboStarBuffDef);
		float time = Time.time;
		if (lastEligibleExecuteTime > 0f)
		{
			float num = time - lastEligibleExecuteTime;
			if (num > 0f && num < 1f)
			{
				ewmaExecuteInterval = Mathf.Lerp(ewmaExecuteInterval, num, 0.2f);
			}
		}
		lastEligibleExecuteTime = time;
		if (buckets.Count == 0 || time - currentBucketStartTime > 0.12f)
		{
			currentBucketStartTime = time;
			bool comboActive = buffCount > 0;
			float num2 = ComputeBucketTimeoutSeconds(comboActive);
			buckets.Enqueue(new Bucket
			{
				hadHit = false,
				expiresAt = time + num2
			});
			RiskOfImpactMain.LogDebug($"[ComboStarTracker] New bucket started. body={body.GetDisplayName()}, stacks={buffCount}, buckets={buckets.Count}");
		}
		else
		{
			RiskOfImpactMain.LogDebug($"[ComboStarTracker] Using existing bucket. body={body.GetDisplayName()}, stacks={buffCount}, buckets={buckets.Count}");
		}
		stackGrantedThisSkill = false;
	}

	public void RegisterHit()
	{
		if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory))
		{
			return;
		}
		int itemCountEffective = body.inventory.GetItemCountEffective(RiskOfImpactContent.GetComboStarItemDef());
		if (itemCountEffective <= 0)
		{
			return;
		}
		if (buckets.Count > 0)
		{
			int count = buckets.Count;
			Bucket item = default(Bucket);
			for (int i = 0; i < count; i++)
			{
				Bucket bucket = buckets.Dequeue();
				if (i == count - 1)
				{
					item = bucket;
				}
				else
				{
					buckets.Enqueue(bucket);
				}
			}
			item.hadHit = true;
			buckets.Enqueue(item);
		}
		BuffDef comboStarBuffDef = RiskOfImpactContent.GetComboStarBuffDef();
		int buffCount = body.GetBuffCount(comboStarBuffDef);
		if (stackGrantedThisSkill)
		{
			return;
		}
		int num = 20 + 10 * (itemCountEffective - 1);
		BuffDef comboStarMaxBuffDef = RiskOfImpactContent.GetComboStarMaxBuffDef();
		if (buffCount < num)
		{
			body.AddBuff(comboStarBuffDef);
			buffCount++;
			stackGrantedThisSkill = true;
			if (buffCount == num)
			{
				body.AddBuff(comboStarMaxBuffDef);
			}
		}
	}

	private void FixedUpdate()
	{
		if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory))
		{
			return;
		}
		int itemCountEffective = body.inventory.GetItemCountEffective(RiskOfImpactContent.GetComboStarItemDef());
		BuffDef comboStarBuffDef = RiskOfImpactContent.GetComboStarBuffDef();
		int buffCount = body.GetBuffCount(comboStarBuffDef);
		int num = 20 + 10 * (itemCountEffective - 1);
		if (itemCountEffective <= 0)
		{
			if (buffCount > 0)
			{
				ResetCombo("Lost all items");
			}
			return;
		}
		while (buckets.Count > 0 && Time.time >= buckets.Peek().expiresAt)
		{
			Bucket bucket = buckets.Dequeue();
			if (buffCount > 0 && !bucket.hadHit)
			{
				RiskOfImpactMain.LogInfo("[ComboStarTracker] Bucket expired without hit, resetting combo. body=" + body.GetDisplayName());
				ResetCombo("Bucket expired without hit");
				return;
			}
		}
		BuffDef comboStarMaxBuffDef = RiskOfImpactContent.GetComboStarMaxBuffDef();
		int buffCount2 = body.GetBuffCount(comboStarMaxBuffDef);
		if (buffCount < num && buffCount2 > 0)
		{
			body.RemoveBuff(comboStarMaxBuffDef);
		}
	}

	private void ResetCombo(string reason)
	{
		if (!Object.op_Implicit((Object)(object)body))
		{
			return;
		}
		BuffDef comboStarBuffDef = RiskOfImpactContent.GetComboStarBuffDef();
		int buffCount = body.GetBuffCount(comboStarBuffDef);
		if (buffCount > 0)
		{
			RiskOfImpactMain.LogInfo($"[ComboStarTracker] ResetCombo: reason={reason}, body={body.GetDisplayName()}, removing {buffCount} stacks.");
			for (int i = 0; i < buffCount; i++)
			{
				body.RemoveBuff(comboStarBuffDef);
			}
			BuffDef comboStarMaxBuffDef = RiskOfImpactContent.GetComboStarMaxBuffDef();
			if (body.GetBuffCount(comboStarMaxBuffDef) > 0)
			{
				body.RemoveBuff(comboStarMaxBuffDef);
			}
		}
		else
		{
			RiskOfImpactMain.LogDebug("[ComboStarTracker] ResetCombo: reason=" + reason + ", body=" + body.GetDisplayName() + ", no stacks to remove.");
		}
		buckets.Clear();
		currentBucketStartTime = -999f;
	}
}
public class LanceOfLonginusEquipment : MonoBehaviour
{
	public EquipmentDef lanceEquipmentDef;

	public GameObject lanceProjectilePrefab;

	public float damageCoefficient = 90f;

	public float projectileSpeed = 200f;

	public float projectileForce;

	public bool Activate(EquipmentSlot slot)
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)slot) || !Object.op_Implicit((Object)(object)slot.characterBody))
		{
			return false;
		}
		if (!NetworkServer.active)
		{
			return false;
		}
		CharacterBody characterBody = slot.characterBody;
		Ray aimRay = slot.GetAimRay();
		Vector3 position = characterBody.corePosition + Vector3.up * 1f + ((Ray)(ref aimRay)).direction * 1.5f;
		Quaternion rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction) * Quaternion.Euler(90f, 0f, 0f);
		FireProjectileInfo val = default(FireProjectileInfo);
		val.projectilePrefab = lanceProjectilePrefab;
		val.position = position;
		val.rotation = rotation;
		val.owner = ((Component)characterBody).gameObject;
		val.damage = characterBody.damage * damageCoefficient;
		val.force = projectileForce;
		val.crit = Util.CheckRoll(characterBody.crit, characterBody.master);
		((FireProjectileInfo)(ref val)).speedOverride = projectileSpeed;
		val.damageColorIndex = (DamageColorIndex)0;
		FireProjectileInfo val2 = val;
		ProjectileManager.instance.FireProjectile(val2);
		slot.stock = 0;
		if (Object.op_Implicit((Object)(object)characterBody.inventory))
		{
			characterBody.inventory.SetEquipmentIndex((EquipmentIndex)(-1));
		}
		else
		{
			slot.equipmentIndex = (EquipmentIndex)(-1);
		}
		characterBody.AddBuff(Buffs.SoulCost);
		characterBody.AddBuff(Buffs.SoulCost);
		return true;
	}
}
public static class LanceOfLonginusEquipmentHook
{
	public static void Init()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Expected O, but got Unknown
		Debug.Log((object)"[LanceHook] Initializing hook...");
		EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(EquipmentSlot_PerformEquipmentAction);
		Debug.Log((object)"[LanceHook] Hook added.");
	}

	private static bool EquipmentSlot_PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef)
	{
		EquipmentDef lanceEquipmentDef = RiskOfImpactContent.GetLanceEquipmentDef();
		if ((Object)(object)equipmentDef == (Object)(object)lanceEquipmentDef)
		{
			Debug.Log((object)("[LanceHook] Detected Lance activation on " + ((Object)self.characterBody).name));
			LanceOfLonginusEquipment lanceOfLonginusEquipment = ((Component)self).GetComponent<LanceOfLonginusEquipment>();
			if ((Object)(object)lanceOfLonginusEquipment == (Object)null)
			{
				Debug.Log((object)"[LanceHook] Lance behavior not found; adding component.");
				lanceOfLonginusEquipment = ((Component)self).gameObject.AddComponent<LanceOfLonginusEquipment>();
				lanceOfLonginusEquipment.lanceEquipmentDef = lanceEquipmentDef;
				lanceOfLonginusEquipment.lanceProjectilePrefab = RiskOfImpactContent.GetLanceProjectilePrefab();
			}
			Debug.Log((object)("[LanceHook] Activation result: " + lanceOfLonginusEquipment.Activate(self)));
			return false;
		}
		return orig.Invoke(self, equipmentDef);
	}
}
[RequireComponent(typeof(ProjectileController))]
[RequireComponent(typeof(ProjectileDamage))]
[RequireComponent(typeof(TeamFilter))]
[RequireComponent(typeof(Rigidbody))]
[RequireComponent(typeof(Collider))]
public class LanceOfLonginusProjectile : MonoBehaviour
{
	[Header("Behavior")]
	public bool pierceEnemies = true;

	public int maxEnemyHits = 999;

	public float pickupDelaySeconds = 0.35f;

	public float lifetimeSeconds = 600f;

	[Tooltip("If the lance spawns intersecting ground/walls, it can instantly stick. This gives it a grace period.")]
	public float stickArmTime = 0.15f;

	[Header("Reliability (anti-tunneling)")]
	[Tooltip("Layer mask used by the per-tick sweep. Leave as Everything unless you know what you're doing.")]
	public LayerMask sweepMask = LayerMask.op_Implicit(-1);

	[Tooltip("SphereCast radius is derived from the projectile collider bounds extents, multiplied by this.")]
	public float sweepRadiusScale = 0.55f;

	[Tooltip("Minimum sphere sweep radius (in meters).")]
	public float minSweepRadius = 0.18f;

	[Header("Debug")]
	public bool debugHits = true;

	public bool verboseDamageDebug = true;

	public float debugInterval = 0.25f;

	[Header("Sweep radii")]
	public float enemySweepRadiusScale = 0.75f;

	public float worldSweepRadiusScale = 0.35f;

	public float minEnemySweepRadius = 0.3f;

	public float minWorldSweepRadius = 0.12f;

	private ProjectileController controller;

	private ProjectileDamage projectileDamage;

	private TeamFilter teamFilter;

	private Rigidbody rb;

	private Collider hitCollider;

	private bool stuck;

	private int hitCount;

	private readonly HashSet<HealthComponent> hitHealthComponents = new HashSet<HealthComponent>();

	private float spawnTime;

	private Vector3 spawnPos;

	private Vector3 lastPos;

	private float nextDebugTime;

	private const float FallbackSpeed = 200f;

	private void Awake()
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		spawnTime = Time.time;
		spawnPos = ((Component)this).transform.position;
		controller = ((Component)this).GetComponent<ProjectileController>();
		projectileDamage = ((Component)this).GetComponent<ProjectileDamage>();
		teamFilter = ((Component)this).GetComponent<TeamFilter>();
		rb = ((Component)this).GetComponent<Rigidbody>();
		hitCollider = ((Component)this).GetComponent<Collider>();
		hitCollider.isTrigger = true;
		rb.useGravity = false;
		rb.isKinematic = false;
		rb.constraints = (RigidbodyConstraints)0;
		rb.collisionDetectionMode = (CollisionDetectionMode)2;
		rb.interpolation = (RigidbodyInterpolation)1;
		lastPos = rb.position;
		if (debugHits)
		{
			Debug.Log((object)($"[LanceProj] Awake netActive={NetworkServer.active} layer={((Component)this).gameObject.layer} " + $"sweepMask=0x{((LayerMask)(ref sweepMask)).value:X} trigger={hitCollider.isTrigger} pos={((Component)this).transform.position}"));
		}
		Object.Destroy((Object)(object)((Component)this).gameObject, lifetimeSeconds);
	}

	private void Start()
	{
		//IL_0029: 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_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		ProjectileSimple component = ((Component)this).GetComponent<ProjectileSimple>();
		if (Object.op_Implicit((Object)(object)component))
		{
			((Behaviour)component).enabled = false;
		}
		Vector3 velocity;
		if (Object.op_Implicit((Object)(object)rb))
		{
			velocity = rb.velocity;
			if (((Vector3)(ref velocity)).sqrMagnitude <= 0.01f)
			{
				rb.velocity = ((Component)this).transform.up * 200f;
			}
		}
		if (debugHits)
		{
			object arg = rb.velocity;
			velocity = rb.velocity;
			Debug.Log((object)($"[LanceProj] Start vel={arg} speed={((Vector3)(ref velocity)).magnitude:F1} " + string.Format("up={0} owner={1}", ((Component)this).transform.up, (Object.op_Implicit((Object)(object)controller) && Object.op_Implicit((Object)(object)controller.owner)) ? ((Object)controller.owner).name : "null")));
		}
	}

	private void FixedUpdate()
	{
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0159: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_015e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_010d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: 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)
		if (NetworkServer.active)
		{
			SweepForMissedHits();
		}
		Vector3 val;
		if (debugHits && Time.time >= nextDebugTime)
		{
			nextDebugTime = Time.time + debugInterval;
			object arg = ((Component)this).transform.position;
			object arg2;
			if (!Object.op_Implicit((Object)(object)rb))
			{
				arg2 = "noRB";
			}
			else
			{
				val = rb.position;
				arg2 = ((object)(Vector3)(ref val)).ToString();
			}
			string text = $"[LanceProj] Tick pos={arg} rbPos={arg2} ";
			object arg3;
			if (!Object.op_Implicit((Object)(object)rb))
			{
				arg3 = "noRB";
			}
			else
			{
				val = rb.velocity;
				arg3 = ((object)(Vector3)(ref val)).ToString();
			}
			Debug.Log((object)(text + $"vel={arg3} stuck={stuck}"));
		}
		if (!stuck && Object.op_Implicit((Object)(object)rb))
		{
			val = rb.velocity;
			if (((Vector3)(ref val)).sqrMagnitude > 0.01f)
			{
				Transform transform = ((Component)this).transform;
				val = rb.velocity;
				transform.rotation = Quaternion.LookRotation(((Vector3)(ref val)).normalized) * Quaternion.Euler(90f, 0f, 0f);
			}
		}
		lastPos = (Object.op_Implicit((Object)(object)rb) ? rb.position : ((Component)this).transform.position);
	}

	private void OnTriggerEnter(Collider other)
	{
		//IL_007d: 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)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: 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_00f8: Unknown result type (might be due to invalid IL or missing references)
		if (stuck || !Object.op_Implicit((Object)(object)other) || (Object)(object)other == (Object)(object)hitCollider || (Object.op_Implicit((Object)(object)controller) && Object.op_Implicit((Object)(object)controller.owner) && ((Component)other).transform.IsChildOf(controller.owner.transform)))
		{
			return;
		}
		Vector3 hitPosition = (Object.op_Implicit((Object)(object)rb) ? rb.position : ((Component)this).transform.position);
		if (TryDealDamage(other, hitPosition, "TRIGGER"))
		{
			if (!pierceEnemies)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
			return;
		}
		bool flag = Object.op_Implicit((Object)(object)((Component)other).GetComponentInParent<CharacterBody>()) || Object.op_Implicit((Object)(object)((Component)other).GetComponentInParent<HealthComponent>());
		if (other.isTrigger || flag || Time.time - spawnTime < stickArmTime)
		{
			return;
		}
		Vector3 val = rb.position - spawnPos;
		if (!(((Vector3)(ref val)).sqrMagnitude < 0.0625f))
		{
			if (debugHits)
			{
				Debug.Log((object)("[LanceProj] TRIGGER_STICK other=" + ((Object)other).name));
			}
			StickIntoWorld();
		}
	}

	private void SweepForMissedHits()
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_024b: 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_0252: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: 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_02a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_016f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f2: 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_01df: Unknown result type (might be due to invalid IL or missing references)
		//IL_0206: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b6: 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)
		if (stuck || (Object)(object)rb == (Object)null)
		{
			return;
		}
		Vector3 val = lastPos;
		Vector3 position = rb.position;
		Vector3 val2 = position - val;
		float magnitude = ((Vector3)(ref val2)).magnitude;
		if (magnitude < 0.001f)
		{
			return;
		}
		float num = 0.25f;
		if (Object.op_Implicit((Object)(object)hitCollider))
		{
			Bounds bounds = hitCollider.bounds;
			Vector3 extents = ((Bounds)(ref bounds)).extents;
			num = Mathf.Max(extents.x, Mathf.Max(extents.y, extents.z));
		}
		float num2 = Mathf.Max(minEnemySweepRadius, num * enemySweepRadiusScale);
		float num3 = Mathf.Max(minWorldSweepRadius, num * worldSweepRadiusScale);
		Vector3 val3 = val2 / magnitude;
		RaycastHit[] array = Physics.SphereCastAll(val, num2, val3, magnitude, LayerMask.op_Implicit(sweepMask), (QueryTriggerInteraction)2);
		RaycastHit[] array2;
		if (array != null && array.Length != 0)
		{
			Array.Sort(array, (RaycastHit a, RaycastHit b) => ((RaycastHit)(ref a)).distance.CompareTo(((RaycastHit)(ref b)).distance));
			if (debugHits)
			{
				Debug.Log((object)$"[LanceProj] SWEEP_ENEMY from={val} to={position} dist={magnitude:F3} r={num2:F3} hits={array.Length}");
			}
			array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				RaycastHit val4 = array2[i];
				Collider collider = ((RaycastHit)(ref val4)).collider;
				if (Object.op_Implicit((Object)(object)collider) && !((Object)(object)collider == (Object)(object)hitCollider) && (!Object.op_Implicit((Object)(object)controller) || !Object.op_Implicit((Object)(object)controller.owner) || !((Component)collider).transform.IsChildOf(controller.owner.transform)) && TryDealDamage(collider, ((RaycastHit)(ref val4)).point, "SWEEP_ENEMY"))
				{
					if (debugHits)
					{
						Debug.Log((object)$"[LanceProj] SWEEP_ENEMY_DAMAGE other={((Object)collider).name} point={((RaycastHit)(ref val4)).point} dist={((RaycastHit)(ref val4)).distance:F3}");
					}
					if (!pierceEnemies)
					{
						Object.Destroy((Object)(object)((Component)this).gameObject);
						return;
					}
				}
			}
		}
		RaycastHit[] array3 = Physics.SphereCastAll(val, num3, val3, magnitude, LayerMask.op_Implicit(sweepMask), (QueryTriggerInteraction)2);
		if (array3 == null || array3.Length == 0)
		{
			return;
		}
		Array.Sort(array3, (RaycastHit a, RaycastHit b) => ((RaycastHit)(ref a)).distance.CompareTo(((RaycastHit)(ref b)).distance));
		if (debugHits)
		{
			Debug.Log((object)$"[LanceProj] SWEEP_WORLD from={val} to={position} dist={magnitude:F3} r={num3:F3} hits={array3.Length}");
		}
		array2 = array3;
		for (int i = 0; i < array2.Length; i++)
		{
			RaycastHit val5 = array2[i];
			Collider collider2 = ((RaycastHit)(ref val5)).collider;
			if (!Object.op_Implicit((Object)(object)collider2) || (Object)(object)collider2 == (Object)(object)hitCollider || (Object.op_Implicit((Object)(object)controller) && Object.op_Implicit((Object)(object)controller.owner) && ((Component)collider2).transform.IsChildOf(controller.owner.transform)))
			{
				continue;
			}
			bool flag = Object.op_Implicit((Object)(object)((Component)collider2).GetComponentInParent<CharacterBody>()) || Object.op_Implicit((Object)(object)((Component)collider2).GetComponentInParent<HealthComponent>());
			if (collider2.isTrigger || flag || Time.time - spawnTime < stickArmTime)
			{
				continue;
			}
			Vector3 val6 = rb.position - spawnPos;
			if (!(((Vector3)(ref val6)).sqrMagnitude < 0.0625f))
			{
				if (debugHits)
				{
					Debug.Log((object)$"[LanceProj] SWEEP_WORLD_STICK other={((Object)collider2).name} point={((RaycastHit)(ref val5)).point} dist={((RaycastHit)(ref val5)).distance:F3}");
				}
				StickIntoWorld();
				break;
			}
		}
	}

	private bool TryDealDamage(Collider other, Vector3 hitPosition, string srcTag)
	{
		//IL_015c: 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_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_019c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d4: 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_02e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0308: Unknown result type (might be due to invalid IL or missing references)
		//IL_0314: Unknown result type (might be due to invalid IL or missing references)
		//IL_0339: Unknown result type (might be due to invalid IL or missing references)
		//IL_035a: 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_035c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0361: Unknown result type (might be due to invalid IL or missing references)
		//IL_037c: Unknown result type (might be due to invalid IL or missing references)
		//IL_036f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0381: Unknown result type (might be due to invalid IL or missing references)
		//IL_0386: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b7: 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_03c0: Expected O, but got Unknown
		//IL_043a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0443: Unknown result type (might be due to invalid IL or missing references)
		//IL_045b: Unknown result type (might be due to invalid IL or missing references)
		//IL_047e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0483: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkServer.active)
		{
			return false;
		}
		HurtBox val = ((Component)other).GetComponent<HurtBox>() ?? ((Component)other).GetComponentInParent<HurtBox>();
		HealthComponent val2 = (Object.op_Implicit((Object)(object)val) ? val.healthComponent : ((Component)other).GetComponentInParent<HealthComponent>());
		if (!Object.op_Implicit((Object)(object)val2))
		{
			if (debugHits && verboseDamageDebug)
			{
				Debug.Log((object)$"[LanceProj] {srcTag}_NO_HC other={((Object)other).name} layer={((Component)other).gameObject.layer} trig={other.isTrigger}");
			}
			return false;
		}
		if (Object.op_Implicit((Object)(object)controller) && Object.op_Implicit((Object)(object)controller.owner) && (Object)(object)((Component)val2).gameObject == (Object)(object)controller.owner)
		{
			if (debugHits && verboseDamageDebug)
			{
				Debug.Log((object)("[LanceProj] " + srcTag + "_SKIP_OWNER hc=" + ((Object)val2).name + " other=" + ((Object)other).name));
			}
			return false;
		}
		TeamIndex val3 = (Object.op_Implicit((Object)(object)val) ? val.teamIndex : ((Object.op_Implicit((Object)(object)val2.body) && Object.op_Implicit((Object)(object)val2.body.teamComponent)) ? val2.body.teamComponent.teamIndex : TeamComponent.GetObjectTeam(((Component)val2).gameObject)));
		TeamIndex val4 = (TeamIndex)((!Object.op_Implicit((Object)(object)teamFilter)) ? ((Object.op_Implicit((Object)(object)controller) && Object.op_Implicit((Object)(object)controller.owner)) ? ((int)TeamComponent.GetObjectTeam(controller.owner)) : (-1)) : ((int)teamFilter.teamIndex));
		if (val3 == val4)
		{
			if (debugHits && verboseDamageDebug)
			{
				Debug.Log((object)$"[LanceProj] {srcTag}_SKIP_SAME_TEAM victimTeam={val3} myTeam={val4} hc={((Object)val2).name}");
			}
			return false;
		}
		if (hitCount >= maxEnemyHits)
		{
			if (debugHits && verboseDamageDebug)
			{
				Debug.Log((object)("[LanceProj] " + srcTag + "_MAX_HITS_REACHED hc=" + ((Object)val2).name));
			}
			return true;
		}
		HealthComponent val5 = ((Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent)) ? val.healthComponent : val2);
		if (Object.op_Implicit((Object)(object)val5) && hitHealthComponents.Contains(val5))
		{
			if (debugHits && verboseDamageDebug)
			{
				Debug.Log((object)("[LanceProj] " + srcTag + "_ALREADY_HIT hc=" + ((Object)val5).name + " other=" + ((Object)other).name));
			}
			return true;
		}
		if (Object.op_Implicit((Object)(object)val5))
		{
			hitHealthComponents.Add(val5);
		}
		hitCount++;
		DamageInfo val6 = new DamageInfo
		{
			attacker = (Object.op_Implicit((Object)(object)controller) ? controller.owner : null),
			inflictor = ((Component)this).gameObject,
			damage = (Object.op_Implicit((Object)(object)projectileDamage) ? projectileDamage.damage : 0f),
			crit = (Object.op_Implicit((Object)(object)projectileDamage) && projectileDamage.crit),
			position = hitPosition,
			force = (Object.op_Implicit((Object)(object)rb) ? rb.velocity : Vector3.zero),
			procCoefficient = (Object.op_Implicit((Object)(object)controller) ? controller.procCoefficient : 1f),
			damageType = DamageTypeCombo.op_Implicit((DamageType)0),
			damageColorIndex = (DamageColorIndex)0
		};
		if (debugHits && verboseDamageDebug)
		{
			string[] obj = new string[8]
			{
				"[LanceProj] ",
				srcTag,
				"_DAMAGE hc=",
				((Object)val2).name,
				" body=",
				Object.op_Implicit((Object)(object)val2.body) ? ((Object)val2.body).name : "none",
				" ",
				null
			};
			object[] obj2 = new object[5] { val3, val4, val6.damage, hitPosition, null };
			object obj3;
			if (!Object.op_Implicit((Object)(object)rb))
			{
				obj3 = "noRB";
			}
			else
			{
				Vector3 velocity = rb.velocity;
				obj3 = ((object)(Vector3)(ref velocity)).ToString();
			}
			obj2[4] = obj3;
			obj[7] = string.Format("victimTeam={0} myTeam={1} dmg={2:F1} pos={3} vel={4}", obj2);
			Debug.Log((object)string.Concat(obj));
		}
		val2.TakeDamage(val6);
		GlobalEventManager.instance.OnHitEnemy(val6, ((Component)val2).gameObject);
		GlobalEventManager.instance.OnHitAll(val6, ((Component)val2).gameObject);
		return true;
	}

	private void StickIntoWorld()
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		if (stuck)
		{
			return;
		}
		stuck = true;
		if (debugHits)
		{
			object arg = ((Component)this).transform.position;
			object arg2;
			if (!Object.op_Implicit((Object)(object)rb))
			{
				arg2 = "noRB";
			}
			else
			{
				Vector3 velocity = rb.velocity;
				arg2 = ((object)(Vector3)(ref velocity)).ToString();
			}
			Debug.Log((object)$"[LanceProj] STUCK pos={arg} vel={arg2}");
		}
		if (Object.op_Implicit((Object)(object)rb))
		{
			rb.velocity = Vector3.zero;
			rb.angularVelocity = Vector3.zero;
			rb.isKinematic = true;
		}
		if (Object.op_Implicit((Object)(object)projectileDamage))
		{
			((Behaviour)projectileDamage).enabled = false;
		}
		Collider obj = hitCollider;
		BoxCollider val = (BoxCollider)(object)((obj is BoxCollider) ? obj : null);
		if (val != null)
		{
			val.size *= 3f;
		}
		if (!Object.op_Implicit((Object)(object)((Component)this).GetComponent<LancePickupTrigger>()))
		{
			LancePickupTrigger lancePickupTrigger = ((Component)this).gameObject.AddComponent<LancePickupTrigger>();
			lancePickupTrigger.lanceEquipmentDef = RiskOfImpactContent.GetLanceEquipmentDef();
			lancePickupTrigger.pickupActivationTime = Time.time + pickupDelaySeconds;
		}
	}
}
public class LancePickupTrigger : MonoBehaviour
{
	public EquipmentDef lanceEquipmentDef;

	public float pickupActivationTime;

	private void Start()
	{
		Collider component = ((Component)this).GetComponent<Collider>();
		if (Object.op_Implicit((Object)(object)component))
		{
			component.isTrigger = true;
		}
	}

	private void OnTriggerEnter(Collider other)
	{
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Invalid comparison between Unknown and I4
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkServer.active || Time.time < pickupActivationTime)
		{
			return;
		}
		CharacterBody componentInParent = ((Component)other).GetComponentInParent<CharacterBody>();
		if (!Object.op_Implicit((Object)(object)componentInParent) || !componentInParent.isPlayerControlled)
		{
			return;
		}
		EquipmentSlot component = ((Component)componentInParent).GetComponent<EquipmentSlot>();
		if (!Object.op_Implicit((Object)(object)component))
		{
			return;
		}
		EquipmentIndex val = lanceEquipmentDef.equipmentIndex;
		if ((int)val == -1)
		{
			val = EquipmentCatalog.FindEquipmentIndex(((Object)lanceEquipmentDef).name);
		}
		if ((int)val != -1)
		{
			if (Object.op_Implicit((Object)(object)componentInParent.inventory))
			{
				componentInParent.inventory.SetEquipmentIndex(val, false);
			}
			else
			{
				component.equipmentIndex = val;
			}
			component.stock = 1;
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
public class LanceTeam : TeamFilter
{
	private void UNetVersion()
	{
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		bool flag = ((TeamFilter)this).OnSerialize(writer, forceAll);
		bool flag2 = default(bool);
		return flag2 || flag;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
		((TeamFilter)this).OnDeserialize(reader, initialState);
	}

	public override void PreStartClient()
	{
		((TeamFilter)this).PreStartClient();
	}
}
public static class LookingGlassCompat
{
	public static void Init()
	{
		if (!Chainloader.PluginInfos.ContainsKey("droppod.lookingglass"))
		{
			RiskOfImpactMain.LogInfo("[ComboStar LG] LookingGlass not detected, skipping compat.");
		}
		else
		{
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(RegisterItemStatsSafe));
		}
	}

	[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
	private static void RegisterItemStatsSafe()
	{
		try
		{
			RegisterComboStarItemStats();
			RegisterMugItemStats();
			RegisterRedshifterItemStats();
			RegisterBioticShellItemStats();
		}
		catch (Exception ex)
		{
			RiskOfImpactMain.LogError("[RiskOfImpact LG] Failed to register stats: " + ex);
		}
	}

	[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
	private static void RegisterMugItemStats()
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Expected I4, but got Unknown
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Expected O, but got Unknown
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Expected I4, but got Unknown
		ItemDef mugItemDef = RiskOfImpactContent.GetMugItemDef();
		if (!Object.op_Implicit((Object)(object)mugItemDef))
		{
			RiskOfImpactMain.LogError("[Mug LG] Cheerful Mug ItemDef missing, aborting.");
			return;
		}
		Dictionary<int, ItemStatsDef> allItemDefinitions = ItemDefinitions.allItemDefinitions;
		if (allItemDefinitions == null)
		{
			RiskOfImpactMain.LogError("[Mug LG] ItemDefinitions.allItemDefinitions is null.");
			return;
		}
		if (!allItemDefinitions.TryGetValue((int)mugItemDef.itemIndex, out var value))
		{
			value = new ItemStatsDef();
			allItemDefinitions[(int)mugItemDef.itemIndex] = value;
		}
		value.descriptions.Clear();
		value.valueTypes.Clear();
		value.measurementUnits.Clear();
		value.descriptions.Add("Current bonus: ");
		value.valueTypes.Add((ValueType)2);
		value.measurementUnits.Add((MeasurementUnits)1);
		value.calculateValuesNew = delegate(float luck, int itemCount, float procChance)
		{
			if (itemCount <= 0)
			{
				return new List<float> { 0f, 0f, 0f };
			}
			float num = 69f * (float)itemCount;
			return new List<float>(1) { num / 100f };
		};
		RiskOfImpactMain.LogInfo("[Mug LG] Registered Cheerful Mug item stats with LookingGlass.");
	}

	[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
	private static void RegisterComboStarItemStats()
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Expected I4, but got Unknown
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Expected O, but got Unknown
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Expected I4, but got Unknown
		ItemDef comboStarItemDef = RiskOfImpactContent.GetComboStarItemDef();
		if (!Object.op_Implicit((Object)(object)comboStarItemDef))
		{
			RiskOfImpactMain.LogError("[ComboStar LG] Combo Star ItemDef missing, aborting.");
			return;
		}
		Dictionary<int, ItemStatsDef> allItemDefinitions = ItemDefinitions.allItemDefinitions;
		if (allItemDefinitions == null)
		{
			RiskOfImpactMain.LogError("[ComboStar LG] ItemDefinitions.allItemDefinitions is null.");
			return;
		}
		if (!allItemDefinitions.TryGetValue((int)comboStarItemDef.itemIndex, out var value))
		{
			value = new ItemStatsDef();
			allItemDefinitions[(int)comboStarItemDef.itemIndex] = value;
		}
		value.descriptions.Clear();
		value.valueTypes.Clear();
		value.measurementUnits.Clear();
		value.descriptions.Add("Damage per stack: ");
		value.valueTypes.Add((ValueType)1);
		value.measurementUnits.Add((MeasurementUnits)1);
		value.descriptions.Add("Max stacks: ");
		value.valueTypes.Add((ValueType)7);
		value.measurementUnits.Add((MeasurementUnits)4);
		value.descriptions.Add("Damage at max stacks: ");
		value.valueTypes.Add((ValueType)1);
		value.measurementUnits.Add((MeasurementUnits)1);
		value.descriptions.Add("Crit at max stacks: ");
		value.valueTypes.Add((ValueType)1);
		value.measurementUnits.Add((MeasurementUnits)1);
		value.calculateValuesNew = delegate(float luck, int itemCount, float procChance)
		{
			if (itemCount <= 0)
			{
				return new List<float> { 0f, 0f, 0f };
			}
			float num = 3f + 0.5f * (float)(itemCount - 1);
			float num2 = 20 + 10 * (itemCount - 1);
			float num3 = num * num2;
			float num4 = 5f + (float)(itemCount - 1) * 2.5f;
			return new List<float>(3)
			{
				num / 100f,
				num2,
				num3 / 100f,
				num4 / 100f
			};
		};
		RiskOfImpactMain.LogInfo("[ComboStar LG] Registered Combo Star item stats with LookingGlass.");
	}

	[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
	private static void RegisterRedshifterItemStats()
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Expected I4, but got Unknown
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Expected O, but got Unknown
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Expected I4, but got Unknown
		ItemDef redshifterItemDef = RiskOfImpactContent.GetRedshifterItemDef();
		if (!Object.op_Implicit((Object)(object)redshifterItemDef))
		{
			RiskOfImpactMain.LogError("[Redshifter LG] Redshifter ItemDef missing, aborting.");
			return;
		}
		Dictionary<int, ItemStatsDef> allItemDefinitions = ItemDefinitions.allItemDefinitions;
		if (allItemDefinitions == null)
		{
			RiskOfImpactMain.LogError("[Redshifter LG] ItemDefinitions.allItemDefinitions is null.");
			return;
		}
		if (!allItemDefinitions.TryGetValue((int)redshifterItemDef.itemIndex, out var value))
		{
			value = new ItemStatsDef();
			allItemDefinitions[(int)redshifterItemDef.itemIndex] = value;
		}
		value.descriptions.Clear();
		value.valueTypes.Clear();
		value.measurementUnits.Clear();
		value.descriptions.Add("Range Increase: ");
		value.valueTypes.Add((ValueType)2);
		value.measurementUnits.Add((MeasurementUnits)1);
		value.calculateValuesNew = delegate(float luck, int itemCount, float procChance)
		{
			if (itemCount <= 0)
			{
				return new List<float> { 0f };
			}
			float item = 0.5f * (float)itemCount;
			return new List<float>(3) { item };
		};
		RiskOfImpactMain.LogInfo("[Redshifter LG] Registered Redshifter item stats with LookingGlass.");
	}

	[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
	private static void RegisterBioticShellItemStats()
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Expected I4, but got Unknown
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Expected O, but got Unknown
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Expected I4, but got Unknown
		ItemDef bioticShellItemDef = RiskOfImpactContent.GetBioticShellItemDef();
		if (!Object.op_Implicit((Object)(object)bioticShellItemDef))
		{
			RiskOfImpactMain.LogError("[BioticShell LG] Biotic Shell ItemDef missing, aborting.");
			return;
		}
		Dictionary<int, ItemStatsDef> allItemDefinitions = ItemDefinitions.allItemDefinitions;
		if (allItemDefinitions == null)
		{
			RiskOfImpactMain.LogError("[BioticShell LG] ItemDefinitions.allItemDefinitions is null.");
			return;
		}
		if (!allItemDefinitions.TryGetValue((int)bioticShellItemDef.itemIndex, out var value))
		{
			value = new ItemStatsDef();
			allItemDefinitions[(int)bioticShellItemDef.itemIndex] = value;
		}
		value.descriptions.Clear();
		value.valueTypes.Clear();
		value.measurementUnits.Clear();
		value.descriptions.Add("Barrier decay slowed by: ");
		value.valueTypes.Add((ValueType)2);
		value.measurementUnits.Add((MeasurementUnits)1);
		value.calculateValuesNew = delegate(float luck, int itemCount, float procChance)
		{
			if (itemCount <= 0)
			{
				return new List<float> { 0f };
			}
			float num = itemCount;
			float item = 0.12f * num / (0.12f * num + 1f);
			return new List<float>(1) { item };
		};
		RiskOfImpactMain.LogInfo("[BioticShell LG] Registered Biotic Shell item stats with LookingGlass.");
	}
}
public static class RedshifterHooks
{
	private class FocusIndicatorTracker : MonoBehaviour
	{
		public Vector3 baseScale;
	}

	private class MiredUrnRadiusTracker : MonoBehaviour
	{
		public float baseRadius;
	}

	private sealed class RedshifterScaleTracker : MonoBehaviour
	{
		public Vector3 baseScale;
	}

	private sealed class FaultyConductorAuraScaleTracker : MonoBehaviour
	{
		public Vector3 baseScale;
	}

	private sealed class RedshifterHoldoutZoneScaler : MonoBehaviour
	{
		private HoldoutZoneController _zone;

		private void Awake()
		{
			_zone = ((Component)this).GetComponent<HoldoutZoneController>();
		}

		private void OnEnable()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			if ((Object)(object)_zone != (Object)null)
			{
				_zone.calcRadius += new CalcRadiusDelegate(ApplyRadius);
			}
		}

		private void OnDisable()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			if ((Object)(object)_zone != (Object)null)
			{
				_zone.calcRadius -= new CalcRadiusDelegate(ApplyRadius);
			}
		}

		private void ApplyRadius(ref float radius)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			int maxRedshifterStacksOnTeam = GetMaxRedshifterStacksOnTeam(_zone.chargingTeam);
			if (maxRedshifterStacksOnTeam > 0)
			{
				float num = 1f + 0.5f * (float)maxRedshifterStacksOnTeam;
				radius *= num;
			}
		}
	}

	private sealed class RedshifterKillZoneScaler : MonoBehaviour
	{
		private KillZoneController _zone;

		private void Awake()
		{
			_zone = ((Component)this).GetComponent<KillZoneController>();
		}

		private void OnEnable()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			if ((Object)(object)_zone != (Object)null)
			{
				_zone.calcRadius += new CalcRadiusDelegate(ApplyRadius);
			}
		}

		private void OnDisable()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			if ((Object)(object)_zone != (Object)null)
			{
				_zone.calcRadius -= new CalcRadiusDelegate(ApplyRadius);
			}
		}

		private void ApplyRadius(ref float radius)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			int maxRedshifterStacksOnTeam = GetMaxRedshifterStacksOnTeam(_zone.chargingTeam);
			if (maxRedshifterStacksOnTeam > 0)
			{
				float num = 1f + 0.5f * (float)maxRedshifterStacksOnTeam;
				radius *= num;
			}
		}
	}

	[ThreadStatic]
	private static bool _pendingIceRingExplosionScal