Decompiled source of DittoMod v2.3.0

DittoMod.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using DittoMod.Equipment;
using DittoMod.Items;
using DittoMod.Modules;
using DittoMod.Modules.Networking;
using DittoMod.Modules.Survivors;
using DittoMod.SkillStates;
using DittoMod.SkillStates.BaseStates;
using EntityStates;
using HG;
using On.RoR2;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Achievements;
using RoR2.ContentManagement;
using RoR2.ExpansionManagement;
using RoR2.Projectile;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("DittoMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("DittoMod")]
[assembly: AssemblyTitle("DittoMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
internal class BodyInfo
{
	internal string bodyName = "";

	internal string bodyNameToken = "";

	internal string subtitleNameToken = "";

	internal string bodyNameToClone = "Commando";

	internal Texture characterPortrait = null;

	internal GameObject crosshair = null;

	internal GameObject podPrefab = null;

	internal float maxHealth = 100f;

	internal float healthGrowth = 2f;

	internal float healthRegen = 0f;

	internal float shield = 0f;

	internal float shieldGrowth = 0f;

	internal float moveSpeed = 7f;

	internal float moveSpeedGrowth = 0f;

	internal float acceleration = 80f;

	internal float jumpPower = 15f;

	internal float jumpPowerGrowth = 0f;

	internal float damage = 12f;

	internal float attackSpeed = 1f;

	internal float attackSpeedGrowth = 0f;

	internal float armor = 0f;

	internal float armorGrowth = 0f;

	internal float crit = 1f;

	internal float critGrowth = 0f;

	internal int jumpCount = 1;

	internal Color bodyColor = Color.grey;

	internal Vector3 aimOriginPosition = new Vector3(0f, 1.8f, 0f);

	internal Vector3 modelBasePosition = new Vector3(0f, -0.92f, 0f);

	internal Vector3 cameraPivotPosition = new Vector3(0f, 1.6f, 0f);
}
internal class CustomRendererInfo
{
	internal string childName;

	internal Material material;

	internal bool ignoreOverlays;
}
internal class SkillDefInfo
{
	public string skillName;

	public string skillNameToken;

	public string skillDescriptionToken;

	public Sprite skillIcon;

	public SerializableEntityStateType activationState;

	public string activationStateMachineName;

	public int baseMaxStock;

	public float baseRechargeInterval;

	public bool beginSkillCooldownOnSkillEnd;

	public bool canceledFromSprinting;

	public bool forceSprintDuringState;

	public bool fullRestockOnAssign;

	public InterruptPriority interruptPriority;

	public bool resetCooldownTimerOnUse;

	public bool isCombatSkill;

	public bool mustKeyPress;

	public bool cancelSprintingOnActivation;

	public int rechargeStock;

	public int requiredStock;

	public int stockToConsume;

	public string[] keywordTokens;
}
namespace DittoMod
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.TeaL.DittoMod", "DittoMod", "2.2.0")]
	public class DittoPlugin : BaseUnityPlugin
	{
		public static bool scepterInstalled = false;

		public DittoController dittocon;

		public DittoMasterController dittomastercon;

		public const string MODUID = "com.TeaL.DittoMod";

		public const string MODNAME = "DittoMod";

		public const string MODVERSION = "2.2.0";

		public const string developerPrefix = "TEAL";

		internal List<SurvivorBase> Survivors = new List<SurvivorBase>();

		private GameObject rockyeffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/effects/LightningStakeNova");

		private GameObject fireeffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ExplodeOnDeath/WilloWispExplosion.prefab").WaitForCompletion();

		public static DittoPlugin instance;

		public static CharacterBody DittoCharacterBody;

		private GameObject voidcrabphase1 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidRaidCrab/MiniVoidRaidCrabBodyPhase1.prefab").WaitForCompletion();

		private GameObject voidcrabphase2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidRaidCrab/MiniVoidRaidCrabBodyPhase2.prefab").WaitForCompletion();

		private GameObject voidcrabphase3 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidRaidCrab/MiniVoidRaidCrabBodyPhase3.prefab").WaitForCompletion();

		private GameObject xiconstruct = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/MajorAndMinorConstruct/MegaConstructBody.prefab").WaitForCompletion();

		private GameObject alphaconstruct = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/MajorAndMinorConstruct/MinorConstructBody.prefab").WaitForCompletion();

		private GameObject voidinfestor = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/EliteVoid/VoidInfestorBody.prefab").WaitForCompletion();

		private GameObject voidbarnacle = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidBarnacle/VoidBarnacleBody.prefab").WaitForCompletion();

		private GameObject voidjailer = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidJailer/VoidJailerBody.prefab").WaitForCompletion();

		private GameObject voidmegacrab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/VoidMegaCrabBody.prefab").WaitForCompletion();

		private GameObject droneman = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/DroneCommander/DroneCommanderBody.prefab").WaitForCompletion();

		private GameObject gip = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/Gup/GipBody.prefab").WaitForCompletion();

		private GameObject geep = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/Gup/GeepBody.prefab").WaitForCompletion();

		private GameObject gup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/Gup/GupBody.prefab").WaitForCompletion();

		private GameObject impboss = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ImpBoss/ImpBossBody.prefab").WaitForCompletion();

		public List<ItemBase> Items = new List<ItemBase>();

		public List<EquipmentBase> Equipments = new List<EquipmentBase>();

		public static Dictionary<ItemBase, bool> ItemStatusDictionary = new Dictionary<ItemBase, bool>();

		public static Dictionary<EquipmentBase, bool> EquipmentStatusDictionary = new Dictionary<EquipmentBase, bool>();

		private BlastAttack blastAttack;

		private void Awake()
		{
			instance = this;
			DittoCharacterBody = null;
			instance = this;
			StaticValues.LoadList();
			Assets.Initialize();
			Config.ReadConfig();
			if (Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"))
			{
				Config.SetupRiskOfOptions();
			}
			States.RegisterStates();
			Buffs.RegisterBuffs();
			Projectiles.RegisterProjectiles();
			Tokens.AddTokens();
			ItemDisplays.PopulateDisplays();
			new Ditto().Initialize();
			IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(EquipmentBase))
				select type;
			foreach (Type item in enumerable)
			{
				EquipmentBase equipmentBase = (EquipmentBase)Activator.CreateInstance(item);
				equipmentBase.Init();
			}
			NetworkingAPI.RegisterMessageType<TransformNetworked>();
			NetworkingAPI.RegisterMessageType<EquipmentDropNetworked>();
			NetworkingAPI.RegisterMessageType<LeftoversNetworked>();
			new ContentPacks().Initialize();
			ContentManager.onContentPacksAssigned += LateSetup;
			Hook();
			GameObject monsterSurvivor = LegacyResourcesAPI.Load<GameObject>("prefabs/characterbodies/ShopkeeperBody");
			GameObject monsterSurvivor2 = LegacyResourcesAPI.Load<GameObject>("prefabs/characterbodies/BeetleQueen2Body");
			GameObject monsterSurvivor3 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/GolemBody");
			GameObject monsterSurvivor4 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/TitanBody");
			GameObject monsterSurvivor5 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/TitanGoldBody");
			GameObject monsterSurvivor6 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/GravekeeperBody");
			GameObject monsterSurvivor7 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/VagrantBody");
			GameObject monsterSurvivor8 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/MagmaWormBody");
			GameObject monsterSurvivor9 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/ElectricWormBody");
			GameObject monsterSurvivor10 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/ClayBossBody");
			GameObject monsterSurvivor11 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/RoboBallBossBody");
			GameObject monsterSurvivor12 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/SuperRoboBallBossBody");
			GameObject monsterSurvivor13 = PrefabAPI.InstantiateClone(xiconstruct, "1xiconstruct");
			GameObject monsterSurvivor14 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/GrandParentBody");
			GameObject monsterSurvivor15 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/ScavBody");
			GameObject monsterSurvivor16 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/BrotherBody");
			GameObject monsterSurvivor17 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/BrotherHurtBody");
			GameObject monsterSurvivor18 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/Drone1Body");
			GameObject monsterSurvivor19 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/Drone2Body");
			GameObject monsterSurvivor20 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/Turret1Body");
			GameObject monsterSurvivor21 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/MissileDroneBody");
			GameObject monsterSurvivor22 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/FlameDroneBody");
			GameObject monsterSurvivor23 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/BackupDroneBody");
			GameObject monsterSurvivor24 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/EmergencyDroneBody");
			GameObject monsterSurvivor25 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/EquipmentDroneBody");
			GameObject monsterSurvivor26 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/MegaDroneBody");
			GameObject monsterSurvivor27 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/EngiTurretBody");
			GameObject monsterSurvivor28 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/EngiWalkerTurretBody");
			GameObject monsterSurvivor29 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/SquidTurretBody");
			GameObject monsterSurvivor30 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/UrchinTurretBody");
			GameObject monsterSurvivor31 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/BeetleBody");
			GameObject monsterSurvivor32 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/BeetleGuardBody");
			GameObject monsterSurvivor33 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/AcidLarvaBody");
			GameObject monsterSurvivor34 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/LemurianBody");
			GameObject monsterSurvivor35 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/LemurianBruiserBody");
			GameObject monsterSurvivor36 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/FlyingVerminBody");
			GameObject monsterSurvivor37 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/VerminBody");
			GameObject monsterSurvivor38 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/WispBody");
			GameObject monsterSurvivor39 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/GreaterWispBody");
			GameObject monsterSurvivor40 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/ImpBody");
			GameObject monsterSurvivor41 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/JellyfishBody");
			GameObject monsterSurvivor42 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/BisonBody");
			GameObject monsterSurvivor43 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/ClayBruiserBody");
			GameObject monsterSurvivor44 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/ClayGrenadierBody");
			GameObject monsterSurvivor45 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/VultureBody");
			GameObject monsterSurvivor46 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/RoboBallMiniBody");
			GameObject monsterSurvivor47 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/RoboBallGreenBuddyBody");
			GameObject monsterSurvivor48 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/RoboBallRedBuddyBody");
			GameObject monsterSurvivor49 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/BellBody");
			GameObject monsterSurvivor50 = PrefabAPI.InstantiateClone(alphaconstruct, "1alphaconstruct");
			GameObject monsterSurvivor51 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/MiniMushroomBody");
			GameObject monsterSurvivor52 = PrefabAPI.InstantiateClone(gip, "1gip");
			GameObject monsterSurvivor53 = PrefabAPI.InstantiateClone(geep, "1geep");
			GameObject monsterSurvivor54 = PrefabAPI.InstantiateClone(gup, "1gup");
			GameObject monsterSurvivor55 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/HermitCrabBody");
			GameObject monsterSurvivor56 = PrefabAPI.InstantiateClone(voidinfestor, "1voidinfestor");
			GameObject monsterSurvivor57 = PrefabAPI.InstantiateClone(voidbarnacle, "1voidbarnacle");
			GameObject monsterSurvivor58 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/NullifierBody");
			GameObject monsterSurvivor59 = PrefabAPI.InstantiateClone(voidjailer, "PCVoidJailerBody");
			GameObject monsterSurvivor60 = PrefabAPI.InstantiateClone(voidmegacrab, "1voidmegacrab");
			GameObject monsterSurvivor61 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/LunarExploderBody");
			GameObject monsterSurvivor62 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/LunarGolemBody");
			GameObject monsterSurvivor63 = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/LunarWispBody");
			GameObject monsterSurvivor64 = PrefabAPI.InstantiateClone(droneman, "1droneman");
			GameObject monsterSurvivor65 = PrefabAPI.InstantiateClone(voidcrabphase1, "1voidcrabphase1");
			GameObject monsterSurvivor66 = PrefabAPI.InstantiateClone(voidcrabphase2, "1voidcrabphase2");
			GameObject monsterSurvivor67 = PrefabAPI.InstantiateClone(voidcrabphase3, "1voidcrabphase3");
			GameObject monsterSurvivor68 = PrefabAPI.InstantiateClone(impboss, "1impboss");
			PolishMonsterToSurvivor(monsterSurvivor31, 20f);
			PolishMonsterToSurvivor(monsterSurvivor32, 20f);
			PolishMonsterToSurvivor(monsterSurvivor33, 20f);
			PolishMonsterToSurvivor(monsterSurvivor34, 20f);
			PolishMonsterToSurvivor(monsterSurvivor35, 20f);
			PolishMonsterToSurvivor(monsterSurvivor36, 20f);
			PolishMonsterToSurvivor(monsterSurvivor37, 20f);
			PolishMonsterToSurvivor(monsterSurvivor38, 20f);
			PolishMonsterToSurvivor(monsterSurvivor39, 20f);
			PolishMonsterToSurvivor(monsterSurvivor40, 20f);
			PolishMonsterToSurvivor(monsterSurvivor41, 20f);
			PolishMonsterToSurvivor(monsterSurvivor42, 20f);
			PolishMonsterToSurvivor(monsterSurvivor43, 20f);
			PolishMonsterToSurvivor(monsterSurvivor44, 20f);
			PolishMonsterToSurvivor(monsterSurvivor45, 20f);
			PolishMonsterToSurvivor(monsterSurvivor46, 20f);
			PolishMonsterToSurvivor(monsterSurvivor47, 20f);
			PolishMonsterToSurvivor(monsterSurvivor48, 20f);
			PolishMonsterToSurvivor(monsterSurvivor49, 20f);
			PolishMonsterToSurvivor(monsterSurvivor50, 20f);
			PolishMonsterToSurvivor(monsterSurvivor51, 20f);
			PolishMonsterToSurvivor(monsterSurvivor52, 20f);
			PolishMonsterToSurvivor(monsterSurvivor53, 20f);
			PolishMonsterToSurvivor(monsterSurvivor54, 20f);
			PolishMonsterToSurvivor(monsterSurvivor55, 20f);
			PolishMonsterToSurvivor(monsterSurvivor56, 20f);
			PolishMonsterToSurvivor(monsterSurvivor57, 20f);
			PolishMonsterToSurvivor(monsterSurvivor58, 10f);
			PolishMonsterToSurvivor(monsterSurvivor59, 10f);
			PolishMonsterToSurvivor(monsterSurvivor60, 10f);
			PolishMonsterToSurvivor(monsterSurvivor61, 10f);
			PolishMonsterToSurvivor(monsterSurvivor62, 10f);
			PolishMonsterToSurvivor(monsterSurvivor63, 10f);
			PolishMonsterToSurvivor(monsterSurvivor2, 10f);
			PolishMonsterToSurvivor(monsterSurvivor3, 10f);
			PolishMonsterToSurvivor(monsterSurvivor4, 20f);
			PolishMonsterToSurvivor(monsterSurvivor5, 20f);
			PolishMonsterToSurvivor(monsterSurvivor6, 20f);
			PolishMonsterToSurvivor(monsterSurvivor7, 20f);
			PolishMonsterToSurvivor(monsterSurvivor8, 20f);
			PolishMonsterToSurvivor(monsterSurvivor9, 20f);
			PolishMonsterToSurvivor(monsterSurvivor10, 20f);
			PolishMonsterToSurvivor(monsterSurvivor11, 20f);
			PolishMonsterToSurvivor(monsterSurvivor12, 20f);
			PolishMonsterToSurvivor(monsterSurvivor13, 20f);
			PolishMonsterToSurvivor(monsterSurvivor14, 10f);
			PolishMonsterToSurvivor(monsterSurvivor15, 20f);
			PolishMonsterToSurvivor(monsterSurvivor16, 20f);
			PolishMonsterToSurvivor(monsterSurvivor18, 20f);
			PolishMonsterToSurvivor(monsterSurvivor19, 20f);
			PolishMonsterToSurvivor(monsterSurvivor20, 20f);
			PolishMonsterToSurvivor(monsterSurvivor21, 20f);
			PolishMonsterToSurvivor(monsterSurvivor22, 20f);
			PolishMonsterToSurvivor(monsterSurvivor23, 20f);
			PolishMonsterToSurvivor(monsterSurvivor24, 20f);
			PolishMonsterToSurvivor(monsterSurvivor25, 20f);
			PolishMonsterToSurvivor(monsterSurvivor26, 20f);
			PolishMonsterToSurvivor(monsterSurvivor27, 20f);
			PolishMonsterToSurvivor(monsterSurvivor28, 20f);
			PolishMonsterToSurvivor(monsterSurvivor29, 20f);
			PolishMonsterToSurvivor(monsterSurvivor30, 20f);
			PolishMonsterToSurvivor(monsterSurvivor64, 20f);
			PolishMonsterToSurvivor(monsterSurvivor65, 20f);
			PolishMonsterToSurvivor(monsterSurvivor66, 20f);
			PolishMonsterToSurvivor(monsterSurvivor67, 20f);
			PolishMonsterToSurvivor(monsterSurvivor, 20f);
			PolishMonsterToSurvivor(monsterSurvivor68, 20f);
			PolishMonsterToSurvivor(monsterSurvivor17, 20f);
		}

		public bool ValidateItem(ItemBase item, List<ItemBase> itemList)
		{
			bool value = ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + item.ItemName, "Enable Item?", true, "Should this item appear in runs?").Value;
			bool value2 = ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + item.ItemName, "Blacklist Item from AI Use?", false, "Should the AI not be able to obtain this item?").Value;
			bool value3 = ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + item.ItemName, "Blacklist Item from Printers?", false, "Should the printers be able to print this item?").Value;
			bool value4 = ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + item.ItemName, "Require Unlock", true, "Should we require this item to be unlocked before it appears in runs? (Will only affect items with associated unlockables.)").Value;
			ItemStatusDictionary.Add(item, value);
			if (value)
			{
				itemList.Add(item);
				if (value2)
				{
					item.AIBlacklisted = true;
				}
				if (value3)
				{
					item.PrinterBlacklisted = true;
				}
				item.RequireUnlock = value4;
			}
			return value;
		}

		private void PolishMonsterToSurvivor(GameObject monsterSurvivor, float maxInteractionDistance)
		{
			NetworkIdentity val = monsterSurvivor.GetComponent<NetworkIdentity>();
			if (!Object.op_Implicit((Object)(object)val))
			{
				((BaseUnityPlugin)this).Logger.LogMessage((object)"Missing NetworkIdentity! Adding...");
				val = monsterSurvivor.AddComponent<NetworkIdentity>();
			}
			if (!val.localPlayerAuthority)
			{
				((BaseUnityPlugin)this).Logger.LogMessage((object)"Ensuring Networking");
				val.localPlayerAuthority = true;
			}
			Interactor val2 = monsterSurvivor.GetComponent<Interactor>();
			if (!Object.op_Implicit((Object)(object)val2))
			{
				val2 = monsterSurvivor.AddComponent<Interactor>();
			}
			val2.maxInteractionDistance = maxInteractionDistance;
			EquipmentSlot component = monsterSurvivor.GetComponent<EquipmentSlot>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				component = monsterSurvivor.AddComponent<EquipmentSlot>();
			}
		}

		private void LateSetup(ReadOnlyArray<ReadOnlyContentPack> obj)
		{
			SurvivorBase.instance.SetItemDisplays();
		}

		private void Hook()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
			CharacterBody.OnDeathStart += new hook_OnDeathStart(CharacterBody_OnDeathStart);
			CharacterModel.Awake += new hook_Awake(CharacterModel_Awake);
			CharacterMaster.Start += new hook_Start(CharacterMaster_Start);
			GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(GlobalEventManager_OnCharacterDeath);
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
			HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
			GlobalEventManager.onServerDamageDealt += GlobalEventManager_OnDamageDealt;
		}

		private void CharacterModel_Awake(orig_Awake orig, CharacterModel self)
		{
			orig.Invoke(self);
			if (((Object)((Component)self).gameObject).name.Contains("DittoDisplay"))
			{
				AkSoundEngine.PostEvent(3468082827u, ((Component)self).gameObject);
			}
		}

		private void GlobalEventManager_OnCharacterDeath(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport)
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, damageReport);
			CharacterBody victimBody = damageReport.victimBody;
			CharacterBody attackerBody = damageReport.attackerBody;
			CharacterMaster victimMaster = damageReport.victimMaster;
			if (Object.op_Implicit((Object)(object)attackerBody) && attackerBody.HasBuff(Buffs.moxieBuff))
			{
				NetworkingHelpers.ApplyBuff(attackerBody, Buffs.moxieBoostBuff.buffIndex, 1, 20f);
			}
		}

		private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
			if (Object.op_Implicit((Object)(object)sender))
			{
				if (sender.HasBuff(Buffs.assaultvestBuff))
				{
					args.armorAdd += 100f;
				}
				if (sender.HasBuff(Buffs.choicebandBuff))
				{
					args.baseAttackSpeedAdd += 0.5f;
				}
				if (sender.HasBuff(Buffs.choicescarfBuff))
				{
					args.moveSpeedMultAdd += 0.5f;
				}
				if (sender.HasBuff(Buffs.choicespecsBuff))
				{
					args.cooldownReductionAdd += 0.25f;
				}
				if (sender.HasBuff(Buffs.lifeorbBuff))
				{
					args.damageMultAdd += 0.3f;
				}
				if (sender.HasBuff(Buffs.scopelensBuff))
				{
					args.critAdd += 30f;
				}
				if (sender.HasBuff(Buffs.hugepowerBuff))
				{
					args.damageMultAdd += 1f;
				}
				if (sender.HasBuff(Buffs.moodyArmorBuff))
				{
					args.armorAdd += (float)sender.GetBuffCount(Buffs.moodyArmorBuff) * 5f;
				}
				if (sender.HasBuff(Buffs.moodyArmorDebuff))
				{
					args.armorAdd -= (float)sender.GetBuffCount(Buffs.moodyArmorDebuff) * 5f;
				}
				if (sender.HasBuff(Buffs.moodyDamageBuff))
				{
					args.damageMultAdd += (float)sender.GetBuffCount(Buffs.moodyDamageBuff) * 0.1f;
				}
				if (sender.HasBuff(Buffs.moodyDamageDebuff))
				{
					args.damageMultAdd -= (float)sender.GetBuffCount(Buffs.moodyDamageDebuff) * 0.1f;
				}
				if (sender.HasBuff(Buffs.moodyMovespeedBuff))
				{
					args.moveSpeedMultAdd += (float)sender.GetBuffCount(Buffs.moodyMovespeedBuff) * 0.1f;
				}
				if (sender.HasBuff(Buffs.moodyMovespeedDebuff))
				{
					args.moveSpeedMultAdd -= (float)sender.GetBuffCount(Buffs.moodyMovespeedDebuff) * 0.1f;
				}
				if (sender.HasBuff(Buffs.moodyAttackspeedBuff))
				{
					args.attackSpeedMultAdd += (float)sender.GetBuffCount(Buffs.moodyAttackspeedBuff) * 0.1f;
				}
				if (sender.HasBuff(Buffs.moodyAttackspeedDebuff))
				{
					args.attackSpeedMultAdd -= (float)sender.GetBuffCount(Buffs.moodyAttackspeedDebuff) * 0.1f;
				}
				if (sender.HasBuff(Buffs.moxieBuff))
				{
					args.damageMultAdd += (float)sender.GetBuffCount(Buffs.moxieBoostBuff) * 0.3f;
				}
			}
		}

		private void GlobalEventManager_OnDamageDealt(DamageReport report)
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			bool flag = !Object.op_Implicit((Object)(object)report.attacker) || !Object.op_Implicit((Object)(object)report.attackerBody);
			if (!flag && report.attackerBody.HasBuff(Buffs.shellbellBuff))
			{
				CharacterBody attackerBody = report.attackerBody;
				attackerBody.healthComponent.Heal(report.damageDealt * 0.05f, default(ProcChainMask), true);
			}
			if (!flag && report.attackerBody.HasBuff(Buffs.sniperBuff) && report.damageInfo.crit)
			{
				report.damageDealt *= 1.5f;
			}
		}

		private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Invalid comparison between Unknown and I4
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Invalid comparison between Unknown and I4
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Invalid comparison between Unknown and I4
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Expected O, but got Unknown
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Expected O, but got Unknown
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: 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_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e3: Expected O, but got Unknown
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: Expected O, but got Unknown
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			//IL_031f: Unknown result type (might be due to invalid IL or missing references)
			//IL_037e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: 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_03be: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03da: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_029f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Expected O, but got Unknown
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_0409: Unknown result type (might be due to invalid IL or missing references)
			//IL_040e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0415: Unknown result type (might be due to invalid IL or missing references)
			//IL_0420: Unknown result type (might be due to invalid IL or missing references)
			//IL_042b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0432: Unknown result type (might be due to invalid IL or missing references)
			//IL_0437: Unknown result type (might be due to invalid IL or missing references)
			//IL_043c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0447: Expected O, but got Unknown
			//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
			if (damageInfo != null && Object.op_Implicit((Object)(object)damageInfo.attacker) && Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent<CharacterBody>()))
			{
				bool flag = (int)DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)2)) > 0;
				if (damageInfo.damage > 0f && (int)DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)67108864)) == 67108864 && self.body.HasBuff(Buffs.magicguardBuff.buffIndex))
				{
					damageInfo.rejected = true;
				}
				if (!flag && damageInfo.damage > 0f && (int)DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)67108864)) != 67108864)
				{
					if (self.body.HasBuff(Buffs.multiscaleBuff.buffIndex) && (double)self.health >= 0.99 * (double)self.fullHealth)
					{
						damageInfo.damage *= 0.5f;
					}
					if (self.body.HasBuff(Buffs.rockyhelmetBuff.buffIndex))
					{
						DamageInfo val = new DamageInfo();
						blastAttack = new BlastAttack();
						blastAttack.radius = 8f;
						blastAttack.procCoefficient = 1f;
						blastAttack.position = ((Component)self).transform.position;
						blastAttack.attacker = ((Component)self).gameObject;
						blastAttack.crit = Util.CheckRoll(self.body.crit, self.body.master);
						blastAttack.baseDamage = self.body.damage * 1f;
						blastAttack.falloffModel = (FalloffModel)0;
						blastAttack.baseForce = 100f;
						blastAttack.teamIndex = TeamComponent.GetObjectTeam(blastAttack.attacker);
						blastAttack.damageType = DamageTypeCombo.op_Implicit((DamageType)34);
						blastAttack.attackerFiltering = (AttackerFiltering)2;
						if (damageInfo.attacker.GetComponent<CharacterBody>().masterObjectId != self.body.masterObjectId)
						{
							blastAttack.Fire();
						}
						EffectManager.SpawnEffect(rockyeffectPrefab, new EffectData
						{
							origin = ((Component)self).transform.position,
							scale = 8f,
							rotation = Quaternion.LookRotation(((Component)self).transform.position)
						}, true);
					}
					if (self.body.HasBuff(Buffs.flamebodyBuff.buffIndex))
					{
						DamageInfo val2 = new DamageInfo();
						blastAttack = new BlastAttack();
						blastAttack.radius = 8f;
						blastAttack.procCoefficient = 1f;
						blastAttack.position = ((Component)self).transform.position;
						blastAttack.attacker = ((Component)self).gameObject;
						blastAttack.crit = Util.CheckRoll(self.body.crit, self.body.master);
						blastAttack.baseDamage = self.body.damage * 1f;
						blastAttack.falloffModel = (FalloffModel)0;
						blastAttack.baseForce = 100f;
						blastAttack.teamIndex = TeamComponent.GetObjectTeam(blastAttack.attacker);
						blastAttack.damageType = DamageTypeCombo.op_Implicit((DamageType)128);
						blastAttack.attackerFiltering = (AttackerFiltering)2;
						if (damageInfo.attacker.GetComponent<CharacterBody>().masterObjectId != self.body.masterObjectId)
						{
							blastAttack.Fire();
						}
						EffectManager.SpawnEffect(fireeffectPrefab, new EffectData
						{
							origin = ((Component)self).transform.position,
							scale = 8f,
							rotation = Quaternion.LookRotation(((Component)self).transform.position)
						}, true);
					}
				}
			}
			orig.Invoke(self, damageInfo);
		}

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			if (Object.op_Implicit((Object)(object)self.healthComponent))
			{
				orig.Invoke(self);
			}
		}

		private void CharacterBody_OnDeathStart(orig_OnDeathStart orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (self.baseNameToken == "TEAL_DITTO_BODY_NAME")
			{
				AkSoundEngine.PostEvent(3468082827u, ((Component)this).gameObject);
			}
		}

		private void CharacterMaster_Start(orig_Start orig, CharacterMaster self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self.bodyPrefab))
			{
				Debug.Log((object)self.bodyPrefab);
				if (((Object)self.bodyPrefab).name.Contains("Ditto"))
				{
					self.inventory.GiveEquipmentString("EQUIPMENT_TM_TRANSFORM");
				}
			}
		}
	}
}
namespace DittoMod.SkillStates
{
	public class FlameBody : BaseSkillState
	{
		public float duration = 0.1f;

		public DittoController dittocon;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

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

		public DittoController dittocon;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

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

		public DittoController dittocon;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

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

		public DittoController dittocon;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

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

		public DittoController dittocon;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

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

		public DittoController dittocon;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

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

		public DittoController dittocon;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

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

		public DittoController dittocon;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

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

		public DittoController dittocon;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

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

		public DittoController dittocon;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

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

		public DittoController dittocon;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

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

		public DittoController dittocon;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

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

		public DittoController dittocon;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

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

		public DittoController dittocon;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

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

		public DittoController dittocon;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

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

		public DittoController dittocon;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

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

		public DittoController dittocon;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

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

		public DittoController dittocon;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

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

		private float duration;

		private float fireTime;

		private float struggleAge;

		private bool hasFired;

		public float force = 100f;

		public float initialspeedCoefficient = 6f;

		public static float procCoefficient = 1f;

		private Vector3 theSpot;

		private BlastAttack blastAttack;

		public float blastRadius = 3f;

		public float rollSpeed;

		public override void OnEnter()
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Expected O, but got Unknown
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: 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_016a: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			hasFired = false;
			duration = baseduration / ((BaseState)this).attackSpeedStat;
			fireTime = duration / 2f;
			RecalculateRollSpeed();
			Ray aimRay = ((BaseState)this).GetAimRay();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterMotor.velocity.y = rollSpeed;
			}
			theSpot = ((EntityState)this).characterBody.corePosition;
			blastAttack = new BlastAttack();
			blastAttack.radius = blastRadius;
			blastAttack.procCoefficient = procCoefficient;
			blastAttack.position = theSpot;
			blastAttack.attacker = ((EntityState)this).gameObject;
			blastAttack.crit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master);
			blastAttack.baseDamage = ((EntityState)this).characterBody.damage * 0.3f;
			blastAttack.falloffModel = (FalloffModel)0;
			blastAttack.baseForce = force;
			blastAttack.teamIndex = TeamComponent.GetObjectTeam(blastAttack.attacker);
			blastAttack.damageType = DamageTypeCombo.op_Implicit((DamageType)0);
			blastAttack.attackerFiltering = (AttackerFiltering)0;
			if (((EntityState)this).isAuthority)
			{
				AkSoundEngine.PostEvent(500315785u, ((EntityState)this).gameObject);
			}
			((EntityState)this).PlayAnimation("Body", "BonusJump", "Attack.playbackRate", fireTime, 0f);
			((EntityState)this).gameObject.layer = LayerIndex.fakeActor.intVal;
		}

		public override void OnExit()
		{
			((EntityState)this).gameObject.layer = LayerIndex.defaultLayer.intVal;
			((EntityState)this).characterMotor.velocity.y *= 0f;
			((EntityState)this).OnExit();
		}

		private void RecalculateRollSpeed()
		{
			float num = ((BaseState)this).moveSpeedStat;
			if (((EntityState)this).characterBody.isSprinting)
			{
				num /= ((EntityState)this).characterBody.sprintingSpeedMultiplier;
			}
			rollSpeed = num * Mathf.Lerp(initialspeedCoefficient, (0f - initialspeedCoefficient) / 2f, ((EntityState)this).fixedAge / fireTime);
		}

		public override void FixedUpdate()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0062: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			RecalculateRollSpeed();
			Ray aimRay = ((BaseState)this).GetAimRay();
			theSpot = ((EntityState)this).characterBody.corePosition;
			if (struggleAge > duration / 10f)
			{
				blastAttack.position = theSpot;
				if (((EntityState)this).isAuthority)
				{
					blastAttack.Fire();
				}
				struggleAge = 0f;
			}
			else
			{
				struggleAge += Time.fixedDeltaTime;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterMotor.velocity.y = rollSpeed;
			}
			if (((EntityState)this).fixedAge >= fireTime && !hasFired)
			{
				hasFired = true;
				AkSoundEngine.PostEvent(500315785u, ((EntityState)this).gameObject);
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

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

		private float fireTime = 0.2f;

		private bool hasFired;

		public DittoController dittocon;

		public DittoMasterController dittomastercon;

		public HurtBox Target;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			dittocon = ((EntityState)this).GetComponent<DittoController>();
			dittomastercon = ((Component)((EntityState)this).characterBody.master).gameObject.GetComponent<DittoMasterController>();
			if (Object.op_Implicit((Object)(object)dittocon) && ((EntityState)this).isAuthority)
			{
				Target = dittocon.GetTrackingTarget();
			}
			if (Object.op_Implicit((Object)(object)Target))
			{
				hasFired = false;
			}
		}

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

		public override void FixedUpdate()
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= fireTime && !hasFired)
			{
				hasFired = true;
				if (Object.op_Implicit((Object)(object)Target))
				{
					Debug.Log((object)"Target");
					Debug.Log((object)BodyCatalog.FindBodyPrefab(BodyCatalog.GetBodyName(Target.healthComponent.body.bodyIndex)));
					if (((EntityState)this).isAuthority)
					{
						AkSoundEngine.PostEvent(1719197672u, ((EntityState)this).gameObject);
					}
					ChangeOrSetCharacter(((EntityState)this).characterBody.master.playerCharacterMasterController.networkUser, Target);
					return;
				}
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public void dropEquipment(EquipmentDef def)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)this).isAuthority)
			{
				NetMessageExtensions.Send((INetMessage)(object)new EquipmentDropNetworked(PickupCatalog.FindPickupIndex(def.equipmentIndex), ((EntityState)this).transform.position + Vector3.up * 1.5f, Vector3.up * 20f + ((EntityState)this).transform.forward * 2f), (NetworkDestination)1);
			}
		}

		private void ChangeOrSetCharacter(NetworkUser player, HurtBox hurtBox)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_049e: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_051f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0537: Unknown result type (might be due to invalid IL or missing references)
			//IL_054f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0567: Unknown result type (might be due to invalid IL or missing references)
			//IL_057f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0597: Unknown result type (might be due to invalid IL or missing references)
			//IL_05af: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05df: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f7: Unknown result type (might be due to invalid IL or missing references)
			CharacterMaster master = player.master;
			CharacterBody body = master.GetBody();
			float num = body.healthComponent.health / body.healthComponent.fullHealth;
			string bodyName = BodyCatalog.GetBodyName(hurtBox.healthComponent.body.bodyIndex);
			GameObject val = BodyCatalog.FindBodyPrefab(bodyName);
			CharacterMaster master2 = hurtBox.healthComponent.body.master;
			SurvivorDef val2 = SurvivorCatalog.FindSurvivorDefFromBody(val);
			if (Object.op_Implicit((Object)(object)val2) && !val2.CheckUserHasRequiredEntitlement(master.playerCharacterMasterController.networkUser))
			{
				return;
			}
			ExpansionRequirementComponent component = val.GetComponent<ExpansionRequirementComponent>();
			if (Object.op_Implicit((Object)(object)component) && !component.PlayerCanUseBody(master.playerCharacterMasterController))
			{
				return;
			}
			if (!StaticValues.blacklist.Contains(((Object)val).name))
			{
				master.bodyPrefab = val;
				EntityStateMachine component2 = val.GetComponent<EntityStateMachine>();
				component2.initialStateType = new SerializableEntityStateType(typeof(SpawnState));
				master.TransformBody(BodyCatalog.GetBodyName(hurtBox.healthComponent.body.bodyIndex));
				master.bodyPrefab = BodyCatalog.FindBodyPrefab(((Object)val).name);
				CharacterBody body2 = master.GetBody();
				if (Config.copyLoadout.Value)
				{
					body2.SetLoadoutServer(master2.loadout);
				}
				if (Config.copyHealth.Value)
				{
					body2.healthComponent.health = num * body2.healthComponent.fullHealth;
				}
				RigidbodyMotor component3 = ((Component)body2).gameObject.GetComponent<RigidbodyMotor>();
				EquipmentSlot component4 = ((Component)body2).gameObject.GetComponent<EquipmentSlot>();
				if (!Object.op_Implicit((Object)(object)component4))
				{
					component4 = ((Component)body2).gameObject.AddComponent<EquipmentSlot>();
				}
				if (((Object)body2).name == "CaptainBody")
				{
					master.inventory.GiveItem(Items.CaptainDefenseMatrix, 1);
				}
				if (((Object)body2).name == "HereticBody")
				{
					master.inventory.GiveItem(Items.LunarPrimaryReplacement, 1);
					master.inventory.GiveItem(Items.LunarSecondaryReplacement, 1);
					master.inventory.GiveItem(Items.LunarSpecialReplacement, 1);
					master.inventory.GiveItem(Items.LunarUtilityReplacement, 1);
				}
				if (StaticValues.speciallist.Contains(((Object)val).name))
				{
					dittomastercon.transformed = true;
				}
				if (Object.op_Implicit((Object)(object)component3))
				{
					component3.characterBody.moveSpeed = body.moveSpeed * Config.movespeedMultiplier.Value;
				}
				float damage = body2.damage * Config.damageMultiplier.Value;
				float baseDamage = body2.baseDamage * Config.damageMultiplier.Value;
				float levelDamage = body2.levelDamage * Config.damageMultiplier.Value;
				float attackSpeed = body2.attackSpeed * Config.attackspeedMultiplier.Value;
				float baseAttackSpeed = body2.baseAttackSpeed * Config.attackspeedMultiplier.Value;
				float levelAttackSpeed = body2.levelAttackSpeed * Config.attackspeedMultiplier.Value;
				body2.baseMaxHealth = body.baseMaxHealth + body2.baseMaxHealth / 5f;
				body2.levelMaxHealth = body.levelMaxHealth + body2.levelMaxHealth / 5f;
				body2.maxHealth = body.maxHealth + body2.maxHealth / 5f;
				body2.baseRegen = body.regen;
				body2.baseJumpCount = body.baseJumpCount;
				body2.maxJumpCount = body.maxJumpCount;
				body2.maxJumpHeight = body.maxJumpHeight;
				body2.jumpPower = body.jumpPower;
				body2.baseJumpPower = body.baseJumpPower;
				body2.damage = damage;
				body2.baseDamage = baseDamage;
				body2.levelDamage = levelDamage;
				body2.attackSpeed = attackSpeed;
				body2.baseAttackSpeed = baseAttackSpeed;
				body2.levelAttackSpeed = levelAttackSpeed;
				if (Object.op_Implicit((Object)(object)body2.characterMotor))
				{
					body2.characterMotor.mass = body.characterMotor.mass;
					body2.characterMotor.jumpCount = body.characterMotor.jumpCount;
				}
				body2.baseArmor = body.baseArmor;
				body2.armor = body.armor;
				body2.baseMoveSpeed = body.baseMoveSpeed * Config.movespeedMultiplier.Value;
				body2.moveSpeed = body.moveSpeed * Config.movespeedMultiplier.Value;
				body2.levelMoveSpeed = body.levelMoveSpeed * Config.movespeedMultiplier.Value;
				body2.AddTimedBuffAuthority(Buffs.HiddenInvincibility.buffIndex, 1f);
				body2.AddTimedBuffAuthority(Buffs.transformdeBuff.buffIndex, 30f);
				if (Object.op_Implicit((Object)(object)master2.playerCharacterMasterController) || !Object.op_Implicit((Object)(object)master2.playerCharacterMasterController))
				{
					if (Config.choiceOnTeammate.Value)
					{
					}
					if (!Config.choiceOnTeammate.Value)
					{
						NetworkingHelpers.ApplyBuff(body2, Buffs.assaultvestBuff.buffIndex, 0, -1f);
						NetworkingHelpers.ApplyBuff(body2, Buffs.choicebandBuff.buffIndex, 0, -1f);
						NetworkingHelpers.ApplyBuff(body2, Buffs.choicescarfBuff.buffIndex, 0, -1f);
						NetworkingHelpers.ApplyBuff(body2, Buffs.choicespecsBuff.buffIndex, 0, -1f);
						NetworkingHelpers.ApplyBuff(body2, Buffs.leftoversBuff.buffIndex, 0, -1f);
						NetworkingHelpers.ApplyBuff(body2, Buffs.lifeorbBuff.buffIndex, 0, -1f);
						NetworkingHelpers.ApplyBuff(body2, Buffs.luckyeggBuff.buffIndex, 0, -1f);
						NetworkingHelpers.ApplyBuff(body2, Buffs.rockyhelmetBuff.buffIndex, 0, -1f);
						NetworkingHelpers.ApplyBuff(body2, Buffs.scopelensBuff.buffIndex, 0, -1f);
						NetworkingHelpers.ApplyBuff(body2, Buffs.shellbellBuff.buffIndex, 0, -1f);
					}
				}
				if (Config.grabAspect.Value && hurtBox.healthComponent.body.isElite)
				{
					if (hurtBox.healthComponent.body.HasBuff(Buffs.AffixBlue))
					{
						dropEquipment(Elites.Lightning.eliteEquipmentDef);
					}
					if (hurtBox.healthComponent.body.HasBuff(Buffs.AffixHaunted))
					{
						dropEquipment(Elites.Haunted.eliteEquipmentDef);
					}
					if (hurtBox.healthComponent.body.HasBuff(Buffs.AffixLunar))
					{
						dropEquipment(Elites.Lunar.eliteEquipmentDef);
					}
					if (hurtBox.healthComponent.body.HasBuff(Buffs.AffixPoison))
					{
						dropEquipment(Elites.Poison.eliteEquipmentDef);
					}
					if (hurtBox.healthComponent.body.HasBuff(Buffs.AffixRed))
					{
						dropEquipment(Elites.Fire.eliteEquipmentDef);
					}
					if (hurtBox.healthComponent.body.HasBuff(Buffs.AffixWhite))
					{
						dropEquipment(Elites.Ice.eliteEquipmentDef);
					}
					if (hurtBox.healthComponent.body.HasBuff(Buffs.EliteEarth))
					{
						dropEquipment(Elites.Earth.eliteEquipmentDef);
					}
					if (hurtBox.healthComponent.body.HasBuff(Buffs.EliteVoid))
					{
						dropEquipment(Elites.Void.eliteEquipmentDef);
					}
				}
			}
			else
			{
				dittomastercon.transformed = false;
				Chat.AddMessage("Ditto's <style=cIsUtility>Transform failed!</style>");
			}
		}

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

		public override void OnSerialize(NetworkWriter writer)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			NetworkExtensions.Write(writer, HurtBoxReference.FromHurtBox(Target));
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			HurtBoxReference val = NetworkExtensions.ReadHurtBoxReference(reader);
			Target = ((HurtBoxReference)(ref val)).ResolveHurtBox();
		}
	}
	public class TransformDitto : BaseSkillState
	{
		private float duration = 1f;

		private float fireTime = 0.2f;

		private bool hasFired;

		public DittoController dittocon;

		public DittoMasterController dittomastercon;

		public HurtBox Target;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			float num = ((EntityState)this).characterBody.healthComponent.health / ((EntityState)this).characterBody.healthComponent.fullHealth;
			AkSoundEngine.PostEvent(1719197672u, ((EntityState)this).gameObject);
			CharacterMaster master = ((EntityState)this).characterBody.master;
			if (((Object)master.bodyPrefab).name == "CaptainBody")
			{
				master.inventory.RemoveItem(Items.CaptainDefenseMatrix, 1);
			}
			if (((Object)master.bodyPrefab).name == "HereticBody")
			{
				master.inventory.RemoveItem(Items.LunarPrimaryReplacement, 1);
				master.inventory.RemoveItem(Items.LunarSecondaryReplacement, 1);
				master.inventory.RemoveItem(Items.LunarSpecialReplacement, 1);
				master.inventory.RemoveItem(Items.LunarUtilityReplacement, 1);
			}
			if (((Object)master.bodyPrefab).name != "DittoBody")
			{
				master.TransformBody("DittoBody");
				CharacterBody body = master.GetBody();
				dittomastercon.transformed = false;
				dittomastercon.assaultvest = false;
				dittomastercon.choiceband = false;
				dittomastercon.choicescarf = false;
				dittomastercon.choicespecs = false;
				dittomastercon.leftovers = false;
				dittomastercon.lifeorb = false;
				dittomastercon.luckyegg = false;
				dittomastercon.rockyhelmet = false;
				dittomastercon.scopelens = false;
				dittomastercon.shellbell = false;
				if (Config.copyHealth.Value)
				{
					body.healthComponent.health = body.healthComponent.fullHealth * num;
				}
			}
		}

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

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)1;
		}
	}
}
namespace DittoMod.SkillStates.BaseStates
{
	public class SpawnState : BaseSkillState
	{
		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge > 0f && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}
	}
}
namespace DittoMod.Items
{
	public abstract class ItemBase<T> : ItemBase where T : ItemBase<T>
	{
		public static T instance { get; private set; }

		public ItemBase()
		{
			if (instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBase was instantiated twice");
			}
			instance = this as T;
		}
	}
	public abstract class ItemBase
	{
		public ItemDef ItemDef;

		public abstract string ItemName { get; }

		public abstract string ItemLangTokenName { get; }

		public abstract string ItemPickupDesc { get; }

		public abstract string ItemFullDescription { get; }

		public abstract string ItemLore { get; }

		public abstract ItemTier Tier { get; }

		public virtual ItemTag[] ItemTags { get; }

		public abstract GameObject ItemModel { get; }

		public abstract Sprite ItemIcon { get; }

		public virtual bool CanRemove { get; } = true;


		public virtual bool AIBlacklisted { get; set; } = false;


		public virtual bool PrinterBlacklisted { get; set; } = false;


		public virtual bool RequireUnlock { get; set; } = true;


		public virtual bool Hidden { get; } = false;


		public abstract void Init(ConfigFile config);

		protected void CreateLang()
		{
			LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_NAME", ItemName);
			LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_PICKUP", ItemPickupDesc);
			LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_DESCRIPTION", ItemFullDescription);
			LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_LORE", ItemLore);
		}

		public abstract ItemDisplayRuleDict CreateItemDisplayRules();

		protected void CreateItem()
		{
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Expected O, but got Unknown
			ItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)ItemDef).name = "ITEM_" + ItemLangTokenName;
			ItemDef.nameToken = "ITEM_" + ItemLangTokenName + "_NAME";
			ItemDef.pickupToken = "ITEM_" + ItemLangTokenName + "_PICKUP";
			ItemDef.descriptionToken = "ITEM_" + ItemLangTokenName + "_DESCRIPTION";
			ItemDef.loreToken = "ITEM_" + ItemLangTokenName + "_LORE";
			ItemDef.pickupModelPrefab = ItemModel;
			ItemDef.pickupIconSprite = ItemIcon;
			ItemDef.hidden = false;
			ItemDef.canRemove = CanRemove;
			ItemDef.tier = Tier;
			ItemDef.tags = ItemTags;
			ItemDisplayRuleDict val = CreateItemDisplayRules();
			ItemAPI.Add(new CustomItem(ItemDef, val));
		}

		public abstract void Hooks();

		public int GetCount(CharacterBody body)
		{
			if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory))
			{
				return 0;
			}
			return body.inventory.GetItemCount(ItemDef);
		}

		public int GetCount(CharacterMaster master)
		{
			if (!Object.op_Implicit((Object)(object)master) || !Object.op_Implicit((Object)(object)master.inventory))
			{
				return 0;
			}
			return master.inventory.GetItemCount(ItemDef);
		}
	}
}
namespace DittoMod.Equipment
{
	public abstract class EquipmentBase<T> : EquipmentBase where T : EquipmentBase<T>
	{
		public static T instance { get; private set; }

		public EquipmentBase()
		{
			if (instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting EquipmentBoilerplate/Equipment was instantiated twice");
			}
			instance = this as T;
		}
	}
	public abstract class EquipmentBase
	{
		public enum TargetingType
		{
			Enemies,
			Friendlies
		}

		public class TargetingControllerComponent : MonoBehaviour
		{
			public GameObject TargetObject;

			public GameObject VisualizerPrefab;

			public Indicator Indicator;

			public BullseyeSearch TargetFinder;

			public Action<BullseyeSearch> AdditionalBullseyeFunctionality = delegate
			{
			};

			public void Awake()
			{
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Expected O, but got Unknown
				Indicator = new Indicator(((Component)this).gameObject, (GameObject)null);
			}

			public void OnDestroy()
			{
				Invalidate();
			}

			public void Invalidate()
			{
				TargetObject = null;
				Indicator.targetTransform = null;
			}

			public void ConfigureTargetFinderBase(EquipmentSlot self)
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_0063: 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_0075: Unknown result type (might be due to invalid IL or missing references)
				//IL_007e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0083: Unknown result type (might be due to invalid IL or missing references)
				//IL_0090: Unknown result type (might be due to invalid IL or missing references)
				//IL_0095: Unknown result type (might be due to invalid IL or missing references)
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Expected O, but got Unknown
				if (TargetFinder == null)
				{
					TargetFinder = new BullseyeSearch();
				}
				TargetFinder.teamMaskFilter = TeamMask.allButNeutral;
				((TeamMask)(ref TargetFinder.teamMaskFilter)).RemoveTeam(self.characterBody.teamComponent.teamIndex);
				TargetFinder.sortMode = (SortMode)2;
				TargetFinder.filterByLoS = true;
				float num = default(float);
				Ray val = CameraRigController.ModifyAimRayIfApplicable(self.GetAimRay(), ((Component)self).gameObject, ref num);
				TargetFinder.searchOrigin = ((Ray)(ref val)).origin;
				TargetFinder.searchDirection = ((Ray)(ref val)).direction;
				TargetFinder.maxAngleFilter = 10f;
				TargetFinder.viewer = self.characterBody;
			}

			public void ConfigureTargetFinderForEnemies(EquipmentSlot self)
			{
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				ConfigureTargetFinderBase(self);
				TargetFinder.teamMaskFilter = TeamMask.GetUnprotectedTeams(self.characterBody.teamComponent.teamIndex);
				TargetFinder.RefreshCandidates();
				TargetFinder.FilterOutGameObject(((Component)self).gameObject);
				AdditionalBullseyeFunctionality(TargetFinder);
				PlaceTargetingIndicator(TargetFinder.GetResults());
			}

			public void ConfigureTargetFinderForFriendlies(EquipmentSlot self)
			{
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				ConfigureTargetFinderBase(self);
				TargetFinder.teamMaskFilter = TeamMask.none;
				((TeamMask)(ref TargetFinder.teamMaskFilter)).AddTeam(self.characterBody.teamComponent.teamIndex);
				TargetFinder.RefreshCandidates();
				TargetFinder.FilterOutGameObject(((Component)self).gameObject);
				AdditionalBullseyeFunctionality(TargetFinder);
				PlaceTargetingIndicator(TargetFinder.GetResults());
			}

			public void PlaceTargetingIndicator(IEnumerable<HurtBox> TargetFinderResults)
			{
				HurtBox val = (TargetFinderResults.Any() ? TargetFinderResults.First() : null);
				if (Object.op_Implicit((Object)(object)val))
				{
					TargetObject = ((Component)val.healthComponent).gameObject;
					Indicator.visualizerPrefab = VisualizerPrefab;
					Indicator.targetTransform = ((Component)val).transform;
				}
				else
				{
					Invalidate();
				}
				Indicator.active = Object.op_Implicit((Object)(object)val);
			}
		}

		public EquipmentDef EquipmentDef;

		public GameObject TargetingIndicatorPrefabBase = null;

		public abstract string EquipmentName { get; }

		public abstract string EquipmentLangTokenName { get; }

		public abstract string EquipmentPickupDesc { get; }

		public abstract string EquipmentFullDescription { get; }

		public abstract string EquipmentLore { get; }

		public abstract GameObject EquipmentModel { get; }

		public abstract Sprite EquipmentIcon { get; }

		public virtual bool AppearsInSinglePlayer { get; } = true;


		public virtual bool AppearsInMultiPlayer { get; } = true;


		public virtual bool CanDrop { get; } = true;


		public virtual float Cooldown { get; } = 60f;


		public virtual bool EnigmaCompatible { get; } = true;


		public virtual bool IsBoss { get; } = false;


		public virtual bool IsLunar { get; } = false;


		public virtual bool UseTargeting { get; } = false;


		public virtual TargetingType TargetingTypeEnum { get; } = TargetingType.Enemies;


		public abstract void Init();

		public abstract ItemDisplayRuleDict CreateItemDisplayRules();

		protected void CreateLang()
		{
			LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_NAME", EquipmentName);
			LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_PICKUP", EquipmentPickupDesc);
			LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_DESCRIPTION", EquipmentFullDescription);
			LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_LORE", EquipmentLore);
		}

		protected void CreateEquipment()
		{
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Expected O, but got Unknown
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Expected O, but got Unknown
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Expected O, but got Unknown
			EquipmentDef = ScriptableObject.CreateInstance<EquipmentDef>();
			((Object)EquipmentDef).name = "EQUIPMENT_" + EquipmentLangTokenName;
			EquipmentDef.nameToken = "EQUIPMENT_" + EquipmentLangTokenName + "_NAME";
			EquipmentDef.pickupToken = "EQUIPMENT_" + EquipmentLangTokenName + "_PICKUP";
			EquipmentDef.descriptionToken = "EQUIPMENT_" + EquipmentLangTokenName + "_DESCRIPTION";
			EquipmentDef.loreToken = "EQUIPMENT_" + EquipmentLangTokenName + "_LORE";
			EquipmentDef.pickupModelPrefab = EquipmentModel;
			EquipmentDef.pickupIconSprite = EquipmentIcon;
			EquipmentDef.appearsInSinglePlayer = AppearsInSinglePlayer;
			EquipmentDef.appearsInMultiPlayer = AppearsInMultiPlayer;
			EquipmentDef.canDrop = CanDrop;
			EquipmentDef.cooldown = Cooldown;
			EquipmentDef.enigmaCompatible = EnigmaCompatible;
			EquipmentDef.isBoss = IsBoss;
			EquipmentDef.isLunar = IsLunar;
			ItemAPI.Add(new CustomEquipment(EquipmentDef, CreateItemDisplayRules()));
			EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(PerformEquipmentAction);
			if (UseTargeting && Object.op_Implicit((Object)(object)TargetingIndicatorPrefabBase))
			{
				EquipmentSlot.Update += new hook_Update(UpdateTargeting);
			}
		}

		protected bool PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef)
		{
			if ((Object)(object)equipmentDef == (Object)(object)EquipmentDef)
			{
				return ActivateEquipment(self);
			}
			return orig.Invoke(self, equipmentDef);
		}

		protected abstract bool ActivateEquipment(EquipmentSlot slot);

		public abstract void Hooks();

		protected void UpdateTargeting(orig_Update orig, EquipmentSlot self)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (self.equipmentIndex != EquipmentDef.equipmentIndex)
			{
				return;
			}
			TargetingControllerComponent targetingControllerComponent = ((Component)self).GetComponent<TargetingControllerComponent>();
			if (!Object.op_Implicit((Object)(object)targetingControllerComponent))
			{
				targetingControllerComponent = ((Component)self).gameObject.AddComponent<TargetingControllerComponent>();
				targetingControllerComponent.VisualizerPrefab = TargetingIndicatorPrefabBase;
			}
			if (self.stock > 0)
			{
				switch (TargetingTypeEnum)
				{
				case TargetingType.Enemies:
					targetingControllerComponent.ConfigureTargetFinderForEnemies(self);
					break;
				case TargetingType.Friendlies:
					targetingControllerComponent.ConfigureTargetFinderForFriendlies(self);
					break;
				}
			}
			else
			{
				targetingControllerComponent.Invalidate();
				targetingControllerComponent.Indicator.active = false;
			}
		}
	}
}
namespace DittoMod.Modules
{
	internal static class Assets
	{
		internal static AssetBundle mainAssetBundle;

		public static Sprite warcryBuffIcon = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/WarCryOnMultiKill/bdWarCryBuff.asset").WaitForCompletion().iconSprite;

		public static Sprite shieldBuffIcon = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/Common/bdArmorBoost.asset").WaitForCompletion().iconSprite;

		public static Sprite speedBuffIcon = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/Bandit2/bdCloakSpeed.asset").WaitForCompletion().iconSprite;

		public static Sprite boostBuffIcon = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/RandomDamageZone/bdPowerBuff.asset").WaitForCompletion().iconSprite;

		public static Sprite levitateBuffIcon = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/DLC1/MoveSpeedOnKill/bdKillMoveSpeed.asset").WaitForCompletion().iconSprite;

		public static Sprite elephantBuffIcon = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/GainArmor/bdElephantArmorBoost.asset").WaitForCompletion().iconSprite;

		public static Sprite brainBuffIcon = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/KillEliteFrenzy/bdNoCooldowns.asset").WaitForCompletion().iconSprite;

		public static Sprite skinBuffIcon = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/DLC1/OutOfCombatArmor/bdOutOfCombatArmorBuff.asset").WaitForCompletion().iconSprite;

		public static Sprite blazingBuffIcon = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/Common/bdOnFire.asset").WaitForCompletion().iconSprite;

		public static Sprite critBuffIcon = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/CritOnUse/bdFullCrit.asset").WaitForCompletion().iconSprite;

		public static Sprite predatorBuffIcon = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/AttackSpeedOnCrit/bdAttackSpeedOnCrit.asset").WaitForCompletion().iconSprite;

		public static Sprite banditSkullBuffIcon = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/Bandit2/bdBanditSkull.asset").WaitForCompletion().iconSprite;

		internal static NetworkSoundEventDef swordHitSoundEvent;

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

		internal static List<EffectDef> effectDefs = new List<EffectDef>();

		internal static Shader hotpoo = LegacyResourcesAPI.Load<Shader>("Shaders/Deferred/HGStandard");

		internal static Material commandoMat;

		private static string[] assetNames = new string[0];

		private const string assetbundleName = "DittoAssetBundle";

		internal static GameObject DittoEquipmentPrefab;

		internal static GameObject DittoItemPrefab;

		internal static void Initialize()
		{
			bool flag = false;
			LoadAssetBundle();
			LoadSoundbank();
			PopulateAssets();
		}

		internal static void LoadAssetBundle()
		{
			if ((Object)(object)mainAssetBundle == (Object)null)
			{
				using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("DittoMod.DittoAssetBundle");
				mainAssetBundle = AssetBundle.LoadFromStream(stream);
			}
			assetNames = mainAssetBundle.GetAllAssetNames();
		}

		internal static void LoadSoundbank()
		{
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("DittoMod.Ditto.bnk");
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			SoundBanks.Add(array);
		}

		internal static void PopulateAssets()
		{
			if (!Object.op_Implicit((Object)(object)mainAssetBundle))
			{
				Debug.LogError((object)"There is no AssetBundle to load assets from.");
				return;
			}
			DittoEquipmentPrefab = mainAssetBundle.LoadAsset<GameObject>("DittoEquipmentModel");
			DittoItemPrefab = mainAssetBundle.LoadAsset<GameObject>("DittoItemModel");
		}

		private static GameObject CreateTracer(string originalTracerName, string newTracerName)
		{
			if ((Object)(object)LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/" + originalTracerName) == (Object)null)
			{
				return null;
			}
			GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/" + originalTracerName), newTracerName, true);
			if (!Object.op_Implicit((Object)(object)val.GetComponent<EffectComponent>()))
			{
				val.AddComponent<EffectComponent>();
			}
			if (!Object.op_Implicit((Object)(object)val.GetComponent<VFXAttributes>()))
			{
				val.AddComponent<VFXAttributes>();
			}
			if (!Object.op_Implicit((Object)(object)val.GetComponent<NetworkIdentity>()))
			{
				val.AddComponent<NetworkIdentity>();
			}
			val.GetComponent<Tracer>().speed = 250f;
			val.GetComponent<Tracer>().length = 50f;
			AddNewEffectDef(val);
			return val;
		}

		internal static NetworkSoundEventDef CreateNetworkSoundEventDef(string eventName)
		{
			NetworkSoundEventDef val = ScriptableObject.CreateInstance<NetworkSoundEventDef>();
			val.akId = AkSoundEngine.GetIDFromString(eventName);
			val.eventName = eventName;
			networkSoundEventDefs.Add(val);
			return val;
		}

		internal static void ConvertAllRenderersToHopooShader(GameObject objectToConvert)
		{
			if (!Object.op_Implicit((Object)(object)objectToConvert))
			{
				return;
			}
			MeshRenderer[] componentsInChildren = objectToConvert.GetComponentsInChildren<MeshRenderer>();
			foreach (MeshRenderer val in componentsInChildren)
			{
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Renderer)val).material))
				{
					((Renderer)val).material.shader = hotpoo;
				}
			}
			SkinnedMeshRenderer[] componentsInChildren2 = objectToConvert.GetComponentsInChildren<SkinnedMeshRenderer>();
			foreach (SkinnedMeshRenderer val2 in componentsInChildren2)
			{
				if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)((Renderer)val2).material))
				{
					((Renderer)val2).material.shader = hotpoo;
				}
			}
		}

		internal static RendererInfo[] SetupRendererInfos(GameObject obj)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: 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)
			MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren<MeshRenderer>();
			RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[componentsInChildren.Length];
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				array[i] = new RendererInfo
				{
					defaultMaterial = ((Renderer)componentsInChildren[i]).material,
					renderer = (Renderer)(object)componentsInChildren[i],
					defaultShadowCastingMode = (ShadowCastingMode)1,
					ignoreOverlays = false
				};
			}
			return array;
		}

		internal static Texture LoadCharacterIcon(string characterName)
		{
			return mainAssetBundle.LoadAsset<Texture>("tex" + characterName + "Icon");
		}

		internal static GameObject LoadCrosshair(string crosshairName)
		{
			if ((Object)(object)LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/" + crosshairName + "Crosshair") == (Object)null)
			{
				return LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/StandardCrosshair");
			}
			return LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/" + crosshairName + "Crosshair");
		}

		private static GameObject LoadEffect(string resourceName)
		{
			return LoadEffect(resourceName, "", parentToTransform: false);
		}

		private static GameObject LoadEffect(string resourceName, string soundName)
		{
			return LoadEffect(resourceName, soundName, parentToTransform: false);
		}

		private static GameObject LoadEffect(string resourceName, bool parentToTransform)
		{
			return LoadEffect(resourceName, "", parentToTransform);
		}

		private static GameObject LoadEffect(string resourceName, string soundName, bool parentToTransform)
		{
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			for (int i = 0; i < assetNames.Length; i++)
			{
				if (assetNames[i].Contains(resourceName.ToLower()))
				{
					flag = true;
					i = assetNames.Length;
				}
			}
			if (!flag)
			{
				Debug.LogError((object)("Failed to load effect: " + resourceName + " because it does not exist in the AssetBundle"));
				return null;
			}
			GameObject val = mainAssetBundle.LoadAsset<GameObject>(resourceName);
			val.AddComponent<DestroyOnTimer>().duration = 12f;
			val.AddComponent<NetworkIdentity>();
			val.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
			EffectComponent val2 = val.AddComponent<EffectComponent>();
			val2.applyScale = false;
			val2.effectIndex = (EffectIndex)(-1);
			val2.parentToReferencedTransform = parentToTransform;
			val2.positionAtReferencedTransform = true;
			val2.soundName = soundName;
			AddNewEffectDef(val, soundName);
			return val;
		}

		private static void AddNewEffectDef(GameObject effectPrefab)
		{
			AddNewEffectDef(effectPrefab, "");
		}

		private static void AddNewEffectDef(GameObject effectPrefab, string soundName)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			EffectDef val = new EffectDef();
			val.prefab = effectPrefab;
			val.prefabEffectComponent = effectPrefab.GetComponent<EffectComponent>();
			val.prefabName = ((Object)effectPrefab).name;
			val.prefabVfxAttributes = effectPrefab.GetComponent<VFXAttributes>();
			val.spawnSoundEventName = soundName;
			effectDefs.Add(val);
		}

		public static Material CreateMaterial(string materialName, float emission, Color emissionColor, float normalStrength)
		{
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)commandoMat))
			{
				commandoMat = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren<CharacterModel>().baseRendererInfos[0].defaultMaterial;
			}
			Material val = Object.Instantiate<Material>(commandoMat);
			Material val2 = mainAssetBundle.LoadAsset<Material>(materialName);
			if (!Object.op_Implicit((Object)(object)val2))
			{
				Debug.LogError((object)("Failed to load material: " + materialName + " - Check to see that the name in your Unity project matches the one in this code"));
				return commandoMat;
			}
			((Object)val).name = materialName;
			val.SetColor("_Color", val2.GetColor("_Color"));
			val.SetTexture("_MainTex", val2.GetTexture("_MainTex"));
			val.SetColor("_EmColor", emissionColor);
			val.SetFloat("_EmPower", emission);
			val.SetTexture("_EmTex", val2.GetTexture("_EmissionMap"));
			val.SetFloat("_NormalStrength", normalStrength);
			return val;
		}

		public static Material CreateMaterial(string materialName)
		{
			return CreateMaterial(materialName, 0f);
		}

		public static Material CreateMaterial(string materialName, float emission)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return CreateMaterial(materialName, emission, Color.white);
		}

		public static Material CreateMaterial(string materialName, float emission, Color emissionColor)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return CreateMaterial(materialName, emission, emissionColor, 0f);
		}
	}
	public static class Buffs
	{
		internal static List<BuffDef> buffDefs = new List<BuffDef>();

		internal static BuffDef transformBuff;

		internal static BuffDef transformdeBuff;

		internal static BuffDef assaultvestBuff;

		internal static BuffDef choicescarfBuff;

		internal static BuffDef choicebandBuff;

		internal static BuffDef choicespecsBuff;

		internal static BuffDef leftoversBuff;

		internal static BuffDef lifeorbBuff;

		internal static BuffDef luckyeggBuff;

		internal static BuffDef rockyhelmetBuff;

		internal static BuffDef scopelensBuff;

		internal static BuffDef shellbellBuff;

		internal static BuffDef flamebodyBuff;

		internal static BuffDef hugepowerBuff;

		internal static BuffDef levitateBuff;

		internal static BuffDef magicguardBuff;

		internal static BuffDef moodyBuff;

		internal static BuffDef moodyDamageBuff;

		internal static BuffDef moodyArmorBuff;

		internal static BuffDef moodyMovespeedBuff;

		internal static BuffDef moodyAttackspeedBuff;

		internal static BuffDef moodyDamageDebuff;

		internal static BuffDef moodyArmorDebuff;

		internal static BuffDef moodyMovespeedDebuff;

		internal static BuffDef moodyAttackspeedDebuff;

		internal static BuffDef moxieBuff;

		internal static BuffDef moxieBoostBuff;

		internal static BuffDef multiscaleBuff;

		internal static BuffDef multiscaleCooldownDebuff;

		internal static BuffDef sniperBuff;

		internal static void RegisterBuffs()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0300: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0354: Unknown result type (might be due to invalid IL or missing references)
			//IL_037e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0399: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03de: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0414: Unknown result type (might be due to invalid IL or missing references)
			Sprite iconSprite = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/DLC1/BleedOnHitVoid/bdFracture.asset").WaitForCompletion().iconSprite;
			transformdeBuff = AddNewBuff("transformdeBuff", iconSprite, Color.white, canStack: false, isDebuff: true);
			transformBuff = AddNewBuff("transformBuff", Assets.mainAssetBundle.LoadAsset<Sprite>("Transform"), Color.white, canStack: true, isDebuff: false);
			assaultvestBuff = AddNewBuff("assaultvestBuff", Assets.mainAssetBundle.LoadAsset<Sprite>("AssaultVest"), Color.white, canStack: false, isDebuff: false);
			choicescarfBuff = AddNewBuff("choicescarfBuff", Assets.mainAssetBundle.LoadAsset<Sprite>("ChoiceScarf"), Color.white, canStack: false, isDebuff: false);
			choicebandBuff = AddNewBuff("choicebandBuff", Assets.mainAssetBundle.LoadAsset<Sprite>("ChoiceBand"), Color.white, canStack: false, isDebuff: false);
			choicespecsBuff = AddNewBuff("choicespecsBuff", Assets.mainAssetBundle.LoadAsset<Sprite>("ChoiceSpecs"), Color.white, canStack: false, isDebuff: false);
			leftoversBuff = AddNewBuff("leftoversBuff", Assets.mainAssetBundle.LoadAsset<Sprite>("Leftovers"), Color.white, canStack: false, isDebuff: false);
			lifeorbBuff = AddNewBuff("lifeorbBuff", Assets.mainAssetBundle.LoadAsset<Sprite>("LifeOrb"), Color.white, canStack: false, isDebuff: false);
			luckyeggBuff = AddNewBuff("luckyeggBuff", Assets.mainAssetBundle.LoadAsset<Sprite>("LuckyEgg"), Color.white, canStack: false, isDebuff: false);
			rockyhelmetBuff = AddNewBuff("rockyhelmetBuff", Assets.mainAssetBundle.LoadAsset<Sprite>("RockyHelmet"), Color.white, canStack: false, isDebuff: false);
			scopelensBuff = AddNewBuff("scopelensBuff", Assets.mainAssetBundle.LoadAsset<Sprite>("ScopeLens"), Color.white, canStack: false, isDebuff: false);
			shellbellBuff = AddNewBuff("shellbellBuff", Assets.mainAssetBundle.LoadAsset<Sprite>("ShellBell"), Color.white, canStack: false, isDebuff: false);
			flamebodyBuff = AddNewBuff("flamebodyBuff", Assets.blazingBuffIcon, Color.grey, canStack: false, isDebuff: false);
			hugepowerBuff = AddNewBuff("hugepowerBuff", Assets.elephantBuffIcon, Color.blue, canStack: false, isDebuff: false);
			levitateBuff = AddNewBuff("levitateBuff", Assets.levitateBuffIcon, Color.magenta, canStack: false, isDebuff: false);
			magicguardBuff = AddNewBuff("magicguardBuff", Assets.brainBuffIcon, new Color(0.86f, 0.44f, 0.59f), canStack: false, isDebuff: false);
			moodyBuff = AddNewBuff("moodyBuff", Assets