Decompiled source of VariantPack TheOriginal30 v2.1.0

plugins/TheOriginal30.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.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Croco;
using EntityStates.GreaterWispMonster;
using EntityStates.JellyfishMonster.MOAJ;
using EntityStates.JellyfishMonster.Nuclear;
using EntityStates.JellyfishMonster.Spectral;
using EntityStates.LemurianBruiserMonster;
using EntityStates.Mage.Weapon;
using EntityStates.ParentMonster;
using HG;
using HG.Reflection;
using KinematicCharacterController;
using MSU;
using MSU.Config;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.ContentManagement;
using RoR2.Navigation;
using RoR2.Projectile;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using VAPI;
using VAPI.Components;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: OptIn]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace EntityStates.ScavMonster.Dream
{
	public class DreamLuck : BaseState
	{
		private float duration;

		private PickupIndex dropPickup;

		private int itemsToGrant;

		private PickupDisplay pickupDisplay;

		public override void OnEnter()
		{
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Expected I4, but got Unknown
			((BaseState)this).OnEnter();
			duration = FindItem.baseDuration / base.attackSpeedStat;
			((EntityState)this).PlayCrossfade("Body", "SitRummage", "Sit.playbackRate", duration, 0.1f);
			Util.PlaySound(FindItem.sound, ((EntityState)this).gameObject);
			if (((EntityState)this).isAuthority)
			{
				WeightedSelection<List<PickupIndex>> obj = new WeightedSelection<List<PickupIndex>>(8);
				obj.AddChoice(Run.instance.availableTier3DropList.Where(PickupIsNonBlacklistedItem).ToList(), FindItem.tier3Chance);
				List<PickupIndex> list = obj.Evaluate(Random.value);
				dropPickup = list[Random.Range(0, list.Count)];
				PickupDef pickupDef = PickupCatalog.GetPickupDef(dropPickup);
				if (pickupDef != null)
				{
					ItemDef itemDef = ItemCatalog.GetItemDef(pickupDef.itemIndex);
					if ((Object)(object)itemDef != (Object)null)
					{
						itemsToGrant = 0;
						ItemTier tier = itemDef.tier;
						switch ((int)tier)
						{
						case 0:
							itemsToGrant = FindItem.tier1Count;
							break;
						case 1:
							itemsToGrant = FindItem.tier2Count;
							break;
						case 2:
							itemsToGrant = FindItem.tier3Count;
							break;
						default:
							itemsToGrant = 1;
							break;
						}
					}
				}
			}
			Transform val = ((BaseState)this).FindModelChild("PickupDisplay");
			pickupDisplay = ((Component)val).GetComponent<PickupDisplay>();
			pickupDisplay.SetPickupIndex(dropPickup, false);
		}

		public override void OnExit()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			pickupDisplay.SetPickupIndex(PickupIndex.none, false);
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextState((EntityState)new GrantItem
				{
					dropPickup = dropPickup,
					itemsToGrant = itemsToGrant
				});
			}
		}

		public override void OnSerialize(NetworkWriter writer)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnSerialize(writer);
			NetworkExtensions.Write(writer, dropPickup);
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnDeserialize(reader);
			dropPickup = NetworkExtensions.ReadPickupIndex(reader);
		}

		private bool PickupIsNonBlacklistedItem(PickupIndex pickupIndex)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			PickupDef pickupDef = PickupCatalog.GetPickupDef(pickupIndex);
			if (pickupDef == null)
			{
				return false;
			}
			ItemDef itemDef = ItemCatalog.GetItemDef(pickupDef.itemIndex);
			if ((Object)(object)itemDef != (Object)null)
			{
				return itemDef.DoesNotContainTag((ItemTag)4);
			}
			return false;
		}
	}
	public class EnterLuckySit : BaseSitState
	{
		private float duration;

		public override void OnEnter()
		{
			((BaseSitState)this).OnEnter();
			duration = EnterSit.baseDuration / ((BaseState)this).attackSpeedStat;
			Util.PlaySound(EnterSit.soundString, ((EntityState)this).gameObject);
			((EntityState)this).PlayCrossfade("Body", "EnterSit", "Sit.playbackRate", duration, 0.1f);
			((EntityState)this).modelLocator.normalizeToFloor = true;
			((Behaviour)((Component)((EntityState)this).modelLocator.modelTransform).GetComponent<AimAnimator>()).enabled = true;
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new DreamLuck());
			}
		}
	}
}
namespace EntityStates.Wisp1Monster.AlmostGreat
{
	public class ChargeGreaterCannon : BaseState
	{
		public static float baseDuration = 3f;

		protected float duration;

		private GameObject chargeEffect;

		private const float soundDuration = 2f;

		private string attackString;

		private GameObject effectPrefab;

		private ChargeCannons goodState;

		public override void OnEnter()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Expected O, but got Unknown
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			if (goodState == null)
			{
				goodState = new ChargeCannons();
			}
			attackString = goodState.attackString;
			effectPrefab = goodState.effectPrefab;
			((BaseState)this).OnEnter();
			Util.PlayAttackSpeedSound(attackString, ((EntityState)this).gameObject, base.attackSpeedStat * (2f / baseDuration));
			duration = baseDuration / base.attackSpeedStat;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.FindChild("Muzzle")))
				{
					chargeEffect = Object.Instantiate<GameObject>(effectPrefab, ((EntityState)this).transform.position, ((EntityState)this).transform.rotation);
					chargeEffect.transform.parent = ((EntityState)this).transform;
					ScaleParticleSystemDuration component2 = chargeEffect.GetComponent<ScaleParticleSystemDuration>();
					if (Object.op_Implicit((Object)(object)component2))
					{
						component2.newDuration = duration;
					}
				}
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(duration);
			}
			((EntityState)this).PlayAnimation("Body", "ChargeAttack1", "ChargeAttack1.playbackRate", duration, 0f);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			EntityState.Destroy((Object)(object)chargeEffect);
		}

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

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				FireGreaterCannon nextState = new FireGreaterCannon();
				((EntityState)this).outer.SetNextState((EntityState)(object)nextState);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
	public class FireGreaterCannon : BaseState
	{
		public static float baseDuration = 2f;

		public static float damageCoefficient = 12f;

		private float duration;

		private GameObject effectPrefab;

		private FireCannons goodState;

		public override void OnEnter()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Expected O, but got Unknown
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			if (goodState == null)
			{
				goodState = new FireCannons();
			}
			effectPrefab = goodState.effectPrefab;
			((BaseState)this).OnEnter();
			Ray aimRay = ((BaseState)this).GetAimRay();
			duration = baseDuration / base.attackSpeedStat;
			((EntityState)this).PlayAnimation("Body", "FireAttack1", "FireAttack1.playbackRate", duration, 0f);
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).modelLocator) && Object.op_Implicit((Object)(object)((EntityState)this).modelLocator.modelTransform))
			{
				ChildLocator component = ((Component)((EntityState)this).modelLocator.modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.FindChild("Muzzle")))
				{
					ProjectileManager.instance.FireProjectile(Resources.Load<GameObject>("Prefabs/Projectiles/WispCannon"), ((EntityState)this).transform.position, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, base.damageStat * damageCoefficient, 80f, Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
				}
			}
		}

		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()
		{
			return (InterruptPriority)1;
		}
	}
}
namespace EntityStates.LemurianMonster.Flamethrower
{
	public class FireFlamethrower : BaseState
	{
		public static GameObject flameThrowerEffectPrefab;

		public float maxDistance = 40f;

		private float tickDamageCoefficient;

		private float flamethrowerStopwatch;

		private float stopwatch;

		private float entryDuration;

		private float flamethrowerDuration;

		private bool hasBegunFlamethrower;

		private ChildLocator childLocator;

		private Transform flamethrowerTransform;

		private Transform mouthMuzzle;

		private bool isCrit;

		private const float flamethrowerEffectBaseDistance = 16f;

		[SystemInitializer(new Type[] { })]
		private static void Initialize()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			flameThrowerEffectPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Drones/DroneFlamethrowerEffect.prefab").WaitForCompletion(), "FlamethrowerLemurianEffect", false);
			EntityState.Destroy((Object)(object)flameThrowerEffectPrefab.GetComponent<DestroyOnTimer>());
			ParticleSystem componentInChildren = flameThrowerEffectPrefab.GetComponentInChildren<ParticleSystem>();
			MainModule main = componentInChildren.main;
			((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.5f);
			((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(70f);
			EmissionModule emission = componentInChildren.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(80f);
		}

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			entryDuration = Flamethrower.baseEntryDuration / base.attackSpeedStat;
			flamethrowerDuration = Flamethrower.baseFlamethrowerDuration;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(entryDuration + flamethrowerDuration + 1f);
			}
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				childLocator = ((Component)modelTransform).GetComponent<ChildLocator>();
				mouthMuzzle = childLocator.FindChild("MuzzleMouth");
			}
			int num = Mathf.CeilToInt(flamethrowerDuration * Flamethrower.tickFrequency);
			tickDamageCoefficient = 0.5f / (float)num;
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				isCrit = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master);
			}
			((EntityState)this).PlayAnimation("Gesture", "ChargeFireball", "ChargeFireball.playbackRate", entryDuration, 0f);
		}

		public override void OnExit()
		{
			Util.PlaySound(Flamethrower.endAttackSoundString, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)flamethrowerTransform))
			{
				EntityState.Destroy((Object)(object)((Component)flamethrowerTransform).gameObject);
			}
			((EntityState)this).OnExit();
		}

		private void FireGauntlet(string muzzleString)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: 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_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: 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_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			Ray aimRay = ((BaseState)this).GetAimRay();
			if (((EntityState)this).isAuthority)
			{
				new BulletAttack
				{
					owner = ((EntityState)this).gameObject,
					weapon = ((EntityState)this).gameObject,
					origin = ((Ray)(ref aimRay)).origin,
					aimVector = ((Ray)(ref aimRay)).direction,
					minSpread = 0f,
					damage = tickDamageCoefficient * base.damageStat,
					force = Flamethrower.force,
					muzzleName = muzzleString,
					hitEffectPrefab = Flamethrower.impactEffectPrefab,
					isCrit = isCrit,
					radius = Flamethrower.radius,
					falloffModel = (FalloffModel)0,
					stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask,
					procCoefficient = Flamethrower.procCoefficientPerTick,
					maxDistance = maxDistance,
					smartCollision = true,
					damageType = DamageTypeCombo.op_Implicit((DamageType)(Util.CheckRoll(Flamethrower.ignitePercentChance, ((EntityState)this).characterBody.master) ? 128 : 0))
				}.Fire();
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					((EntityState)this).characterMotor.ApplyForce(((Ray)(ref aimRay)).direction * (0f - Flamethrower.recoilForce), false, false);
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= entryDuration && !hasBegunFlamethrower)
			{
				hasBegunFlamethrower = true;
				Util.PlaySound(Flamethrower.startAttackSoundString, ((EntityState)this).gameObject);
				if (Object.op_Implicit((Object)(object)childLocator) && Object.op_Implicit((Object)(object)mouthMuzzle))
				{
					flamethrowerTransform = Object.Instantiate<GameObject>(flameThrowerEffectPrefab, mouthMuzzle).transform;
					((Component)flamethrowerTransform).GetComponent<ScaleParticleSystemDuration>().newDuration = flamethrowerDuration;
				}
				((EntityState)this).PlayAnimation("Gesture", "FireFireball", "FireFireball.playbackRate", Flamethrower.tickFrequency, 0f);
				FireGauntlet("MuzzleCenter");
			}
			if (hasBegunFlamethrower)
			{
				flamethrowerStopwatch += Time.deltaTime;
				float num = 1f / Flamethrower.tickFrequency / 2f;
				if (flamethrowerStopwatch > num)
				{
					flamethrowerStopwatch -= num;
					FireGauntlet("MuzzleMouth");
				}
				UpdateFlamethrowerEffect();
			}
			if (stopwatch >= flamethrowerDuration + entryDuration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private void UpdateFlamethrowerEffect()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 direction = ((Ray)(ref aimRay)).direction;
			if (Object.op_Implicit((Object)(object)flamethrowerTransform))
			{
				flamethrowerTransform.forward = direction;
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)3;
		}
	}
}
namespace EntityStates.LemurianMonster.Badass
{
	public class ChargeFireballAndMissile : BaseState
	{
		public static float baseDuration = ChargeFireball.baseDuration;

		public static GameObject chargeVfxPrefab = ChargeFireball.chargeVfxPrefab;

		public static string attackString = ChargeFireball.attackString;

		private float duration;

		private GameObject chargeVfxInstance;

		public override void OnEnter()
		{
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			baseDuration = ChargeFireball.baseDuration;
			chargeVfxPrefab = ChargeFireball.chargeVfxPrefab;
			attackString = ChargeFireball.attackString;
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			((EntityState)this).GetModelAnimator();
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			Util.PlayAttackSpeedSound(attackString, ((EntityState)this).gameObject, base.attackSpeedStat);
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component))
				{
					Transform val = component.FindChild("MuzzleMouth");
					if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)chargeVfxPrefab))
					{
						chargeVfxInstance = Object.Instantiate<GameObject>(chargeVfxPrefab, val.position, val.rotation);
						chargeVfxInstance.transform.parent = val;
					}
				}
			}
			((EntityState)this).PlayAnimation("Gesture", "ChargeFireball", "ChargeFireball.playbackRate", duration, 0f);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)chargeVfxInstance))
			{
				EntityState.Destroy((Object)(object)chargeVfxInstance);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				FireFireballAndMissile nextState = new FireFireballAndMissile();
				((EntityState)this).outer.SetNextState((EntityState)(object)nextState);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
	public class FireFireballAndMissile : BaseState
	{
		public static GameObject projectilePrefab = FireFireball.projectilePrefab;

		public static GameObject effectPrefab = FireFireball.effectPrefab;

		public static float baseDuration = FireFireball.baseDuration;

		public static float damageCoefficient = FireFireball.damageCoefficient;

		public static float force = FireFireball.force;

		public static string attackString = FireFireball.attackString;

		public static GameObject missleProjectilePrefab = Resources.Load<GameObject>("Prefabs/Projectiles/MissileProjectile");

		public static float missileDamageCoef = 1.2f;

		private float duration;

		public override void OnEnter()
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			((EntityState)this).PlayAnimation("Gesture", "FireFireball", "FireFireball.playbackRate", duration, 0f);
			Util.PlaySound(attackString, ((EntityState)this).gameObject);
			Ray aimRay = ((BaseState)this).GetAimRay();
			string text = "MuzzleMouth";
			string text2 = "Chest";
			if (Object.op_Implicit((Object)(object)effectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, text, false);
				EffectManager.SimpleMuzzleFlash(FireMegaFireball.muzzleflashEffectPrefab, ((EntityState)this).gameObject, text2, false);
			}
			if (((EntityState)this).isAuthority)
			{
				ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, base.damageStat * damageCoefficient, force, Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
				ProjectileManager.instance.FireProjectile(missleProjectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(Vector3.up), ((EntityState)this).gameObject, missileDamageCoef * base.damageStat, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f);
			}
		}

		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()
		{
			return (InterruptPriority)1;
		}
	}
}
namespace EntityStates.JellyfishMonster.Spectral
{
	public class SpawnRandomLesserEnemyVariant : GenericCharacterDeath
	{
		public static GameObject enterEffectPrefab;

		public static List<MasterIndex> validMasters = new List<MasterIndex>();

		public static int monsterCount = 1;

		private GameObject chosenMonster;

		private BodyVariantDefProvider chosenMonsterVariantDefProvider;

		private DeathRewards deathRewards;

		public override void OnEnter()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			enterEffectPrefab = DeathState.enterEffectPrefab;
			((GenericCharacterDeath)this).OnEnter();
			deathRewards = ((EntityState)this).GetComponent<DeathRewards>();
			((GenericCharacterDeath)this).DestroyModel();
			if (!NetworkServer.active)
			{
				return;
			}
			chosenMonster = MasterCatalog.GetMasterPrefab(validMasters[Random.Range(0, validMasters.Count)]);
			CharacterMaster component = chosenMonster.GetComponent<CharacterMaster>();
			if (!Object.op_Implicit((Object)(object)component.bodyPrefab))
			{
				((GenericCharacterDeath)this).DestroyBodyAsapServer();
				return;
			}
			chosenMonsterVariantDefProvider = BodyVariantDefProvider.FindProvider(component.bodyPrefab.GetComponent<CharacterBody>().bodyIndex);
			for (int i = 0; i < monsterCount; i++)
			{
				SpawnEnemyServer();
			}
			((GenericCharacterDeath)this).DestroyBodyAsapServer();
		}

		private void GiveEquipmentIndex(CharacterMaster master)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory))
			{
				master.inventory.SetEquipmentIndex(((EntityState)this).characterBody.inventory.currentEquipmentIndex);
			}
		}

		private void SpawnEnemyServer()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//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_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_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: 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_003f: 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_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Expected O, but got Unknown
			Vector3 position = ((EntityState)this).characterBody.corePosition + SpawnNova.jellyDropRadius * Random.insideUnitSphere;
			VariantSummon val = new VariantSummon
			{
				applyOnStart = true,
				useAmbientLevel = false,
				ignoreTeamMemberLimit = true,
				teamIndexOverride = ((EntityState)this).characterBody.teamComponent.teamIndex,
				position = position,
				variantDefs = Array.Empty<VariantDef>(),
				masterPrefab = chosenMonster,
				preSpawnSetupCallback = GiveEquipmentIndex,
				summonerBodyObject = null
			};
			if (Object.op_Implicit((Object)(object)deathRewards))
			{
				val.summonerDeathRewards = deathRewards;
				val.deathRewardsCoefficient = 1f;
			}
			ref VariantDef[] variantDefs = ref val.variantDefs;
			VariantDef variantDef = chosenMonsterVariantDefProvider.GetVariantDef(Random.Range(0, chosenMonsterVariantDefProvider.totalVariantCount));
			ArrayUtils.ArrayAppend<VariantDef>(ref variantDefs, ref variantDef);
			val.PerformSummon();
		}

		public override void CreateDeathEffects()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			((GenericCharacterDeath)this).CreateDeathEffects();
			if (Object.op_Implicit((Object)(object)enterEffectPrefab))
			{
				EffectManager.SimpleEffect(enterEffectPrefab, ((EntityState)this).transform.position, ((EntityState)this).transform.rotation, false);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)7;
		}
	}
}
namespace EntityStates.JellyfishMonster.MOAJ
{
	public class SpawnJellies : GenericCharacterDeath
	{
		public static GameObject enterEffectPrefab;

		public static GameObject masterPrefab;

		public static int jellies = 5;

		private DeathRewards deathRewards;

		public override void OnEnter()
		{
			//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_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: 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_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Expected O, but got Unknown
			enterEffectPrefab = DeathState.enterEffectPrefab;
			masterPrefab = MasterCatalog.GetMasterPrefab(MasterCatalog.FindAiMasterIndexForBody(((EntityState)this).characterBody.bodyIndex));
			((GenericCharacterDeath)this).OnEnter();
			deathRewards = ((EntityState)this).GetComponent<DeathRewards>();
			((GenericCharacterDeath)this).DestroyModel();
			if (!NetworkServer.active)
			{
				return;
			}
			for (int i = 0; i < SpawnNova.jellyCount; i++)
			{
				Vector3 position = ((EntityState)this).characterBody.corePosition + SpawnNova.jellyDropRadius * Random.insideUnitSphere;
				VariantSummon val = new VariantSummon
				{
					applyOnStart = false,
					variantDefs = Array.Empty<VariantDef>(),
					useAmbientLevel = false,
					teamIndexOverride = ((EntityState)this).characterBody.teamComponent.teamIndex,
					ignoreTeamMemberLimit = true,
					position = position,
					masterPrefab = masterPrefab,
					preSpawnSetupCallback = GiveEquipmentIndex,
					summonerBodyObject = null
				};
				if (Object.op_Implicit((Object)(object)deathRewards))
				{
					val.deathRewardsCoefficient = 0.2f;
					val.summonerDeathRewards = deathRewards;
				}
				val.PerformSummon();
			}
			((GenericCharacterDeath)this).DestroyBodyAsapServer();
		}

		private void GiveEquipmentIndex(CharacterMaster master)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory))
			{
				master.inventory.SetEquipmentIndex(((EntityState)this).characterBody.inventory.currentEquipmentIndex);
			}
		}

		public override void CreateDeathEffects()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			((GenericCharacterDeath)this).CreateDeathEffects();
			if (Object.op_Implicit((Object)(object)enterEffectPrefab))
			{
				EffectManager.SimpleEffect(enterEffectPrefab, ((EntityState)this).transform.position, ((EntityState)this).transform.rotation, false);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)7;
		}
	}
	public class SpawnNova : BaseState
	{
		public static float baseDuration = 0.5f;

		public static int jellyCount = 5;

		public static float jellyDropRadius = 5f;

		public static GameObject masterPrefab;

		private bool hasExploded;

		private float duration;

		private float stopwatch;

		private GameObject chargeEffect;

		private PrintController printController;

		private uint soundID;

		private DeathRewards deathRewards;

		public override void OnEnter()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			deathRewards = ((EntityState)this).GetComponent<DeathRewards>();
			stopwatch = 0f;
			duration = baseDuration / base.attackSpeedStat;
			masterPrefab = MasterCatalog.GetMasterPrefab(MasterCatalog.FindAiMasterIndexForBody(((EntityState)this).characterBody.bodyIndex));
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			((EntityState)this).PlayCrossfade("Body", "Nova", "Nova.playbackRate", duration, 0.1f);
			soundID = Util.PlaySound(JellyNova.chargingSoundString, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)JellyNova.chargingEffectPrefab))
			{
				chargeEffect = Object.Instantiate<GameObject>(JellyNova.chargingEffectPrefab, ((EntityState)this).transform.position, ((EntityState)this).transform.rotation);
				chargeEffect.transform.parent = ((EntityState)this).transform;
				chargeEffect.transform.localScale = Vector3.one * NuclearNova.novaRadius;
				chargeEffect.GetComponent<ScaleParticleSystemDuration>().newDuration = duration;
			}
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				printController = ((Component)modelTransform).GetComponent<PrintController>();
				if (Object.op_Implicit((Object)(object)printController))
				{
					((Behaviour)printController).enabled = true;
					printController.printTime = duration;
				}
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)chargeEffect))
			{
				EntityState.Destroy((Object)(object)chargeEffect);
			}
			if (Object.op_Implicit((Object)(object)printController))
			{
				((Behaviour)printController).enabled = false;
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= duration && ((EntityState)this).isAuthority && !hasExploded)
			{
				Detonate();
			}
		}

		private void Detonate()
		{
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Expected O, but got Unknown
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			hasExploded = true;
			Util.PlaySound(JellyNova.novaSoundString, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator))
			{
				if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator.modelBaseTransform))
				{
					EntityState.Destroy((Object)(object)((Component)((EntityState)this).modelLocator.modelBaseTransform).gameObject);
				}
				if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator.modelTransform))
				{
					EntityState.Destroy((Object)(object)((Component)((EntityState)this).modelLocator.modelTransform).gameObject);
				}
			}
			if (Object.op_Implicit((Object)(object)chargeEffect))
			{
				EntityState.Destroy((Object)(object)chargeEffect);
			}
			if (Object.op_Implicit((Object)(object)JellyNova.novaEffectPrefab))
			{
				EffectManager.SpawnEffect(JellyNova.novaEffectPrefab, new EffectData
				{
					origin = ((EntityState)this).transform.position,
					scale = NuclearNova.novaRadius
				}, true);
			}
			if (NetworkServer.active)
			{
				SpawnJellies();
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).healthComponent))
			{
				((EntityState)this).healthComponent.Suicide((GameObject)null, (GameObject)null, DamageTypeCombo.op_Implicit((DamageType)0));
			}
		}

		private void SpawnJellies()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: 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_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Expected O, but got Unknown
			for (int i = 0; i < jellyCount; i++)
			{
				Vector3 position = ((EntityState)this).characterBody.corePosition + jellyDropRadius * Random.insideUnitSphere;
				VariantSummon val = new VariantSummon
				{
					applyOnStart = false,
					variantDefs = Array.Empty<VariantDef>(),
					useAmbientLevel = false,
					teamIndexOverride = ((EntityState)this).characterBody.teamComponent.teamIndex,
					ignoreTeamMemberLimit = true,
					position = position,
					masterPrefab = masterPrefab,
					preSpawnSetupCallback = GiveEquipmentIndex,
					summonerBodyObject = null
				};
				if (Object.op_Implicit((Object)(object)deathRewards))
				{
					val.summonerDeathRewards = deathRewards;
					val.deathRewardsCoefficient = 0.2f;
				}
				val.PerformSummon();
			}
		}

		private void GiveEquipmentIndex(CharacterMaster master)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory))
			{
				master.inventory.SetEquipmentIndex(((EntityState)this).characterBody.inventory.currentEquipmentIndex);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)3;
		}
	}
}
namespace EntityStates.JellyfishMonster.Nuclear
{
	public class NuclearNova : BaseState
	{
		public static float baseDuration = 1.5f;

		public static float novaRadius = 24f;

		public static float novaForce = 2500f;

		private bool hasExploded;

		private float duration;

		private float stopwatch;

		private GameObject chargeEffect;

		private PrintController printController;

		private uint soundID;

		public override void OnEnter()
		{
			//IL_0078: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			stopwatch = 0f;
			duration = baseDuration / base.attackSpeedStat;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			((EntityState)this).PlayCrossfade("Body", "Nova", "Nova.playbackRate", duration, 0.1f);
			soundID = Util.PlaySound(JellyNova.chargingSoundString, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)JellyNova.chargingEffectPrefab))
			{
				chargeEffect = Object.Instantiate<GameObject>(JellyNova.chargingEffectPrefab, ((EntityState)this).transform.position, ((EntityState)this).transform.rotation);
				chargeEffect.transform.parent = ((EntityState)this).transform;
				chargeEffect.transform.localScale = Vector3.one * novaRadius;
				chargeEffect.GetComponent<ScaleParticleSystemDuration>().newDuration = duration;
			}
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				printController = ((Component)modelTransform).GetComponent<PrintController>();
				if (Object.op_Implicit((Object)(object)printController))
				{
					((Behaviour)printController).enabled = true;
					printController.printTime = duration;
				}
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)chargeEffect))
			{
				EntityState.Destroy((Object)(object)chargeEffect);
			}
			if (Object.op_Implicit((Object)(object)printController))
			{
				((Behaviour)printController).enabled = false;
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= duration && ((EntityState)this).isAuthority && !hasExploded)
			{
				Detonate();
			}
		}

		private void Detonate()
		{
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: 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_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Expected O, but got Unknown
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			hasExploded = true;
			Util.PlaySound(JellyNova.novaSoundString, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator))
			{
				if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator.modelBaseTransform))
				{
					EntityState.Destroy((Object)(object)((Component)((EntityState)this).modelLocator.modelBaseTransform).gameObject);
				}
				if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator.modelTransform))
				{
					EntityState.Destroy((Object)(object)((Component)((EntityState)this).modelLocator.modelTransform).gameObject);
				}
			}
			if (Object.op_Implicit((Object)(object)chargeEffect))
			{
				EntityState.Destroy((Object)(object)chargeEffect);
			}
			if (Object.op_Implicit((Object)(object)JellyNova.novaEffectPrefab))
			{
				EffectManager.SpawnEffect(JellyNova.novaEffectPrefab, new EffectData
				{
					origin = ((EntityState)this).transform.position,
					scale = novaRadius
				}, true);
			}
			new BlastAttack
			{
				attacker = ((EntityState)this).gameObject,
				inflictor = ((EntityState)this).gameObject,
				teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject),
				baseDamage = base.damageStat * JellyNova.novaDamageCoefficient,
				baseForce = novaForce,
				position = ((EntityState)this).transform.position,
				radius = novaRadius,
				procCoefficient = 2f,
				attackerFiltering = (AttackerFiltering)2,
				damageType = DamageTypeCombo.op_Implicit((DamageType)4194304)
			}.Fire();
			if (Object.op_Implicit((Object)(object)((EntityState)this).healthComponent))
			{
				((EntityState)this).healthComponent.Suicide((GameObject)null, (GameObject)null, DamageTypeCombo.op_Implicit((DamageType)0));
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)3;
		}
	}
}
namespace EntityStates.GolemMonster.Rush
{
	public class GolemBlink : BaseState
	{
		private Transform modelTransform;

		private float stopwatch;

		private Vector3 blinkDestination = Vector3.zero;

		private Vector3 blinkStart = Vector3.zero;

		private CharacterModel characterModel;

		private HurtBoxGroup hurtboxGroup;

		public override void OnEnter()
		{
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: 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_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: 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_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			Util.PlaySound(LoomingPresence.beginSoundString, ((EntityState)this).gameObject);
			modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				characterModel = ((Component)modelTransform).GetComponent<CharacterModel>();
				hurtboxGroup = ((Component)modelTransform).GetComponent<HurtBoxGroup>();
			}
			if (Object.op_Implicit((Object)(object)characterModel))
			{
				CharacterModel obj = characterModel;
				obj.invisibilityCount++;
			}
			if (Object.op_Implicit((Object)(object)hurtboxGroup))
			{
				HurtBoxGroup obj2 = hurtboxGroup;
				int hurtBoxesDeactivatorCounter = obj2.hurtBoxesDeactivatorCounter + 1;
				obj2.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((Behaviour)((EntityState)this).characterMotor).enabled = false;
			}
			if (((EntityState)this).isAuthority)
			{
				Vector3 val = ((EntityState)this).inputBank.aimDirection * LoomingPresence.blinkDistance;
				blinkDestination = ((EntityState)this).transform.position;
				blinkStart = ((EntityState)this).transform.position;
				NodeGraph groundNodes = SceneInfo.instance.groundNodes;
				NodeIndex val2 = groundNodes.FindClosestNode(((EntityState)this).transform.position + val, ((EntityState)this).characterBody.hullClassification, float.PositiveInfinity);
				groundNodes.GetNodePosition(val2, ref blinkDestination);
				blinkDestination += ((EntityState)this).transform.position - ((EntityState)this).characterBody.footPosition;
				val = blinkDestination - blinkStart;
				CreateBlinkEffect(Util.GetCorePosition(((EntityState)this).gameObject), val);
			}
		}

		private void CreateBlinkEffect(Vector3 origin, Vector3 direction)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			EffectData val = new EffectData();
			val.rotation = Util.QuaternionSafeLookRotation(direction);
			val.origin = origin;
			EffectManager.SpawnEffect(LoomingPresence.blinkPrefab, val, true);
		}

		private void SetPosition(Vector3 newPosition)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.SetPositionAndRotation(newPosition, Quaternion.identity, true);
			}
		}

		public override void FixedUpdate()
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: 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)
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterMotor.velocity = Vector3.zero;
			}
			SetPosition(Vector3.Lerp(blinkStart, blinkDestination, stopwatch / LoomingPresence.duration));
			if (stopwatch >= LoomingPresence.duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			//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_0039: Unknown result type (might be due to invalid IL or missing references)
			Util.PlaySound(LoomingPresence.endSoundString, ((EntityState)this).gameObject);
			modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				CharacterDirection characterDirection = ((EntityState)this).characterDirection;
				Ray aimRay = ((BaseState)this).GetAimRay();
				characterDirection.forward = ((Ray)(ref aimRay)).direction;
			}
			if (Object.op_Implicit((Object)(object)modelTransform) && Object.op_Implicit((Object)(object)LoomingPresence.destealthMaterial))
			{
				TemporaryOverlay obj = ((Component)modelTransform).gameObject.AddComponent<TemporaryOverlay>();
				obj.duration = LoomingPresence.destealthDuration;
				obj.destroyComponentOnEnd = true;
				obj.originalMaterial = LoomingPresence.destealthMaterial;
				obj.inspectorCharacterModel = ((Component)modelTransform).gameObject.GetComponent<CharacterModel>();
				obj.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
				obj.animateShaderAlpha = true;
			}
			if (Object.op_Implicit((Object)(object)characterModel))
			{
				CharacterModel obj2 = characterModel;
				obj2.invisibilityCount--;
			}
			if (Object.op_Implicit((Object)(object)hurtboxGroup))
			{
				HurtBoxGroup obj3 = hurtboxGroup;
				int hurtBoxesDeactivatorCounter = obj3.hurtBoxesDeactivatorCounter - 1;
				obj3.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((Behaviour)((EntityState)this).characterMotor).enabled = true;
			}
			((EntityState)this).OnExit();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
}
namespace EntityStates.BeetleMonster.Toxic
{
	public class ToxicHeadbutt : BaseState
	{
		public static float explosionRadius = 2f;

		public static float damageCoefficent = 0.8f;

		public static GameObject crocoEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Croco/CrocoLeapExplosion.prefab").WaitForCompletion();

		private OverlapAttack attack;

		private Animator modelAnimator;

		private RootMotionAccumulator rootMotionAccumulator;

		private float duration;

		private bool hasExploded;

		public override void OnEnter()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			rootMotionAccumulator = ((EntityState)this).GetModelRootMotionAccumulator();
			modelAnimator = ((EntityState)this).GetModelAnimator();
			duration = HeadbuttState.baseDuration / base.attackSpeedStat;
			attack = new OverlapAttack();
			attack.attacker = ((EntityState)this).gameObject;
			attack.inflictor = ((EntityState)this).gameObject;
			attack.teamIndex = TeamComponent.GetObjectTeam(attack.attacker);
			attack.damage = HeadbuttState.damageCoefficient * base.damageStat;
			attack.hitEffectPrefab = HeadbuttState.hitEffectPrefab;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				attack.hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Headbutt");
			}
			Util.PlaySound(HeadbuttState.attackSoundString, ((EntityState)this).gameObject);
			((EntityState)this).PlayCrossfade("Body", "Headbutt", "Headbutt.playbackRate", duration, 0.1f);
		}

		public override void FixedUpdate()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//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)
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)rootMotionAccumulator))
			{
				Vector3 val = rootMotionAccumulator.ExtractRootMotion();
				if (val != Vector3.zero && ((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					CharacterMotor characterMotor = ((EntityState)this).characterMotor;
					characterMotor.rootMotion += val;
				}
			}
			if (((EntityState)this).isAuthority)
			{
				attack.forceVector = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? (((EntityState)this).characterDirection.forward * HeadbuttState.forceMagnitude) : Vector3.zero);
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) && Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
				{
					((EntityState)this).characterDirection.moveVector = ((EntityState)this).inputBank.aimDirection;
				}
				if (Object.op_Implicit((Object)(object)modelAnimator) && modelAnimator.GetFloat("Headbutt.hitBoxActive") > 0.5f)
				{
					Detonate();
				}
			}
		}

		private void Detonate()
		{
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: 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)
			//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_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Expected O, but got Unknown
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			if (hasExploded)
			{
				return;
			}
			hasExploded = true;
			if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator))
			{
				if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator.modelBaseTransform))
				{
					EntityState.Destroy((Object)(object)((Component)((EntityState)this).modelLocator.modelBaseTransform).gameObject);
				}
				if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator.modelTransform))
				{
					EntityState.Destroy((Object)(object)((Component)((EntityState)this).modelLocator.modelTransform).gameObject);
				}
			}
			new BlastAttack
			{
				attacker = ((EntityState)this).gameObject,
				inflictor = ((EntityState)this).gameObject,
				teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject),
				baseDamage = base.damageStat * damageCoefficent,
				baseForce = 0f,
				position = ((EntityState)this).transform.position,
				radius = explosionRadius,
				procCoefficient = 2f,
				attackerFiltering = (AttackerFiltering)2,
				damageType = DamageTypeCombo.op_Implicit((DamageType)4096)
			}.Fire();
			Vector3 footPosition = ((EntityState)this).characterBody.footPosition;
			FireProjectileInfo val = default(FireProjectileInfo);
			val.projectilePrefab = BaseLeap.projectilePrefab;
			val.crit = ((BaseState)this).RollCrit();
			val.force = 0f;
			val.damage = base.damageStat;
			val.owner = ((EntityState)this).gameObject;
			val.rotation = Quaternion.identity;
			val.position = footPosition;
			FireProjectileInfo val2 = val;
			ProjectileManager.instance.FireProjectile(val2);
			EffectManager.SpawnEffect(crocoEffect, new EffectData
			{
				origin = footPosition,
				scale = explosionRadius
			}, true);
			if (Object.op_Implicit((Object)(object)((EntityState)this).healthComponent))
			{
				((EntityState)this).healthComponent.Suicide((GameObject)null, (GameObject)null, DamageTypeCombo.op_Implicit((DamageType)0));
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
}
namespace EntityStates.BeetleMonster.Battle
{
	public class HeavyHeadbutt : BaseState
	{
		public static float pushForce = 8000f;

		private OverlapAttack attack;

		private Animator modelAnimator;

		private RootMotionAccumulator rootMotionAccumulator;

		private float duration;

		public override void OnEnter()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			rootMotionAccumulator = ((EntityState)this).GetModelRootMotionAccumulator();
			modelAnimator = ((EntityState)this).GetModelAnimator();
			duration = HeadbuttState.baseDuration / base.attackSpeedStat;
			attack = new OverlapAttack();
			attack.attacker = ((EntityState)this).gameObject;
			attack.inflictor = ((EntityState)this).gameObject;
			attack.teamIndex = TeamComponent.GetObjectTeam(attack.attacker);
			attack.damage = HeadbuttState.damageCoefficient * base.damageStat;
			attack.hitEffectPrefab = HeadbuttState.hitEffectPrefab;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				attack.hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Headbutt");
			}
			Util.PlaySound(HeadbuttState.attackSoundString, ((EntityState)this).gameObject);
			((EntityState)this).PlayCrossfade("Body", "Headbutt", "Headbutt.playbackRate", duration, 0.1f);
		}

		public override void FixedUpdate()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//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)
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)rootMotionAccumulator))
			{
				Vector3 val = rootMotionAccumulator.ExtractRootMotion();
				if (val != Vector3.zero && ((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					CharacterMotor characterMotor = ((EntityState)this).characterMotor;
					characterMotor.rootMotion += val;
				}
			}
			if (((EntityState)this).isAuthority)
			{
				attack.forceVector = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? (((EntityState)this).characterDirection.forward * pushForce) : Vector3.zero);
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) && Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
				{
					((EntityState)this).characterDirection.moveVector = ((EntityState)this).inputBank.aimDirection;
				}
				if (Object.op_Implicit((Object)(object)modelAnimator) && modelAnimator.GetFloat("Headbutt.hitBoxActive") > 0.5f)
				{
					attack.Fire((List<HurtBox>)null);
				}
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
}
namespace TO30
{
	public static class TO30Assets
	{
		private const string ASSET_BUNDLE_NAME = "to30assets";

		private const string LOADING_SCREEN_SPRITES = "to30loadingscreen";

		private const string ASSET_BUNDLE_FOLDER_NAME = "assetbundles";

		public static ResourceAvailability assetsAvailability;

		private static AssetBundle _assetBundle;

		private static string assetBundleFolderPath => Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)TO30Main.instance).Info.Location), "assetbundles");

		public static TAsset LoadAsset<TAsset>(string name) where TAsset : Object
		{
			return _assetBundle.LoadAsset<TAsset>(name);
		}

		public static TO30AssetRequest<TAsset> LoadAssetAsync<TAsset>(string name) where TAsset : Object
		{
			return new TO30AssetRequest<TAsset>(_assetBundle.LoadAssetAsync(name));
		}

		public static TAsset[] LoadAssets<TAsset>() where TAsset : Object
		{
			return _assetBundle.LoadAllAssets<TAsset>();
		}

		public static TO30AssetRequest<TAsset> LoadAssetsAsync<TAsset>() where TAsset : Object
		{
			return new TO30AssetRequest<TAsset>(_assetBundle.LoadAllAssetsAsync<TAsset>());
		}

		internal static AssetBundle GetLoadingScreenBundle()
		{
			return AssetBundle.LoadFromFile(Path.Combine(assetBundleFolderPath, "to30loadingscreen"));
		}

		internal static IEnumerator Initialize()
		{
			if (!((ResourceAvailability)(ref assetsAvailability)).available)
			{
				TO30Log.Info("Initializing Assets...", 56, "Initialize");
				IEnumerator loadRoutine = LoadAssetBundle();
				while (!MSUtil.IsDone(loadRoutine))
				{
					yield return null;
				}
				ParallelCoroutine coroutine = new ParallelCoroutine();
				coroutine.Add(SwapShaders());
				coroutine.Add(SwapAddressableShaders());
				coroutine.Add(FinishMaterialVariants());
				while (!coroutine.isDone)
				{
					yield return null;
				}
				((ResourceAvailability)(ref assetsAvailability)).MakeAvailable();
			}
		}

		private static IEnumerator LoadAssetBundle()
		{
			AssetBundleCreateRequest request = AssetBundle.LoadFromFileAsync(Path.Combine(assetBundleFolderPath, "to30assets"));
			while (!((AsyncOperation)request).isDone)
			{
				yield return null;
			}
			_assetBundle = request.assetBundle;
		}

		private static IEnumerator FinishMaterialVariants()
		{
			TO30AssetRequest<MaterialVariant> request = TO30Assets.LoadAssetsAsync<MaterialVariant>();
			while (!request.isDone)
			{
				yield return null;
			}
			ParallelCoroutine routine = new ParallelCoroutine();
			MaterialVariant[] assets = request.assets;
			foreach (MaterialVariant val in assets)
			{
				routine.Add(val.ApplyOverrides());
			}
			while (!MSUtil.IsDone((IEnumerator)routine))
			{
				yield return null;
			}
		}

		private static IEnumerator SwapShaders()
		{
			return ShaderUtil.SwapStubbedShadersAsync(_assetBundle);
		}

		private static IEnumerator SwapAddressableShaders()
		{
			return ShaderUtil.LoadAddressableMaterialShadersAsync(_assetBundle);
		}
	}
	public class TO30AssetRequest<TAsset> : IEnumerator where TAsset : Object
	{
		private AssetBundleRequest _request;

		public TAsset asset => (TAsset)(object)_request.asset;

		public TAsset[] assets => _request.allAssets.OfType<TAsset>().ToArray();

		public bool isDone => ((AsyncOperation)_request).isDone;

		public float progress => ((AsyncOperation)_request).progress;

		object IEnumerator.Current => _request.asset;

		internal TO30AssetRequest(AssetBundleRequest request)
		{
			_request = request;
		}

		bool IEnumerator.MoveNext()
		{
			return !((AsyncOperation)_request).isDone;
		}

		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}
	public class TO30Config
	{
		public const string PREFIX = "TO30.";

		internal static ConfigFactory configFactory { get; private set; }

		internal TO30Config(BaseUnityPlugin plugin)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			configFactory = new ConfigFactory(plugin);
		}
	}
	public class TO30Content : IContentPackProvider
	{
		internal static ParallelCoroutine _parallelPreLoadDispatchers;

		private static Func<IEnumerator>[] _loadDispatchers;

		internal static ParallelCoroutine _parallelPostLoadDispatchers;

		private static Action[] _fieldAssignDispatchers;

		private bool _initialized;

		private static VariantPackDef _variantPack;

		public string identifier => "com.Nebby.TO30";

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

		internal static ContentPack contentPack { get; }

		public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
		{
			if (_initialized)
			{
				yield break;
			}
			IEnumerator enumerator2 = TO30Assets.Initialize();
			while (!MSUtil.IsDone(enumerator2))
			{
				yield return null;
			}
			while (!_parallelPreLoadDispatchers.isDone)
			{
				yield return null;
			}
			for (int i = 0; i < _loadDispatchers.Length; i++)
			{
				args.ReportProgress(Util.Remap((float)(i + 1), 0f, (float)_loadDispatchers.Length, 0.1f, 0.2f));
				enumerator2 = _loadDispatchers[i]();
				while (enumerator2?.MoveNext() ?? false)
				{
					yield return null;
				}
			}
			while (!_parallelPostLoadDispatchers.isDone)
			{
				yield return null;
			}
			for (int j = 0; j < _fieldAssignDispatchers.Length; j++)
			{
				args.ReportProgress(Util.Remap((float)(j + 1), 0f, (float)_fieldAssignDispatchers.Length, 0.95f, 0.99f));
				_fieldAssignDispatchers[j]();
			}
		}

		public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args)
		{
			ContentPack.Copy(contentPack, args.output);
			args.ReportProgress(1f);
			yield return null;
		}

		public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
		{
			args.ReportProgress(1f);
			yield break;
		}

		private static IEnumerator PopulateContentPackWithAssetCollection()
		{
			TO30AssetRequest<AssetCollection> request = TO30Assets.LoadAssetAsync<AssetCollection>("acContentPack");
			while (!request.isDone)
			{
				yield return null;
			}
			ContentUtil.AddContentFromAssetCollection(contentPack, request.asset);
		}

		private static IEnumerator AddVariantPack()
		{
			TO30Log.Info("Adding Variants", 93, "AddVariantPack");
			TO30AssetRequest<VariantPackDef> variantPackRequest = TO30Assets.LoadAssetAsync<VariantPackDef>("TO30VariantPack");
			TO30AssetRequest<VariantDef> variantDefsRequest = TO30Assets.LoadAssetsAsync<VariantDef>();
			ParallelCoroutine coroutine = new ParallelCoroutine();
			coroutine.Add((IEnumerator)variantPackRequest);
			coroutine.Add((IEnumerator)variantDefsRequest);
			while (!MSUtil.IsDone((IEnumerator)coroutine))
			{
				yield return null;
			}
			_variantPack = variantPackRequest.asset;
			_variantPack.variants = variantDefsRequest.assets;
			VariantPackCatalog.AddVariantPack(_variantPack, ((BaseUnityPlugin)TO30Main.instance).Config);
		}

		private static IEnumerator AddStates()
		{
			TO30Log.Info("Adding EntityStates", 112, "AddStates");
			yield return null;
			contentPack.entityStateTypes.Add((from t in typeof(TO30Content).Assembly.GetTypes()
				where t.IsSubclassOf(typeof(EntityState)) && !t.IsAbstract
				select t).ToArray());
		}

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

		internal TO30Content()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(AddSelf);
			((ResourceAvailability)(ref TO30Assets.assetsAvailability)).CallWhenAvailable((Action)delegate
			{
				_parallelPostLoadDispatchers.Add((IEnumerator)AsyncAssetLoadAttribute.CreateParallelCoroutineForMod((BaseUnityPlugin)(object)TO30Main.instance));
			});
		}

		static TO30Content()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Expected O, but got Unknown
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			contentPack = new ContentPack();
			_parallelPreLoadDispatchers = new ParallelCoroutine();
			_parallelPostLoadDispatchers = new ParallelCoroutine();
			_fieldAssignDispatchers = Array.Empty<Action>();
			_loadDispatchers = new Func<IEnumerator>[4]
			{
				() => LanguageFileLoader.AddLanguageFilesFromModAsync((BaseUnityPlugin)(object)TO30Main.instance, "languages"),
				PopulateContentPackWithAssetCollection,
				AddStates,
				AddVariantPack
			};
		}
	}
	internal class TO30Log
	{
		private static ManualLogSource logger;

		public static void Fatal(object data, [CallerLineNumber] int i = 0, [CallerMemberName] string member = "")
		{
			Log((LogLevel)1, data, i, member);
		}

		public static void Error(object data, [CallerLineNumber] int i = 0, [CallerMemberName] string member = "")
		{
			Log((LogLevel)2, data, i, member);
		}

		public static void Warning(object data, [CallerLineNumber] int i = 0, [CallerMemberName] string member = "")
		{
			Log((LogLevel)4, data, i, member);
		}

		public static void Message(object data, [CallerLineNumber] int i = 0, [CallerMemberName] string member = "")
		{
			Log((LogLevel)8, data, i, member);
		}

		public static void Info(object data, [CallerLineNumber] int i = 0, [CallerMemberName] string member = "")
		{
			Log((LogLevel)16, data, i, member);
		}

		public static void Debug(object data, [CallerLineNumber] int i = 0, [CallerMemberName] string member = "")
		{
			Log((LogLevel)32, data, i, member);
		}

		private static void Log(LogLevel level, object data, int i, string member)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			LogRuntime(level, data, i, member);
		}

		private static void LogEditor(LogLevel level, object data, int i, string member)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Invalid comparison between Unknown and I4
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Invalid comparison between Unknown and I4
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Invalid comparison between Unknown and I4
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Invalid comparison between Unknown and I4
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Invalid comparison between Unknown and I4
			if ((int)level <= 4)
			{
				if (level - 1 > 1)
				{
					if ((int)level == 4)
					{
						Debug.LogWarning((object)Format(data, i, member));
					}
				}
				else
				{
					Debug.LogError((object)Format(data, i, member));
				}
			}
			else if ((int)level == 8 || (int)level == 16 || (int)level == 32)
			{
				Debug.Log((object)Format(data, i, member));
			}
		}

		private static void LogRuntime(LogLevel level, object data, int i, string member)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			object obj = ((((Enum)level).HasFlag((Enum)(object)(LogLevel)4) || ((Enum)level).HasFlag((Enum)(object)(LogLevel)2) || ((Enum)level).HasFlag((Enum)(object)(LogLevel)1)) ? Format(data, i, member) : data);
			logger.Log(level, obj);
		}

		public static string Format(object data, int i, string member)
		{
			return $"{data} | Line={i} : Member={member}";
		}

		internal TO30Log(ManualLogSource logger_)
		{
			logger = logger_;
		}
	}
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.Nebby.TO30", "The Original 30", "2.1.0")]
	public class TO30Main : BaseUnityPlugin
	{
		public const string GUID = "com.Nebby.TO30";

		public const string MODNAME = "The Original 30";

		public const string VERSION = "2.1.0";

		public static TO30Main instance { get; private set; }

		private void Awake()
		{
			instance = this;
			new TO30Log(((BaseUnityPlugin)this).Logger);
			new TO30Config((BaseUnityPlugin)(object)this);
			new TO30Content();
			LoadingScreenSpriteUtility.AddSpriteAnimations(TO30Assets.GetLoadingScreenBundle());
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(AddSpectralSummons));
		}

		private void AddSpectralSummons()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			SpawnRandomLesserEnemyVariant.validMasters.AddRange(new List<MasterIndex>
			{
				MasterCatalog.FindMasterIndex("BeetleMaster"),
				MasterCatalog.FindMasterIndex("ImpMaster"),
				MasterCatalog.FindMasterIndex("LemurianMaster"),
				MasterCatalog.FindMasterIndex("WispMaster")
			});
		}
	}
}
namespace TO30.Components
{
	public class AddGunToVulture : VariantComponent
	{
		private static GameObject _gun;

		private CharacterModel _model;

		private ChildLocator _childLocator;

		[AsyncAssetLoad]
		private static IEnumerator Load()
		{
			TO30AssetRequest<GameObject> numerator = TO30Assets.LoadAssetAsync<GameObject>("VulturePistol");
			while (!numerator.isDone)
			{
				yield return null;
			}
			_gun = numerator.asset;
		}

		private void Start()
		{
			_childLocator = ((Component)this).GetComponentInChildren<ChildLocator>();
			AddGun();
			Object.Destroy((Object)(object)this);
		}

		private void AddGun()
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((VariantComponent)this).characterModel))
			{
				GameObject obj = Object.Instantiate<GameObject>(_gun, _childLocator.FindChild("Head"));
				obj.transform.localPosition = new Vector3(0f, 3.5f, 0.5f);
				obj.transform.localRotation = Quaternion.Euler(new Vector3(0f, 90f, 180f));
				obj.transform.localScale = Vector3.one * 16f;
			}
		}
	}
	public class AddMissileLauncherToLemurian : VariantComponent
	{
		private static GameObject fab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/CommandMissile/DisplayMissileRack.prefab").WaitForCompletion();

		private CharacterModel model;

		private ChildLocator childLocator;

		private void Start()
		{
			model = ((Component)this).GetComponentInChildren<CharacterModel>();
			childLocator = ((Component)this).GetComponentInChildren<ChildLocator>();
			AddMissileLauncher();
			Object.Destroy((Object)(object)this);
		}

		private void AddMissileLauncher()
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)model))
			{
				GameObject obj = Object.Instantiate<GameObject>(fab, childLocator.FindChild("Chest"));
				obj.transform.localPosition = new Vector3(0f, 0f, 1.75f);
				obj.transform.localRotation = Quaternion.Euler(new Vector3(90f, 0f, 0f));
				obj.transform.localScale = Vector3.one * 8f;
			}
		}
	}
	public class ModifyPrintController : VariantComponent
	{
		private void Start()
		{
			PrintController component = ((Component)((VariantComponent)this).characterModel).GetComponent<PrintController>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.printTime = 25f;
				component.maxPrintHeight = 100f;
			}
			Object.Destroy((Object)(object)this);
		}
	}
}