Decompiled source of League of Legends Items v2.0.0

LOLItems.dll

Decompiled 19 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using Alexandria.BreakableAPI;
using Alexandria.DungeonAPI;
using Alexandria.ItemAPI;
using Alexandria.Misc;
using Alexandria.NPCAPI;
using Alexandria.SoundAPI;
using Alexandria.VisualAPI;
using BepInEx;
using Dungeonator;
using Gungeon;
using HarmonyLib;
using InControl;
using LOLItems;
using LOLItems.active_items;
using LOLItems.custom_class_data;
using LOLItems.guon_stones;
using LOLItems.passive_items;
using LOLItems.weapons;
using LootTableAPI;
using Microsoft.CodeAnalysis;
using UnityEngine;
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: AssemblyTitle("Mod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Mod")]
[assembly: AssemblyCopyright("Copyright ©  2020")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("d6d7a494-722e-4763-959b-c2d6b6a42b01")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public class CustomLightningChainEnemiesModifierAOE : BraveBehaviour
{
	[CompilerGenerated]
	private sealed class <HandleDamageCooldown>d__28 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public AIActor damagedTarget;

		public CustomLightningChainEnemiesModifierAOE <>4__this;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <HandleDamageCooldown>d__28(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>4__this.m_damagedEnemies.Add(damagedTarget);
				<>2__current = (object)new WaitForSeconds(<>4__this.damageCooldown);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<>4__this.m_damagedEnemies.Remove(damagedTarget);
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	public GameObject LinkVFXPrefab;

	public CoreDamageTypes damageTypes;

	public bool RequiresSameProjectileClass;

	public float maximumLinkDistance;

	public bool usesStaticDamageStat = true;

	public float damagePerHit;

	public float damageScale;

	public float damageCooldown = 0.1f;

	public List<string> sfxPath = new List<string>();

	[NonSerialized]
	public bool DamagesEnemies = true;

	[NonSerialized]
	public bool PlaysSFX = true;

	[Header("Dispersal")]
	public bool UsesDispersalParticles;

	[ShowInInspectorIf("UsesDispersalParticles", false)]
	public float DispersalDensity = 3f;

	[ShowInInspectorIf("UsesDispersalParticles", false)]
	public float DispersalMinCoherency = 0.2f;

	[ShowInInspectorIf("UsesDispersalParticles", false)]
	public float DispersalMaxCoherency = 1f;

	[ShowInInspectorIf("UsesDispersalParticles", false)]
	public GameObject DispersalParticleSystemPrefab;

	private Projectile m_frameLinkProjectile;

	private tk2dTiledSprite m_extantLink;

	private bool m_hasSetBlackBullet;

	private ParticleSystem m_dispersalParticles;

	private HashSet<AIActor> m_damagedEnemies = new HashSet<AIActor>();

	private void Start()
	{
		if ((Object)(object)((BraveBehaviour)this).projectile != (Object)null)
		{
			Projectile projectile = ((BraveBehaviour)this).projectile;
			projectile.OnHitEnemy = (Action<Projectile, SpeculativeRigidbody, bool>)Delegate.Combine(projectile.OnHitEnemy, new Action<Projectile, SpeculativeRigidbody, bool>(HandleHitEnemy));
		}
	}

	private void HandleHitEnemy(Projectile proj, SpeculativeRigidbody enemyRigidbody, bool fatal)
	{
		if (!((Object)(object)enemyRigidbody == (Object)null) && !((Object)(object)((BraveBehaviour)enemyRigidbody).aiActor == (Object)null))
		{
			AIActor aiActor = ((BraveBehaviour)enemyRigidbody).aiActor;
			List<AIActor> list = ChainEnemies(aiActor);
			if (PlaysSFX)
			{
				HelpfulMethods.PlayRandomSFX(((Component)aiActor).gameObject, sfxPath);
			}
			if (!usesStaticDamageStat)
			{
				damagePerHit = proj.baseData.damage * damageScale;
			}
			if (list.Count > 0)
			{
				UpdateLinkChain(list);
			}
		}
	}

	public void updateSFXList(string[] newSFXList)
	{
		foreach (string item in newSFXList)
		{
			sfxPath.Add(item);
		}
	}

	public override void OnDestroy()
	{
		ClearLink();
		((BraveBehaviour)this).OnDestroy();
	}

	private void Update()
	{
		m_frameLinkProjectile = null;
	}

	private void UpdateLinkChain(List<AIActor> chain)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0052: 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_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: 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_0065: 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_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: 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_00fa: 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)
		Vector2 unitCenter = ((BraveBehaviour)((BraveBehaviour)this).projectile).specRigidbody.UnitCenter;
		foreach (AIActor item in chain)
		{
			Vector2 unitCenter2 = ((BraveBehaviour)item).specRigidbody.UnitCenter;
			GameObject val = SpawnManager.SpawnVFX(LinkVFXPrefab, true);
			tk2dTiledSprite component = val.GetComponent<tk2dTiledSprite>();
			((BraveBehaviour)component).transform.position = Vector2.op_Implicit(unitCenter);
			Vector2 val2 = unitCenter2 - unitCenter;
			float num = BraveMathCollege.Atan2Degrees(((Vector2)(ref val2)).normalized);
			int num2 = Mathf.RoundToInt(((Vector2)(ref val2)).magnitude / 0.0625f);
			component.dimensions = new Vector2((float)num2, component.dimensions.y);
			((BraveBehaviour)component).transform.rotation = Quaternion.Euler(0f, 0f, num);
			((tk2dBaseSprite)component).UpdateZDepth();
			Object.Destroy((Object)(object)val, 0.25f);
			if (!m_damagedEnemies.Contains(item))
			{
				((BraveBehaviour)item).healthHaver.ApplyDamage(damagePerHit, Vector2.zero, "Cultivation of Spirit", damageTypes, (DamageCategory)0, false, (PixelCollider)null, false);
				if (!UsesDispersalParticles)
				{
				}
			}
		}
	}

	private void DoDispersalParticles(Vector2 posStart, Vector2 posEnd)
	{
		//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_0018: Invalid comparison between Unknown and I4
		//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_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: 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_0089: 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_008d: 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_0097: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: 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_00fa: 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_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: 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_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0166: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: Unknown result type (might be due to invalid IL or missing references)
		//IL_0170: Unknown result type (might be due to invalid IL or missing references)
		if ((int)GameManager.Options.ShaderQuality != 0 && (int)GameManager.Options.ShaderQuality != 3)
		{
			if (!Object.op_Implicit((Object)(object)m_dispersalParticles))
			{
				m_dispersalParticles = GlobalDispersalParticleManager.GetSystemForPrefab(DispersalParticleSystemPrefab);
			}
			int num = Mathf.Max(Mathf.CeilToInt(Vector2.Distance(posStart, posEnd) * DispersalDensity), 1);
			for (int i = 0; i < num; i++)
			{
				float num2 = (float)i / (float)num;
				Vector3 val = Vector3.Lerp(Vector2.op_Implicit(posStart), Vector2.op_Implicit(posEnd), num2);
				val += Vector3.back;
				float num3 = Mathf.PerlinNoise(val.x / 3f, val.y / 3f);
				Vector3 val2 = Quaternion.Euler(0f, 0f, num3 * 360f) * Vector3.right;
				Vector3 val3 = Vector3.Lerp(val2, Random.insideUnitSphere, Random.Range(DispersalMinCoherency, DispersalMaxCoherency));
				EmitParams val4 = default(EmitParams);
				((EmitParams)(ref val4)).position = val;
				((EmitParams)(ref val4)).velocity = val3 * m_dispersalParticles.startSpeed;
				((EmitParams)(ref val4)).startSize = m_dispersalParticles.startSize;
				((EmitParams)(ref val4)).startLifetime = m_dispersalParticles.startLifetime;
				((EmitParams)(ref val4)).startColor = Color32.op_Implicit(m_dispersalParticles.startColor);
				EmitParams val5 = val4;
				m_dispersalParticles.Emit(val5, 1);
			}
		}
	}

	private IEnumerator HandleDamageCooldown(AIActor damagedTarget)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <HandleDamageCooldown>d__28(0)
		{
			<>4__this = this,
			damagedTarget = damagedTarget
		};
	}

	private void ClearLink()
	{
		if ((Object)(object)m_extantLink != (Object)null)
		{
			SpawnManager.Despawn(((Component)m_extantLink).gameObject);
			m_extantLink = null;
		}
	}

	private List<AIActor> ChainEnemies(AIActor firstEnemy)
	{
		//IL_007e: 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_0089: 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)
		List<AIActor> list = new List<AIActor>();
		float num = maximumLinkDistance * maximumLinkDistance;
		foreach (AIActor allEnemy in StaticReferenceManager.AllEnemies)
		{
			if (!((Object)(object)allEnemy == (Object)null) && Object.op_Implicit((Object)(object)((BraveBehaviour)allEnemy).healthHaver) && !((BraveBehaviour)allEnemy).healthHaver.IsDead && allEnemy.IsNormalEnemy && allEnemy.HasBeenEngaged && !((object)allEnemy).Equals((object?)firstEnemy))
			{
				Vector2 val = ((GameActor)allEnemy).CenterPosition - ((GameActor)firstEnemy).CenterPosition;
				float sqrMagnitude = ((Vector2)(ref val)).sqrMagnitude;
				if (sqrMagnitude < num)
				{
					list.Add(allEnemy);
				}
			}
		}
		return list;
	}
}
[Serializable]
public class GameActorCrippleEffect : GameActorEffect
{
	public float CrippleAmount;

	public float CrippleDuration;

	public bool ShouldVanishOnDeath(GameActor actor)
	{
		if (Object.op_Implicit((Object)(object)((BraveBehaviour)actor).healthHaver) && ((BraveBehaviour)actor).healthHaver.IsBoss)
		{
			return false;
		}
		if (actor is AIActor && ((AIActor)((actor is AIActor) ? actor : null)).IsSignatureEnemy)
		{
			return false;
		}
		return true;
	}

	public override void OnEffectApplied(GameActor actor, RuntimeGameActorEffectData effectData, float partialAmount = 1f)
	{
		if (Object.op_Implicit((Object)(object)((BraveBehaviour)actor).aiShooter))
		{
			((BraveBehaviour)actor).aiShooter.AimTimeScale = CrippleAmount;
		}
		if (Object.op_Implicit((Object)(object)((BraveBehaviour)actor).behaviorSpeculator))
		{
			((BraveBehaviour)actor).behaviorSpeculator.CooldownScale = CrippleAmount;
		}
		if (Object.op_Implicit((Object)(object)((BraveBehaviour)actor).bulletBank))
		{
			((BraveBehaviour)actor).bulletBank.TimeScale = CrippleAmount;
		}
	}

	public override void OnEffectRemoved(GameActor actor, RuntimeGameActorEffectData effectData)
	{
		if (Object.op_Implicit((Object)(object)((BraveBehaviour)actor).aiShooter))
		{
			((BraveBehaviour)actor).aiShooter.AimTimeScale = 1f;
		}
		if (Object.op_Implicit((Object)(object)((BraveBehaviour)actor).behaviorSpeculator))
		{
			((BraveBehaviour)actor).behaviorSpeculator.CooldownScale = 1f;
		}
		if (Object.op_Implicit((Object)(object)((BraveBehaviour)actor).bulletBank))
		{
			((BraveBehaviour)actor).bulletBank.TimeScale = 1f;
		}
		tk2dSpriteAnimator spriteAnimator = ((BraveBehaviour)actor).spriteAnimator;
		if (Object.op_Implicit((Object)(object)spriteAnimator) && Object.op_Implicit((Object)(object)((BraveBehaviour)actor).aiAnimator) && spriteAnimator.CurrentClip != null && !spriteAnimator.IsPlaying(spriteAnimator.CurrentClip))
		{
			((BraveBehaviour)actor).aiAnimator.PlayUntilFinished(((BraveBehaviour)actor).spriteAnimator.CurrentClip.name, false, (string)null, -1f, true);
		}
	}
}
public class OnPreDamagedPassiveItem : PassiveItem
{
	[CompilerGenerated]
	private sealed class <TriggerVisualEffect>d__13 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public PlayerController player;

		public OnPreDamagedPassiveItem <>4__this;

		private Material <mat>5__1;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <TriggerVisualEffect>d__13(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<mat>5__1 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Expected O, but got Unknown
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<mat>5__1 = SpriteOutlineManager.GetOutlineMaterial(((BraveBehaviour)((PassiveItem)<>4__this).Owner).sprite);
				if (<>4__this.triggersGlow && Object.op_Implicit((Object)(object)<mat>5__1))
				{
					<mat>5__1.SetColor("_OverrideColor", <>4__this.outlineColor);
				}
				<>2__current = (object)new WaitForSeconds(<>4__this.effectDuration);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				if (<>4__this.triggersGlow && Object.op_Implicit((Object)(object)<mat>5__1))
				{
					<mat>5__1.SetColor("_OverrideColor", new Color(0f, 0f, 0f));
				}
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	public float procChance = 0.1f;

	public bool triggerBlank = false;

	public bool playsSFX = false;

	public List<string> sfxPath = new List<string>();

	public bool triggersInvulnerability = false;

	public bool triggersOutline = false;

	public Color outlineColor = new Color(0f, 0f, 0f);

	public bool triggersGlow = false;

	public float effectDuration = 1f;

	public override void Pickup(PlayerController player)
	{
		if (!base.m_pickedUp)
		{
			((PassiveItem)this).Pickup(player);
			HealthHaver healthHaver = ((BraveBehaviour)player).healthHaver;
			healthHaver.ModifyDamage = (Action<HealthHaver, ModifyDamageEventArgs>)Delegate.Combine(healthHaver.ModifyDamage, new Action<HealthHaver, ModifyDamageEventArgs>(HandleEffect));
		}
	}

	public void updateSFXList(string[] newSFXList)
	{
		foreach (string item in newSFXList)
		{
			sfxPath.Add(item);
		}
	}

	public void setProcChance(float newProcChance)
	{
		procChance = newProcChance;
	}

	private void HandleEffect(HealthHaver source, ModifyDamageEventArgs args)
	{
		if (args == EventArgs.Empty || args.ModifiedDamage <= 0f || !source.IsVulnerable)
		{
			return;
		}
		float value = Random.value;
		if (value <= procChance && Object.op_Implicit((Object)(object)base.m_owner) && !((GameActor)base.m_owner).IsFalling)
		{
			if (playsSFX && sfxPath.Count > 0)
			{
				HelpfulMethods.PlayRandomSFX(((Component)((PassiveItem)this).Owner).gameObject, sfxPath);
			}
			if (triggersInvulnerability)
			{
				PlayerController component = ((Component)source).GetComponent<PlayerController>();
				source.TriggerInvulnerabilityPeriod(effectDuration);
			}
			if (triggerBlank)
			{
				base.m_owner.ForceBlank(25f, 0.5f, false, true, (Vector2?)null, true, -1f);
			}
			if (triggersOutline)
			{
				((MonoBehaviour)((PassiveItem)this).Owner).StartCoroutine(TriggerVisualEffect(((PassiveItem)this).Owner));
			}
			args.ModifiedDamage = 0f;
		}
	}

	private IEnumerator TriggerVisualEffect(PlayerController player)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <TriggerVisualEffect>d__13(0)
		{
			<>4__this = this,
			player = player
		};
	}

	public override DebrisObject Drop(PlayerController player)
	{
		DebrisObject val = ((PassiveItem)this).Drop(player);
		OnPreDamagedPassiveItem component = ((Component)val).GetComponent<OnPreDamagedPassiveItem>();
		HealthHaver healthHaver = ((BraveBehaviour)player).healthHaver;
		healthHaver.ModifyDamage = (Action<HealthHaver, ModifyDamageEventArgs>)Delegate.Remove(healthHaver.ModifyDamage, new Action<HealthHaver, ModifyDamageEventArgs>(HandleEffect));
		((PassiveItem)component).m_pickedUpThisRun = true;
		return val;
	}

	public override void OnDestroy()
	{
		if (Object.op_Implicit((Object)(object)base.m_owner))
		{
			HealthHaver healthHaver = ((BraveBehaviour)base.m_owner).healthHaver;
			healthHaver.ModifyDamage = (Action<HealthHaver, ModifyDamageEventArgs>)Delegate.Remove(healthHaver.ModifyDamage, new Action<HealthHaver, ModifyDamageEventArgs>(HandleEffect));
		}
		((PassiveItem)this).OnDestroy();
	}
}
public class CustomLightningChainEnemiesModifier : BraveBehaviour
{
	[CompilerGenerated]
	private sealed class <HandleDamageCooldown>d__27 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public AIActor damagedTarget;

		public CustomLightningChainEnemiesModifier <>4__this;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <HandleDamageCooldown>d__27(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>4__this.m_damagedEnemies.Add(damagedTarget);
				<>2__current = (object)new WaitForSeconds(<>4__this.damageCooldown);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<>4__this.m_damagedEnemies.Remove(damagedTarget);
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	public GameObject LinkVFXPrefab;

	public CoreDamageTypes damageTypes;

	public bool RequiresSameProjectileClass;

	public float maximumLinkDistance;

	public float damagePerHit;

	public float damageCooldown = 0.1f;

	public float maxLinkCount;

	public List<string> sfxPath = new List<string>();

	[NonSerialized]
	public bool DamagesEnemies = true;

	[NonSerialized]
	public bool PlaysSFX = true;

	[Header("Dispersal")]
	public bool UsesDispersalParticles;

	[ShowInInspectorIf("UsesDispersalParticles", false)]
	public float DispersalDensity = 3f;

	[ShowInInspectorIf("UsesDispersalParticles", false)]
	public float DispersalMinCoherency = 0.2f;

	[ShowInInspectorIf("UsesDispersalParticles", false)]
	public float DispersalMaxCoherency = 1f;

	[ShowInInspectorIf("UsesDispersalParticles", false)]
	public GameObject DispersalParticleSystemPrefab;

	private Projectile m_frameLinkProjectile;

	private tk2dTiledSprite m_extantLink;

	private bool m_hasSetBlackBullet;

	private ParticleSystem m_dispersalParticles;

	private HashSet<AIActor> m_damagedEnemies = new HashSet<AIActor>();

	private void Start()
	{
		if ((Object)(object)((BraveBehaviour)this).projectile != (Object)null)
		{
			Projectile projectile = ((BraveBehaviour)this).projectile;
			projectile.OnHitEnemy = (Action<Projectile, SpeculativeRigidbody, bool>)Delegate.Combine(projectile.OnHitEnemy, new Action<Projectile, SpeculativeRigidbody, bool>(HandleHitEnemy));
		}
	}

	private void HandleHitEnemy(Projectile proj, SpeculativeRigidbody enemyRigidbody, bool fatal)
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		if (!((Object)(object)enemyRigidbody == (Object)null) && !((Object)(object)((BraveBehaviour)enemyRigidbody).aiActor == (Object)null))
		{
			AIActor aiActor = ((BraveBehaviour)enemyRigidbody).aiActor;
			List<AIActor> list = ChainEnemies(((GameActor)aiActor).CenterPosition);
			if (PlaysSFX)
			{
				HelpfulMethods.PlayRandomSFX(((Component)aiActor).gameObject, sfxPath);
			}
			if (list.Count > 0)
			{
				UpdateLinkChain(list);
			}
		}
	}

	public void updateSFXList(string[] newSFXList)
	{
		foreach (string item in newSFXList)
		{
			sfxPath.Add(item);
		}
	}

	public override void OnDestroy()
	{
		ClearLink();
		((BraveBehaviour)this).OnDestroy();
	}

	private void Update()
	{
		m_frameLinkProjectile = null;
	}

	private void UpdateLinkChain(List<AIActor> chain)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0052: 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_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: 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_0065: 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_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: 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_0139: Unknown result type (might be due to invalid IL or missing references)
		//IL_013a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fa: 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_012f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0130: Unknown result type (might be due to invalid IL or missing references)
		Vector2 val = ((BraveBehaviour)((BraveBehaviour)this).projectile).specRigidbody.UnitCenter;
		foreach (AIActor item in chain)
		{
			Vector2 unitCenter = ((BraveBehaviour)item).specRigidbody.UnitCenter;
			GameObject val2 = SpawnManager.SpawnVFX(LinkVFXPrefab, true);
			tk2dTiledSprite component = val2.GetComponent<tk2dTiledSprite>();
			((BraveBehaviour)component).transform.position = Vector2.op_Implicit(val);
			Vector2 val3 = unitCenter - val;
			float num = BraveMathCollege.Atan2Degrees(((Vector2)(ref val3)).normalized);
			int num2 = Mathf.RoundToInt(((Vector2)(ref val3)).magnitude / 0.0625f);
			component.dimensions = new Vector2((float)num2, component.dimensions.y);
			((BraveBehaviour)component).transform.rotation = Quaternion.Euler(0f, 0f, num);
			((tk2dBaseSprite)component).UpdateZDepth();
			Object.Destroy((Object)(object)val2, 0.25f);
			if (!m_damagedEnemies.Contains(item))
			{
				((BraveBehaviour)item).healthHaver.ApplyDamage(damagePerHit, Vector2.zero, "Chain Lightning", damageTypes, (DamageCategory)0, false, (PixelCollider)null, false);
				m_damagedEnemies.Add(item);
				if (UsesDispersalParticles)
				{
					DoDispersalParticles(val, unitCenter);
				}
			}
			val = unitCenter;
		}
	}

	private void DoDispersalParticles(Vector2 posStart, Vector2 posEnd)
	{
		//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_0018: Invalid comparison between Unknown and I4
		//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_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: 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_0089: 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_008d: 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_0097: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: 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_00fa: 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_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: 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_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0166: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: Unknown result type (might be due to invalid IL or missing references)
		//IL_0170: Unknown result type (might be due to invalid IL or missing references)
		if ((int)GameManager.Options.ShaderQuality != 0 && (int)GameManager.Options.ShaderQuality != 3)
		{
			if (!Object.op_Implicit((Object)(object)m_dispersalParticles))
			{
				m_dispersalParticles = GlobalDispersalParticleManager.GetSystemForPrefab(DispersalParticleSystemPrefab);
			}
			int num = Mathf.Max(Mathf.CeilToInt(Vector2.Distance(posStart, posEnd) * DispersalDensity), 1);
			for (int i = 0; i < num; i++)
			{
				float num2 = (float)i / (float)num;
				Vector3 val = Vector3.Lerp(Vector2.op_Implicit(posStart), Vector2.op_Implicit(posEnd), num2);
				val += Vector3.back;
				float num3 = Mathf.PerlinNoise(val.x / 3f, val.y / 3f);
				Vector3 val2 = Quaternion.Euler(0f, 0f, num3 * 360f) * Vector3.right;
				Vector3 val3 = Vector3.Lerp(val2, Random.insideUnitSphere, Random.Range(DispersalMinCoherency, DispersalMaxCoherency));
				EmitParams val4 = default(EmitParams);
				((EmitParams)(ref val4)).position = val;
				((EmitParams)(ref val4)).velocity = val3 * m_dispersalParticles.startSpeed;
				((EmitParams)(ref val4)).startSize = m_dispersalParticles.startSize;
				((EmitParams)(ref val4)).startLifetime = m_dispersalParticles.startLifetime;
				((EmitParams)(ref val4)).startColor = Color32.op_Implicit(m_dispersalParticles.startColor);
				EmitParams val5 = val4;
				m_dispersalParticles.Emit(val5, 1);
			}
		}
	}

	private IEnumerator HandleDamageCooldown(AIActor damagedTarget)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <HandleDamageCooldown>d__27(0)
		{
			<>4__this = this,
			damagedTarget = damagedTarget
		};
	}

	private void ClearLink()
	{
		if ((Object)(object)m_extantLink != (Object)null)
		{
			SpawnManager.Despawn(((Component)m_extantLink).gameObject);
			m_extantLink = null;
		}
	}

	private List<AIActor> ChainEnemies(Vector2 startPos)
	{
		//IL_000d: 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_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_010d: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: 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)
		List<AIActor> list = new List<AIActor>();
		HashSet<AIActor> hashSet = new HashSet<AIActor>();
		Vector2 val = startPos;
		for (int i = 0; (float)i < maxLinkCount; i++)
		{
			AIActor val2 = null;
			float num = maximumLinkDistance * maximumLinkDistance;
			foreach (AIActor allEnemy in StaticReferenceManager.AllEnemies)
			{
				if (!((Object)(object)allEnemy == (Object)null) && Object.op_Implicit((Object)(object)((BraveBehaviour)allEnemy).healthHaver) && !((BraveBehaviour)allEnemy).healthHaver.IsDead && allEnemy.IsNormalEnemy && allEnemy.HasBeenEngaged && !hashSet.Contains(allEnemy))
				{
					Vector2 val3 = ((GameActor)allEnemy).CenterPosition - val;
					float sqrMagnitude = ((Vector2)(ref val3)).sqrMagnitude;
					if (sqrMagnitude < num)
					{
						val2 = allEnemy;
						num = sqrMagnitude;
					}
				}
			}
			if ((Object)(object)val2 != (Object)null)
			{
				list.Add(val2);
				hashSet.Add(val2);
				val = ((GameActor)val2).CenterPosition;
				continue;
			}
			break;
		}
		return list;
	}
}
namespace LootTableAPI
{
	internal static class LootTableTools
	{
		public static GenericLootTable CreateLootTable(List<GenericLootTable> includedLootTables = null, DungeonPrerequisite[] prerequisites = null)
		{
			//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_001d: Expected O, but got Unknown
			GenericLootTable val = ScriptableObject.CreateInstance<GenericLootTable>();
			val.defaultItemDrops = new WeightedGameObjectCollection
			{
				elements = new List<WeightedGameObject>()
			};
			if (prerequisites != null)
			{
				val.tablePrerequisites = prerequisites;
			}
			else
			{
				val.tablePrerequisites = (DungeonPrerequisite[])(object)new DungeonPrerequisite[0];
			}
			if (includedLootTables != null)
			{
				val.includedLootTables = includedLootTables;
			}
			else
			{
				val.includedLootTables = new List<GenericLootTable>();
			}
			return val;
		}

		public static void AddItemToPool(this GenericLootTable lootTable, PickupObject po, float weight = 1f)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Expected O, but got Unknown
			WeightedGameObjectCollection defaultItemDrops = lootTable.defaultItemDrops;
			WeightedGameObject val = new WeightedGameObject();
			val.pickupId = po.PickupObjectId;
			val.weight = weight;
			val.rawGameObject = ((Component)po).gameObject;
			val.forceDuplicatesPossible = false;
			val.additionalPrerequisites = (DungeonPrerequisite[])(object)new DungeonPrerequisite[0];
			defaultItemDrops.Add(val);
		}

		public static void AddItemToPool(this GenericLootTable lootTable, int poID, float weight = 1f)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			PickupObject byId = PickupObjectDatabase.GetById(poID);
			WeightedGameObjectCollection defaultItemDrops = lootTable.defaultItemDrops;
			WeightedGameObject val = new WeightedGameObject();
			val.pickupId = byId.PickupObjectId;
			val.weight = weight;
			val.rawGameObject = ((Component)byId).gameObject;
			val.forceDuplicatesPossible = false;
			val.additionalPrerequisites = (DungeonPrerequisite[])(object)new DungeonPrerequisite[0];
			defaultItemDrops.Add(val);
		}
	}
}
namespace LOLItems
{
	internal class debugItem : PlayerItem
	{
		[CompilerGenerated]
		private sealed class <EffectCoroutine>d__8 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public PlayerController player;

			public debugItem <>4__this;

			private tk2dBaseSprite <s>5__1;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <EffectCoroutine>d__8(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<s>5__1 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//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_0052: 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_006d: 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_0085: 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_00a5: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
				{
					<>1__state = -1;
					<s>5__1 = ((BraveBehaviour)<>4__this).sprite;
					GameUIRoot instance = GameUIRoot.Instance;
					Transform transform = ((BraveBehaviour)<s>5__1).transform;
					Bounds bounds = <s>5__1.GetBounds();
					float num = ((Bounds)(ref bounds)).max.x - 1f;
					bounds = <s>5__1.GetBounds();
					instance.RegisterDefaultLabel(transform, new Vector3(num, ((Bounds)(ref bounds)).min.y - 2f, 0f), "something message here");
					<>2__current = (object)new WaitForSeconds(5f);
					<>1__state = 1;
					return true;
				}
				case 1:
					<>1__state = -1;
					GameUIRoot.Instance.DeregisterDefaultLabel(((BraveBehaviour)<s>5__1).transform);
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public static int ID;

		private static List<string> VFXSpritePath = new List<string> { "LOLItems/Resources/vfxs/test_vfx/image (1)", "LOLItems/Resources/vfxs/test_vfx/image (2)", "LOLItems/Resources/vfxs/test_vfx/image (3)", "LOLItems/Resources/vfxs/test_vfx/image (4)", "LOLItems/Resources/vfxs/test_vfx/image (5)", "LOLItems/Resources/vfxs/test_vfx/image (6)", "LOLItems/Resources/vfxs/test_vfx/image (7)", "LOLItems/Resources/vfxs/test_vfx/image (8)", "LOLItems/Resources/vfxs/test_vfx/image (9)" };

		private static GameObject EffectVFX = VFXBuilder.CreateVFX("test_vfx", VFXSpritePath, 10, new IntVector2(0, 0), (Anchor)4, false, 0f, -1f, (Color?)Color.cyan, (WrapMode)0, true);

		private GameObject activeVFXObject;

		public static void Init()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			string text = "Debug Item";
			string text2 = "LOLItems/Resources/example_item_sprite";
			GameObject val = new GameObject(text);
			debugItem debugItem2 = val.AddComponent<debugItem>();
			ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
			string text3 = "idk";
			string text4 = "idk";
			ItemBuilder.SetupItem((PickupObject)(object)debugItem2, text3, text4, "LOLItems");
			ItemBuilder.SetCooldownType((PlayerItem)(object)debugItem2, (CooldownType)0, 1f);
			((PlayerItem)debugItem2).consumable = false;
			((PlayerItem)debugItem2).usableDuringDodgeRoll = true;
			((PickupObject)debugItem2).quality = (ItemQuality)4;
			ID = ((PickupObject)debugItem2).PickupObjectId;
		}

		public override void Pickup(PlayerController player)
		{
			((PlayerItem)this).Pickup(player);
			Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName);
		}

		public DebrisObject Drop(PlayerController player)
		{
			Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName);
			return ((PlayerItem)this).Drop(player, 4f);
		}

		public override void DoEffect(PlayerController player)
		{
			((MonoBehaviour)this).StartCoroutine(EffectCoroutine(player));
			Plugin.Log("debug item finished");
		}

		private IEnumerator EffectCoroutine(PlayerController player)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <EffectCoroutine>d__8(0)
			{
				<>4__this = this,
				player = player
			};
		}
	}
	internal class AdvancedPlayerOrbitalItem : PassiveItem
	{
		public PlayerOrbital OrbitalPrefab;

		public PlayerOrbitalFollower OrbitalFollowerPrefab;

		public bool HasUpgradeSynergy;

		public CustomSynergyType UpgradeSynergy;

		public GameObject UpgradeOrbitalPrefab;

		public GameObject UpgradeOrbitalFollowerPrefab;

		public bool CanBeMimicked;

		public DamageTypeModifier[] modifiers;

		public DamageTypeModifier[] synergyModifiers;

		public bool BreaksUponContact;

		public bool BreaksUponOwnerDamage;

		public GameObject BreakVFX;

		protected GameObject m_extantOrbital;

		protected bool m_synergyUpgradeActive;

		public bool HasAdvancedUpgradeSynergy;

		public string AdvancedUpgradeSynergy;

		public GameObject AdvancedUpgradeOrbitalPrefab;

		public GameObject AdvancedUpgradeOrbitalFollowerPrefab;

		public List<DamageTypeModifier> advancedSynergyModifiers = new List<DamageTypeModifier>();

		protected bool m_advancedSynergyUpgradeActive;

		private void CreateOrbital(PlayerController owner)
		{
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Expected O, but got Unknown
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Expected O, but got Unknown
			GameObject val = ((!((Object)(object)OrbitalPrefab != (Object)null)) ? ((Component)OrbitalFollowerPrefab).gameObject : ((Component)OrbitalPrefab).gameObject);
			if (HasUpgradeSynergy && m_synergyUpgradeActive)
			{
				val = ((!((Object)(object)UpgradeOrbitalPrefab != (Object)null)) ? UpgradeOrbitalFollowerPrefab.gameObject : UpgradeOrbitalPrefab.gameObject);
			}
			if (HasAdvancedUpgradeSynergy && m_advancedSynergyUpgradeActive)
			{
				val = ((!((Object)(object)AdvancedUpgradeOrbitalPrefab != (Object)null)) ? AdvancedUpgradeOrbitalFollowerPrefab.gameObject : AdvancedUpgradeOrbitalPrefab.gameObject);
			}
			m_extantOrbital = PlayerOrbitalItem.CreateOrbital(owner, val, (Object)(object)OrbitalFollowerPrefab != (Object)null, (PlayerOrbitalItem)null);
			if (BreaksUponContact && Object.op_Implicit((Object)(object)m_extantOrbital))
			{
				SpeculativeRigidbody component = m_extantOrbital.GetComponent<SpeculativeRigidbody>();
				if (Object.op_Implicit((Object)(object)component))
				{
					SpeculativeRigidbody val2 = component;
					val2.OnRigidbodyCollision = (OnRigidbodyCollisionDelegate)Delegate.Combine((Delegate?)(object)val2.OnRigidbodyCollision, (Delegate?)new OnRigidbodyCollisionDelegate(HandleBreakOnCollision));
				}
			}
			if (BreaksUponOwnerDamage && Object.op_Implicit((Object)(object)owner))
			{
				owner.OnReceivedDamage += HandleBreakOnOwnerDamage;
			}
			OnOrbitalCreated(m_extantOrbital);
		}

		public static GameObject CreateOrbital(PlayerController owner, GameObject targetOrbitalPrefab, bool isFollower, PlayerOrbitalItem sourceItem = null)
		{
			//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)
			GameObject val = Object.Instantiate<GameObject>(targetOrbitalPrefab, ((BraveBehaviour)owner).transform.position, Quaternion.identity);
			if (!isFollower)
			{
				PlayerOrbital component = val.GetComponent<PlayerOrbital>();
				component.Initialize(owner);
				component.SourceItem = sourceItem;
			}
			else
			{
				PlayerOrbitalFollower component2 = val.GetComponent<PlayerOrbitalFollower>();
				if (Object.op_Implicit((Object)(object)component2))
				{
					component2.Initialize(owner);
				}
			}
			return val;
		}

		public virtual void OnOrbitalCreated(GameObject orbital)
		{
		}

		private void HandleBreakOnOwnerDamage(PlayerController arg1)
		{
			//IL_005e: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)this))
			{
				if (Object.op_Implicit((Object)(object)BreakVFX) && Object.op_Implicit((Object)(object)m_extantOrbital) && Object.op_Implicit((Object)(object)m_extantOrbital.GetComponentInChildren<tk2dSprite>()))
				{
					SpawnManager.SpawnVFX(BreakVFX, Vector2Extensions.ToVector3ZisY(((tk2dBaseSprite)m_extantOrbital.GetComponentInChildren<tk2dSprite>()).WorldCenter, 0f), Quaternion.identity);
				}
				if (Object.op_Implicit((Object)(object)base.m_owner))
				{
					base.m_owner.RemovePassiveItem(((PickupObject)this).PickupObjectId);
					base.m_owner.OnReceivedDamage -= HandleBreakOnOwnerDamage;
				}
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}

		private void HandleBreakOnCollision(CollisionData rigidbodyCollision)
		{
			if (Object.op_Implicit((Object)(object)base.m_owner))
			{
				base.m_owner.RemovePassiveItem(((PickupObject)this).PickupObjectId);
			}
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}

		public void DecoupleOrbital()
		{
			m_extantOrbital = null;
			if (BreaksUponOwnerDamage && Object.op_Implicit((Object)(object)base.m_owner))
			{
				base.m_owner.OnReceivedDamage -= HandleBreakOnOwnerDamage;
			}
		}

		private void DestroyOrbital()
		{
			if (Object.op_Implicit((Object)(object)m_extantOrbital))
			{
				if (BreaksUponOwnerDamage && Object.op_Implicit((Object)(object)base.m_owner))
				{
					base.m_owner.OnReceivedDamage -= HandleBreakOnOwnerDamage;
				}
				Object.Destroy((Object)(object)m_extantOrbital.gameObject);
				m_extantOrbital = null;
			}
		}

		public override void Update()
		{
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			((PassiveItem)this).Update();
			if (HasAdvancedUpgradeSynergy)
			{
				if (m_advancedSynergyUpgradeActive && (!Object.op_Implicit((Object)(object)base.m_owner) || !CustomSynergies.PlayerHasActiveSynergy(base.m_owner, AdvancedUpgradeSynergy)))
				{
					if (Object.op_Implicit((Object)(object)base.m_owner))
					{
						for (int i = 0; i < advancedSynergyModifiers.Count; i++)
						{
							((BraveBehaviour)base.m_owner).healthHaver.damageTypeModifiers.Remove(advancedSynergyModifiers[i]);
						}
					}
					m_advancedSynergyUpgradeActive = false;
					DestroyOrbital();
					if (Object.op_Implicit((Object)(object)base.m_owner))
					{
						CreateOrbital(base.m_owner);
					}
				}
				else if (!m_advancedSynergyUpgradeActive && Object.op_Implicit((Object)(object)base.m_owner) && CustomSynergies.PlayerHasActiveSynergy(base.m_owner, AdvancedUpgradeSynergy))
				{
					m_advancedSynergyUpgradeActive = true;
					DestroyOrbital();
					if (Object.op_Implicit((Object)(object)base.m_owner))
					{
						CreateOrbital(base.m_owner);
					}
					for (int j = 0; j < advancedSynergyModifiers.Count; j++)
					{
						((BraveBehaviour)base.m_owner).healthHaver.damageTypeModifiers.Add(advancedSynergyModifiers[j]);
					}
				}
			}
			if (!HasUpgradeSynergy)
			{
				return;
			}
			if (m_synergyUpgradeActive && (!Object.op_Implicit((Object)(object)base.m_owner) || !base.m_owner.HasActiveBonusSynergy(UpgradeSynergy, false)))
			{
				if (Object.op_Implicit((Object)(object)base.m_owner))
				{
					for (int k = 0; k < synergyModifiers.Length; k++)
					{
						((BraveBehaviour)base.m_owner).healthHaver.damageTypeModifiers.Remove(synergyModifiers[k]);
					}
				}
				m_synergyUpgradeActive = false;
				DestroyOrbital();
				if (Object.op_Implicit((Object)(object)base.m_owner))
				{
					CreateOrbital(base.m_owner);
				}
			}
			else if (!m_synergyUpgradeActive && Object.op_Implicit((Object)(object)base.m_owner) && base.m_owner.HasActiveBonusSynergy(UpgradeSynergy, false))
			{
				m_synergyUpgradeActive = true;
				DestroyOrbital();
				if (Object.op_Implicit((Object)(object)base.m_owner))
				{
					CreateOrbital(base.m_owner);
				}
				for (int l = 0; l < synergyModifiers.Length; l++)
				{
					((BraveBehaviour)base.m_owner).healthHaver.damageTypeModifiers.Add(synergyModifiers[l]);
				}
			}
		}

		public override void Pickup(PlayerController player)
		{
			((PassiveItem)this).Pickup(player);
			player.OnNewFloorLoaded = (Action<PlayerController>)Delegate.Combine(player.OnNewFloorLoaded, new Action<PlayerController>(HandleNewFloor));
			for (int i = 0; i < modifiers.Length; i++)
			{
				((BraveBehaviour)player).healthHaver.damageTypeModifiers.Add(modifiers[i]);
			}
			CreateOrbital(player);
		}

		private void HandleNewFloor(PlayerController obj)
		{
			DestroyOrbital();
			CreateOrbital(obj);
		}

		public override DebrisObject Drop(PlayerController player)
		{
			DestroyOrbital();
			player.OnNewFloorLoaded = (Action<PlayerController>)Delegate.Remove(player.OnNewFloorLoaded, new Action<PlayerController>(HandleNewFloor));
			for (int i = 0; i < modifiers.Length; i++)
			{
				((BraveBehaviour)player).healthHaver.damageTypeModifiers.Remove(modifiers[i]);
			}
			for (int j = 0; j < synergyModifiers.Length; j++)
			{
				((BraveBehaviour)player).healthHaver.damageTypeModifiers.Remove(synergyModifiers[j]);
			}
			return ((PassiveItem)this).Drop(player);
		}

		public override void OnDestroy()
		{
			if ((Object)(object)base.m_owner != (Object)null)
			{
				PlayerController owner = base.m_owner;
				owner.OnNewFloorLoaded = (Action<PlayerController>)Delegate.Remove(owner.OnNewFloorLoaded, new Action<PlayerController>(HandleNewFloor));
				for (int i = 0; i < modifiers.Length; i++)
				{
					((BraveBehaviour)base.m_owner).healthHaver.damageTypeModifiers.Remove(modifiers[i]);
				}
				for (int j = 0; j < synergyModifiers.Length; j++)
				{
					((BraveBehaviour)base.m_owner).healthHaver.damageTypeModifiers.Remove(synergyModifiers[j]);
				}
				base.m_owner.OnReceivedDamage -= HandleBreakOnOwnerDamage;
			}
			DestroyOrbital();
			((PassiveItem)this).OnDestroy();
		}
	}
	public class EasyTrailBullet : BraveBehaviour
	{
		public Texture _gradTexture;

		private Projectile proj;

		public Vector2 TrailPos;

		public Color BaseColor;

		public Color StartColor;

		public Color EndColor;

		public float LifeTime;

		public float StartWidth;

		public float EndWidth;

		public EasyTrailBullet()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			TrailPos = Vector2.op_Implicit(new Vector3(0f, 0f, 0f));
			BaseColor = Color.red;
			StartColor = Color.red;
			EndColor = Color.white;
			LifeTime = 1f;
			StartWidth = 1f;
			EndWidth = 0f;
		}

		public void Start()
		{
			//IL_003b: 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_0052: 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_0084: Expected O, but got Unknown
			//IL_00ac: 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_00c6: Unknown result type (might be due to invalid IL or missing references)
			proj = ((BraveBehaviour)this).projectile;
			GameObject val = ETGMod.AddChild(((Component)((BraveBehaviour)this).projectile).gameObject, "trail object", new Type[0]);
			val.transform.position = ((BraveBehaviour)((BraveBehaviour)this).projectile).transform.position;
			val.transform.localPosition = Vector2.op_Implicit(TrailPos);
			TrailRenderer val2 = val.AddComponent<TrailRenderer>();
			((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0;
			((Renderer)val2).receiveShadows = false;
			Material val3 = new Material(Shader.Find("Sprites/Default"));
			val3.mainTexture = _gradTexture;
			((Renderer)val2).material = val3;
			val2.minVertexDistance = 0.1f;
			val3.SetColor("_Color", BaseColor);
			val2.startColor = StartColor;
			val2.endColor = EndColor;
			val2.time = LifeTime;
			val2.startWidth = StartWidth;
			val2.endWidth = EndWidth;
		}
	}
	public class EasyTrailMisc : BraveBehaviour
	{
		public Texture _gradTexture;

		private GameObject gameobject;

		public Vector2 TrailPos;

		public Color BaseColor;

		public Color StartColor;

		public Color EndColor;

		public float LifeTime;

		public float StartWidth;

		public float EndWidth;

		public EasyTrailMisc()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			TrailPos = Vector2.op_Implicit(new Vector3(0f, 0f, 0f));
			BaseColor = Color.red;
			StartColor = Color.red;
			EndColor = Color.white;
			LifeTime = 1f;
			StartWidth = 1f;
			EndWidth = 0f;
		}

		public void Start()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Expected O, but got Unknown
			//IL_00a2: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
			gameobject = ((Component)this).gameObject;
			GameObject val = ETGMod.AddChild(((Component)this).gameObject, "trail object", new Type[0]);
			val.transform.position = ((BraveBehaviour)this).transform.position;
			val.transform.localPosition = Vector2.op_Implicit(TrailPos);
			TrailRenderer val2 = val.AddComponent<TrailRenderer>();
			((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0;
			((Renderer)val2).receiveShadows = false;
			Material val3 = new Material(Shader.Find("Sprites/Default"));
			val3.mainTexture = _gradTexture;
			((Renderer)val2).material = val3;
			val2.minVertexDistance = 0.1f;
			val3.SetColor("_Color", BaseColor);
			val2.startColor = StartColor;
			val2.endColor = EndColor;
			val2.time = LifeTime;
			val2.startWidth = StartWidth;
			val2.endWidth = EndWidth;
		}
	}
	public static class Bubbs
	{
		public static GenericLootTable ShopKeeperLootTable;

		public static GameObject HandyGameObject;

		public static void Init()
		{
			//IL_0b8f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d0d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d24: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d53: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d5a: Expected O, but got Unknown
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "Everything I say is {ws}waterproof!{w} Or if not, {wq}water-absorbent!{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "Perhaps I could tell you about my impending odyssey!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "Frugality is not a virtue, I assure you.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "Purchase thoroughly! You'll never know when I shove off!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "You look like an aspiring patron of scientific research!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "{ws}The sea is the final frontier!{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "I've been designing some new fins!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "{wq}Did you know?:{w} clams can smell colours!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "Once, people could breathe in water! Then we forgot how.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "Whale crabs. Octo-salmon. Barnacle sharks. Who knows what I'll find?");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "The helmet never comes off! Well, except when I get hungry.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "I theorize that beneath this ocean, there is another, wetter, ocean!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "Undersea exploration isn't a job, it's a {wb}privilege!{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "I've done several trial runs in local puddles. I'm ready for the big show!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "Sea monsters are no more than misunderstood {wj}ambassadors of the deep.{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "Exploring the sea in a boat is like eating a melon by the rind!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "Bilgewater is a lovely place—principally when facing out to sea.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "My research indicates that if you hold your breath long enough, you can kick the habit! You just need to stay awake.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "One day, the ocean will be my oyster—and the ocean's oysters will be my breakfast!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "Oh, don't get me started on {ws}buoyancy.{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "Gadgetry in Piltover, extinct overlords in Freljord? Hmph! I'll show them!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "There's evidence to suggest that manatees once ruled the {wr}land and sea!{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "I can't wait to school some fish.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "So many {wj}mysteries{w} to explore.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "I can't wait to see what lies beneath!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "The real sunken {wb}treasure{w} is aquatic knowledge.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_GENERIC_TALK", "Just as soon as I perfect my submersible, I'll be off!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_STOPPER_TALK", "{wj}Soon, very soon...{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_STOPPER_TALK", "{wb}Every coin counts.{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_STOPPER_TALK", "{wq}What mysteries await?{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_STOPPER_TALK", "{ws}To knowledge!{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "{wb}Perfect!{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "{wb}Delightful!{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "{wb}Impeccable taste!{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "My, that is a {wq}beauty!{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "Every little bit helps!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "You've just supported science!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "That is a singular find… oh, but I have more, if you need them!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "It complements you {wq}perfectly.{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "That is guaranteed for, at a minimum, ballast.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "I've sold four of those today!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "That will spur—or deter—violence swimmingly!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "Yeah, I have absolutely no idea what that does. {wr}Good luck!{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "Thank you for contributing to my expedition.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "Would you like that wrapped?");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "{wj}Uh, sorry,{w} I haven't gotten around to drying that off!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "I prefer you only killed bad people with this—or nautical sceptics.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "That is, {wj}uh… most probably valuable!{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "A bare minimum of rust.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "No price is too great for {wb}progress.{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "That will serve you {wb}splendidly.{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "Keep this up, and I'll be diving in no time.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "You'll receive a special thanks in my paper.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "Now that you've got the hang of it, {wq}purchase something else!{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "Why not pick up a gift… {wr}for science?{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "Your gold will be put to good use.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "Now you're part of the adventure!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "No need to explain what you plan to do with that.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "I can tell you're a collector.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_PURCHASE_TALK", "There's simply no better… {wj}for whatever that does.{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_NOSALE_TALK", "Ah, yes, but science, {wj}tragically{w}, doesn’t operate on credit.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_NOSALE_TALK", "{wq}I’d love to fund your dreams{w}, but I can barely fund my own!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_NOSALE_TALK", "{wb}That’s the spirit!{w} The financial spirit, however, is lacking.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_NOSALE_TALK", "Sorry, but seawater doesn’t pay the bills.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_NOSALE_TALK", "{wr}If only enthusiasm were a currency!{w} You’d be rich indeed.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_NOSALE_TALK", "That price is, {wj}regrettably{w}, non-negotiable—even for pioneers.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_NOSALE_TALK", "Oh, don’t worry. Many great expeditions ended before they began.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_NOSALE_TALK", "Perhaps a smaller trinket? To, ah, {ws}stay afloat?{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_NOSALE_TALK", "{wr}Close!{w} Now, just a few more clams in the purse, as they say.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_NOSALE_TALK", "I accept gold, doubloons, and… well, mostly just gold.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_NOSALE_TALK", "Research may be priceless, but my wares are not.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_NOSALE_TALK", "I could loan it to you, but then I’d need to repossess it underwater.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_NOSALE_TALK", "Come now, even barnacles save more diligently!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_NOSALE_TALK", "{wb}Ah, a true visionary!{w} Sadly, visions don’t spend well at market.");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_INTRO_TALK", "All profits go to {wq}cutting-edge{w} research!");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_INTRO_TALK", "Have I read you my thesis on {wj}sea slugs?{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_INTRO_TALK", "{wq}Welcome to the dive site!{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_INTRO_TALK", "Would you like to join my {wr}expedition?{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_INTRO_TALK", "I brew my potions with salt water for that extra {wb}zing!{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_ATTACKED_TALK", "{wr}Uncalled for!{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_ATTACKED_TALK", "{wj}No discounts!{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_ATTACKED_TALK", "{wr}Not the equipment!{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_ATTACKED_TALK", "{wr}Science under siege!{w}");
			NpcTools.AddComplex(Databases.Strings.Core, "#BUBBS_STOLEN_TALK", "{wr}Robbery{w} is hardly the scientific method!");
			List<int> list = new List<int>
			{
				BladeOfTheRuinedKing.ID,
				ExperimentalHexplate.ID,
				GuardianAngel.ID,
				GuinsoosRageblade.ID,
				Hubris.ID,
				KrakenSlayer.ID,
				LiandrysTorment.ID,
				MuramanaSynergyActivation.ID,
				Manamune.ID,
				Muramana.ID,
				StatikkShiv.ID,
				Stridebreaker.ID,
				SunfireAegis.ID,
				Thornmail.ID,
				ZhonyasHourglass.ID,
				Collector.ID,
				FrozenHeart.ID,
				RodOfAges.ID,
				HorizonFocus.ID,
				Puppeteer.ID,
				Galeforce.ID,
				RylaisCrystalScepter.ID,
				Shadowflame.ID,
				NavoriQuickblades.ID,
				BraumsShield.ID,
				PowPow.ID,
				PowPowAltForm.ID,
				HextechRifle.ID,
				ElectricRifle.ID,
				PrayerBeads.ID,
				Whisper.ID,
				Crossblade.ID,
				SoulSpear.ID,
				ShieldOfMoltenStone.ID,
				CloakOfStarryNight.ID,
				ZekesConvergence.ID,
				Redemption.ID,
				DetonationOrb.ID,
				Sheen.ID,
				FatedAshes.ID,
				Cull.ID,
				PerfectlyTimedStopwatch.ID,
				TearOfTheGoddess.ID
			};
			ShopKeeperLootTable = LootTableTools.CreateLootTable();
			foreach (int item in list)
			{
				ShopKeeperLootTable.AddItemToPool(item);
			}
			GameObject val = ShopAPI.SetUpShop("BUBBS", "LOLItems", new List<string> { "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_idle_01", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_idle_02", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_idle_03", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_idle_04" }, 6, new List<string> { "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_talk_01", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_talk_02", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_talk_03", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_talk_04" }, 6, ShopKeeperLootTable, (ShopCurrencyType)0, "#BUBBS_GENERIC_TALK", "#BUBBS_STOPPER_TALK", "#BUBBS_PURCHASE_TALK", "#BUBBS_NOSALE_TALK", "#BUBBS_INTRO_TALK", "#BUBBS_ATTACKED_TALK", "#BUBBS_STOLEN_TALK", new Vector3(2.75f, 2.875f, 0f), new Vector3(0.1875f, 3f, 0f), (VoiceBoxes)21, ShopAPI.defaultItemPositions, 0.8f, false, (StatModifier[])null, (Func<CustomShopController, PlayerController, int, bool>)null, (Func<CustomShopController, PlayerController, int, int>)null, (Func<CustomShopController, CustomShopItemController, PickupObject, int>)null, (Func<PlayerController, PickupObject, int, bool>)null, (Func<PlayerController, PickupObject, int, bool>)null, (string)null, (string)null, true, true, "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_carpet", (Vector2?)Vector2.op_Implicit(new Vector3(0f, 0f, 0f)), true, "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_minimap", true, 0.1f, (DungeonPrerequisite[])null, 2f, (ShopItemPoolType)0, false, (IntVector2?)null, (IntVector2?)null);
			List<string> list2 = new List<string>
			{
				"LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_buy_01", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_buy_02", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_buy_03", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_buy_04", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_buy_05", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_buy_06", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_buy_07", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_buy_08", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_buy_09", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_buy_10",
				"LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_buy_11", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_buy_12", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_buy_13", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_buy_14", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_buy_15", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_buy_16", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_buy_17", "LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/bubbs_buy_18"
			};
			ShopAPI.AddAdditionalAnimationsToShop(val, list2, 6f, (List<string>)null, 6f, (List<string>)null, 6f);
			PrototypeDungeonRoom room = RoomFactory.BuildNewRoomFromResource("LOLItems/Resources/npc_sprites/shopkeeper/bubbs_sprites/test.newroom", (Assembly)null).room;
			RegisterShopRoom(val, room, new Vector2(7.5f, 5f), 1.2f);
			List<ProceduralFlowModifierData> injectionData = GameManager.Instance.GlobalInjectionData.entries[2].injectionData.InjectionData;
			ProceduralFlowModifierData val2 = new ProceduralFlowModifierData();
			val2.annotation = "bubbs";
			val2.placementRules = new List<FlowModifierPlacementType> { (FlowModifierPlacementType)1 };
			val2.exactRoom = room;
			val2.prerequisites = (DungeonPrerequisite[])(object)new DungeonPrerequisite[0];
			val2.CanBeForcedSecret = false;
			injectionData.Add(val2);
			HandyGameObject = val;
		}

		public static void RegisterShopRoom(GameObject shop, PrototypeDungeonRoom protoroom, Vector2 vector, float m_weight = 1f)
		{
			//IL_0003: 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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Expected O, but got Unknown
			//IL_004a: 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_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Expected O, but got Unknown
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			protoroom.category = (RoomCategory)2;
			DungeonPrerequisite[] array = (DungeonPrerequisite[])((shop.GetComponent<CustomShopController>()?.prerequisites != null) ? ((Array)shop.GetComponent<CustomShopController>().prerequisites) : ((Array)new DungeonPrerequisite[0]));
			protoroom.placedObjectPositions.Add(vector);
			List<PrototypePlacedObjectData> placedObjects = protoroom.placedObjects;
			PrototypePlacedObjectData val = new PrototypePlacedObjectData();
			val.contentsBasePosition = vector;
			val.fieldData = new List<PrototypePlacedObjectFieldData>();
			val.instancePrerequisites = array;
			val.linkedTriggerAreaIDs = new List<int>();
			DungeonPlaceable val2 = new DungeonPlaceable();
			val2.width = 2;
			val2.height = 2;
			val2.respectsEncounterableDifferentiator = true;
			List<DungeonPlaceableVariant> list = new List<DungeonPlaceableVariant>();
			DungeonPlaceableVariant val3 = new DungeonPlaceableVariant();
			val3.percentChance = 1f;
			val3.nonDatabasePlaceable = shop;
			val3.prerequisites = array;
			val3.materialRequirements = (DungeonPlaceableRoomMaterialRequirement[])(object)new DungeonPlaceableRoomMaterialRequirement[0];
			list.Add(val3);
			val2.variantTiers = list;
			val.placeableContents = val2;
			placedObjects.Add(val);
			RoomData val4 = default(RoomData);
			val4.room = protoroom;
			val4.isSpecialRoom = true;
			val4.category = "SPECIAL";
			val4.specialSubCategory = "WEIRD_SHOP";
			RoomData val5 = val4;
			val5.weight = 1f;
			RoomFactory.rooms.Add(((Object)shop).name, val5);
			DungeonHandler.Register(val5);
		}
	}
	internal class Collector : PassiveItem
	{
		private static float DamageStat = 1.1f;

		private static int DeathGoldStat = 1;

		private static float DeathGoldChance = 0.3f;

		private static float ExecuteThreshold = 0.05f;

		public static int ID;

		public static void Init()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			string text = "The Collector";
			string text2 = "LOLItems/Resources/passive_item_sprites/the_collector_pixelart_sprite";
			GameObject val = new GameObject(text);
			Collector collector = val.AddComponent<Collector>();
			ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
			string text3 = "\"death and taxes\"";
			string text4 = "A weapon that once belonged to a legendary pirate. It now rests in your hands and lends you a desire for gold. An orange sounds good right about now.\n";
			ItemBuilder.SetupItem((PickupObject)(object)collector, text3, text4, "LOLItems");
			ItemBuilder.AddPassiveStatModifier((PickupObject)(object)collector, (StatType)5, DamageStat, (ModifyMethod)1);
			((PickupObject)collector).quality = (ItemQuality)4;
			ID = ((PickupObject)collector).PickupObjectId;
		}

		public override void Pickup(PlayerController player)
		{
			((PassiveItem)this).Pickup(player);
			Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName);
			player.PostProcessProjectile += OnPostProcessProjectile;
			player.PostProcessBeamTick += OnPostProcessProjectile;
			player.OnKilledEnemyContext += DeathGoldDrop;
		}

		public override void DisableEffect(PlayerController player)
		{
			((PassiveItem)this).DisableEffect(player);
			Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName);
			player.PostProcessProjectile -= OnPostProcessProjectile;
			player.PostProcessBeamTick -= OnPostProcessProjectile;
			player.OnKilledEnemyContext -= DeathGoldDrop;
		}

		private void OnPostProcessProjectile(BeamController beam, SpeculativeRigidbody hitRigidbody, float tickrate)
		{
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)hitRigidbody != (Object)null || (Object)(object)((BraveBehaviour)hitRigidbody).aiActor != (Object)null)
			{
				float currentHealthPercentage = ((BraveBehaviour)((BraveBehaviour)hitRigidbody).aiActor).healthHaver.GetCurrentHealthPercentage();
				if (currentHealthPercentage <= ExecuteThreshold)
				{
					((BraveBehaviour)((BraveBehaviour)hitRigidbody).aiActor).healthHaver.ApplyDamage(((BraveBehaviour)((BraveBehaviour)hitRigidbody).aiActor).healthHaver.GetMaxHealth(), Vector2.zero, "the_collector_death_execute", (CoreDamageTypes)0, (DamageCategory)5, false, (PixelCollider)null, false);
				}
			}
		}

		private void OnPostProcessProjectile(Projectile proj, float f)
		{
			proj.OnHitEnemy = (Action<Projectile, SpeculativeRigidbody, bool>)Delegate.Combine(proj.OnHitEnemy, (Action<Projectile, SpeculativeRigidbody, bool>)delegate(Projectile projHit, SpeculativeRigidbody enemy, bool fatal)
			{
				//IL_002e: Unknown result type (might be due to invalid IL or missing references)
				float currentHealthPercentage = ((BraveBehaviour)enemy).healthHaver.GetCurrentHealthPercentage();
				if (currentHealthPercentage <= ExecuteThreshold)
				{
					((BraveBehaviour)enemy).healthHaver.ApplyDamage(((BraveBehaviour)enemy).healthHaver.GetMaxHealth(), Vector2.zero, "the_collector_death_execute", (CoreDamageTypes)0, (DamageCategory)5, false, (PixelCollider)null, false);
				}
			});
		}

		private void DeathGoldDrop(PlayerController player, HealthHaver enemy)
		{
			((BraveBehaviour)enemy).healthHaver.OnDeath += delegate
			{
				//IL_006a: 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)
				if (Random.value < DeathGoldChance)
				{
					if (((BraveBehaviour)enemy).healthHaver.IsBoss || ((BraveBehaviour)enemy).healthHaver.IsSubboss)
					{
						LootEngine.SpawnCurrency(((BraveBehaviour)enemy).specRigidbody.UnitCenter, DeathGoldStat * 10, false);
					}
					else
					{
						LootEngine.SpawnCurrency(((BraveBehaviour)enemy).specRigidbody.UnitCenter, DeathGoldStat, false);
					}
				}
			};
		}
	}
	internal class FrozenHeart : AuraItem
	{
		private static int ArmorStat = 1;

		private static float WintersCaressCrippleRatio = 0.7f;

		private static float WintersCaressRange = 8f;

		public static int ID;

		private static GameActorCrippleEffect WintersCaressCrippleEffect = new GameActorCrippleEffect
		{
			duration = 1f,
			effectIdentifier = "frozen_heart_cripple_effect",
			resistanceType = (EffectResistanceType)0,
			AppliesOutlineTint = true,
			OutlineTintColor = ExtendedColours.skyblue,
			CrippleAmount = WintersCaressCrippleRatio
		};

		public static void Init()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			string text = "Frozen Heart-LOLItems";
			string text2 = "LOLItems/Resources/passive_item_sprites/frozen_heart_pixelart_sprite";
			GameObject val = new GameObject(text);
			FrozenHeart frozenHeart = val.AddComponent<FrozenHeart>();
			ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
			string text3 = "Warning: Do not thaw!";
			string text4 = "Emits a chilling air that causes those nearby to have cold hands. It might just be a disguised AC unit. They keep complaining that they would've killed you if it weren't for their cold hands.\n";
			ItemBuilder.SetupItem((PickupObject)(object)frozenHeart, text3, text4, "LOLItems");
			((PassiveItem)frozenHeart).ArmorToGainOnInitialPickup = ArmorStat;
			((AuraItem)frozenHeart).AuraRadius = WintersCaressRange;
			((AuraItem)frozenHeart).DamagePerSecond = 0f;
			((PickupObject)frozenHeart).quality = (ItemQuality)3;
			GunExt.SetName((PickupObject)(object)frozenHeart, "Frozen Heart");
			ID = ((PickupObject)frozenHeart).PickupObjectId;
		}

		public override void Pickup(PlayerController player)
		{
			((PassiveItem)this).Pickup(player);
			Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName);
		}

		public override void DisableEffect(PlayerController player)
		{
			((PassiveItem)this).DisableEffect(player);
			Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName);
		}

		public override void DoAura()
		{
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)base.m_extantAuraVFX == (Object)null)
			{
			}
			base.didDamageEnemies = false;
			if (base.AuraAction == null)
			{
				base.AuraAction = delegate(AIActor actor, float dist)
				{
					((GameActor)actor).ApplyEffect((GameActorEffect)(object)WintersCaressCrippleEffect, 1f, (Projectile)null);
				};
			}
			if ((Object)(object)((PassiveItem)this).m_owner != (Object)null && ((PassiveItem)this).m_owner.CurrentRoom != null)
			{
				((PassiveItem)this).m_owner.CurrentRoom.ApplyActionToNearbyEnemies(((GameActor)((PassiveItem)this).m_owner).CenterPosition, ((AuraItem)this).ModifiedAuraRadius, base.AuraAction);
			}
			if (base.didDamageEnemies)
			{
				((PassiveItem)this).m_owner.DidUnstealthyAction();
			}
		}
	}
	public static class HelpfulMethods
	{
		public static string[,] FloorNames = new string[10, 2]
		{
			{ "tt_castle", "Keep of the Lead Lord / Floor 1" },
			{ "tt_sewer", "Oubliette / Floor 1.5" },
			{ "tt5", "Gungeon Proper / Floor 2" },
			{ "tt_cathedral", "Abbey of the True Gun / Floor 2.5" },
			{ "tt_mines", "Black Powder Mine / Floor 3" },
			{ "ss_resourcefulrat", "Resourceful Rat's Lair / Floor 3.5" },
			{ "tt_catacombs", "Hollow / Floor 4" },
			{ "tt_nakatomi", "R&G Dept / Floor 4.5" },
			{ "tt_forge", "Forge / Floor 5" },
			{ "tt_bullethell", "Bullet Hell / Floor 6" }
		};

		public static float GetFloorDamageScale()
		{
			return GameManager.Instance.GetLastLoadedLevelDefinition().dungeonSceneName switch
			{
				"tt_castle" => 1f, 
				"tt_sewer" => 1.25f, 
				"tt5" => 1.25f, 
				"tt_cathedral" => 1.5f, 
				"tt_mines" => 1.5f, 
				"ss_resourcefulrat" => 1.75f, 
				"tt_catacombs" => 1.75f, 
				"tt_nakatomi" => 2f, 
				"tt_forge" => 2f, 
				"tt_bullethell" => 2.25f, 
				_ => 0f, 
			};
		}

		public static void DoRandomParticleBurst(int num, Vector3 minPosition, Vector3 maxPosition, float angleVariance, float magnitudeVariance, float? startSize = null, float? startLifetime = null, Color? startColor = null, SparksType systemType = 0)
		{
			//IL_000e: 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_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: 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_002c: 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_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_009a: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val2 = default(Vector3);
			for (int i = 0; i < num; i++)
			{
				Vector3 val = Vector2.op_Implicit(MathsAndLogicHelper.DegreeToVector2(BraveUtility.RandomAngle()));
				((Vector3)(ref val2))..ctor(Random.Range(minPosition.x, maxPosition.x), Random.Range(minPosition.y, maxPosition.y), Random.Range(minPosition.z, maxPosition.z));
				Vector3 val3 = Quaternion.Euler(0f, 0f, Random.Range(0f - angleVariance, angleVariance)) * (((Vector3)(ref val)).normalized * Random.Range(((Vector3)(ref val)).magnitude - magnitudeVariance, ((Vector3)(ref val)).magnitude + magnitudeVariance));
				GlobalSparksDoer.DoSingleParticle(val2, val3, startSize, startLifetime, startColor, systemType);
			}
		}

		public static float GetFloorPriceMod()
		{
			return GameManager.Instance.GetLastLoadedLevelDefinition().priceMultiplier;
		}

		public static void PlayRandomSFX(GameObject gameObject, string[] sfxList)
		{
			Random random = new Random();
			int num = random.Next(sfxList.Length);
			string text = sfxList[num];
			AkSoundEngine.PostEvent(text, gameObject);
		}

		public static void PlayRandomSFX(GameObject gameObject, List<string> sfxList)
		{
			Random random = new Random();
			int index = random.Next(sfxList.Count);
			string text = sfxList[index];
			AkSoundEngine.PostEvent(text, gameObject);
		}

		public static float GetFloorValue()
		{
			string dungeonSceneName = GameManager.Instance.GetLastLoadedLevelDefinition().dungeonSceneName;
			for (int i = 0; i < FloorNames.GetLength(0); i++)
			{
				string text = FloorNames[i, 0];
				if (dungeonSceneName == text)
				{
					return text switch
					{
						"tt_castle" => 1f, 
						"tt_sewer" => 1.5f, 
						"tt5" => 2f, 
						"tt_cathedral" => 2.5f, 
						"tt_mines" => 3f, 
						"ss_resourcefulrat" => 3.5f, 
						"tt_catacombs" => 4f, 
						"tt_nakatomi" => 4.5f, 
						"tt_forge" => 5f, 
						"tt_bullethell" => 6f, 
						_ => 0f, 
					};
				}
			}
			return 0f;
		}

		public static void CustomNotification(string header, string text, tk2dBaseSprite sprite = null, NotificationColor? color = null)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			if (sprite == null)
			{
				sprite = GameUIRoot.Instance.notificationController.notificationObjectSprite;
			}
			GameUIRoot.Instance.notificationController.DoCustomNotification(header, text, sprite.Collection, sprite.spriteId, color.GetValueOrDefault((NotificationColor)2), false, false);
		}

		public static void AddItemToSynergy(this PickupObject obj, CustomSynergyType type)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			AddItemToSynergy(type, obj.PickupObjectId);
		}

		public static void AddItemToSynergy(CustomSynergyType type, int id)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			AdvancedSynergyEntry[] synergies = GameManager.Instance.SynergyManager.synergies;
			foreach (AdvancedSynergyEntry val in synergies)
			{
				if (!val.bonusSynergies.Contains(type) || !((Object)(object)PickupObjectDatabase.GetById(id) != (Object)null))
				{
					continue;
				}
				PickupObject byId = PickupObjectDatabase.GetById(id);
				if (byId is Gun)
				{
					if (val.OptionalGunIDs != null)
					{
						val.OptionalGunIDs.Add(id);
						continue;
					}
					val.OptionalGunIDs = new List<int> { id };
				}
				else if (val.OptionalItemIDs != null)
				{
					val.OptionalItemIDs.Add(id);
				}
				else
				{
					val.OptionalItemIDs = new List<int> { id };
				}
			}
		}
	}
	internal class HorizonFocus : PassiveItem
	{
		private static float DamageStat = 1.1f;

		private static float HyperShotMaxDistance = 15f;

		private static float HyperShotMinDistance = 3f;

		private static float HyperShotMaxDamageInc = 0.25f;

		public static int ID;

		public static void Init()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			string text = "Horizon Focus";
			string text2 = "LOLItems/Resources/passive_item_sprites/horizon_focus_pixelart_sprite";
			GameObject val = new GameObject(text);
			HorizonFocus horizonFocus = val.AddComponent<HorizonFocus>();
			ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
			string text3 = "*not camping btw*";
			string text4 = "A futuristic gauntlet that seems to improve your aim at far ranges, allowing your long range attacks to deal increased damage. There seems to be a signature: Ja-c- -nd Vi--or\n";
			ItemBuilder.SetupItem((PickupObject)(object)horizonFocus, text3, text4, "LOLItems");
			ItemBuilder.AddPassiveStatModifier((PickupObject)(object)horizonFocus, (StatType)5, DamageStat, (ModifyMethod)1);
			((PickupObject)horizonFocus).quality = (ItemQuality)4;
			ID = ((PickupObject)horizonFocus).PickupObjectId;
		}

		public override void Pickup(PlayerController player)
		{
			((PassiveItem)this).Pickup(player);
			Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName);
			player.PostProcessProjectile += OnPostProcessProjectile;
			player.PostProcessBeamTick += OnPostProcessProjectile;
		}

		public override void DisableEffect(PlayerController player)
		{
			((PassiveItem)this).DisableEffect(player);
			Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName);
			player.PostProcessProjectile -= OnPostProcessProjectile;
			player.PostProcessBeamTick -= OnPostProcessProjectile;
		}

		private void OnPostProcessProjectile(BeamController beam, SpeculativeRigidbody hitRigidbody, float tickrate)
		{
			//IL_002a: 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_003f: 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_009e: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)beam))
			{
				return;
			}
			GameActor owner = beam.Owner;
			PlayerController val = (PlayerController)(object)((owner is PlayerController) ? owner : null);
			if (val != null)
			{
				float num = Vector2.Distance(Vector2.op_Implicit(((BraveBehaviour)val).transform.position), Vector2.op_Implicit(((BraveBehaviour)((BraveBehaviour)hitRigidbody).aiActor).transform.position));
				if (!(num <= HyperShotMinDistance))
				{
					float num2 = Mathf.Min(num, HyperShotMaxDistance) / HyperShotMaxDistance * HyperShotMaxDamageInc;
					float num3 = ((BraveBehaviour)beam).projectile.baseData.damage * num2 * tickrate;
					((BraveBehaviour)((BraveBehaviour)hitRigidbody).aiActor).healthHaver.ApplyDamage(num3, Vector2.zero, "horizon_focus_hypershot_amp", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false);
				}
			}
		}

		private void OnPostProcessProjectile(Projectile proj, float f)
		{
			if (!Object.op_Implicit((Object)(object)proj))
			{
				return;
			}
			GameActor owner = proj.Owner;
			PlayerController player = (PlayerController)(object)((owner is PlayerController) ? owner : null);
			if (player == null)
			{
				return;
			}
			proj.OnHitEnemy = (Action<Projectile, SpeculativeRigidbody, bool>)Delegate.Combine(proj.OnHitEnemy, (Action<Projectile, SpeculativeRigidbody, bool>)delegate(Projectile projHit, SpeculativeRigidbody enemy, bool fatal)
			{
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_006b: Unknown result type (might be due to invalid IL or missing references)
				float num = Vector2.Distance(Vector2.op_Implicit(((BraveBehaviour)player).transform.position), Vector2.op_Implicit(((BraveBehaviour)projHit).transform.position));
				if (!(num <= HyperShotMinDistance))
				{
					float num2 = Mathf.Min(num, HyperShotMaxDistance) / HyperShotMaxDistance * HyperShotMaxDamageInc;
					float num3 = projHit.baseData.damage * num2;
					((BraveBehaviour)enemy).healthHaver.ApplyDamage(num3, Vector2.zero, "horizon_focus_hypershot_amp", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false);
				}
			});
		}
	}
	public class Muramana : PassiveItem
	{
		private static float DamageStat = 1.2f;

		private static float ClipAndAmmoIncrease = 1.5f;

		private static float MuramanaShockBaseDamage = 5f;

		public static int ID;

		public static void Init()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			string text = "Muramana";
			string text2 = "LOLItems/Resources/passive_item_sprites/muramana_pixelart_sprite_outline";
			GameObject val = new GameObject(text);
			Muramana muramana = val.AddComponent<Muramana>();
			ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
			string text3 = "The Peak of Swordsmithing";
			string text4 = "A blade forged by Masamune and wielded by the worthy, the Manamune's true power has been unlocked and empowers your every attack.\n";
			ItemBuilder.SetupItem((PickupObject)(object)muramana, text3, text4, "LOLItems");
			ItemBuilder.AddPassiveStatModifier((PickupObject)(object)muramana, (StatType)5, DamageStat, (ModifyMethod)1);
			ItemBuilder.AddPassiveStatModifier((PickupObject)(object)muramana, (StatType)16, ClipAndAmmoIncrease, (ModifyMethod)1);
			ItemBuilder.AddPassiveStatModifier((PickupObject)(object)muramana, (StatType)9, ClipAndAmmoIncrease, (ModifyMethod)1);
			((PickupObject)muramana).quality = (ItemQuality)(-100);
			((PickupObject)muramana).ShouldBeExcludedFromShops = true;
			ID = ((PickupObject)muramana).PickupObjectId;
		}

		public override void Pickup(PlayerController player)
		{
			((PassiveItem)this).Pickup(player);
			Plugin.Log("Player picked up " + ((PickupObject)this).EncounterNameOrDisplayName);
			player.PostProcessProjectile += MuramanaShock;
			player.PostProcessBeamTick += MuramanaShock;
		}

		public override void DisableEffect(PlayerController player)
		{
			((PassiveItem)this).DisableEffect(player);
			Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).EncounterNameOrDisplayName);
			player.PostProcessProjectile -= MuramanaShock;
			player.PostProcessBeamTick -= MuramanaShock;
		}

		private void MuramanaShock(BeamController beam, SpeculativeRigidbody hitRigidbody, float tickrate)
		{
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			GameActor owner = beam.Owner;
			PlayerController val = (PlayerController)(object)((owner is PlayerController) ? owner : null);
			if (val != null)
			{
				Gun currentGun = ((GameActor)val).CurrentGun;
				if (currentGun != null && (Object)(object)hitRigidbody != (Object)null && (Object)(object)((BraveBehaviour)hitRigidbody).aiActor != (Object)null)
				{
					float num = Mathf.Max(0f, (val.stats.GetStatValue((StatType)16) - 1f) / 5f);
					float num2 = Mathf.Max(0f, (val.stats.GetStatValue((StatType)9) - 1f) / 5f);
					float num3 = Mathf.Max(1f, 1f + num + num2);
					float num4 = Mathf.Max(1f, MuramanaShockBaseDamage * num3) * tickrate;
					((BraveBehaviour)((BraveBehaviour)hitRigidbody).aiActor).healthHaver.ApplyDamage(num4, Vector2.zero, "muramana_shock_damage", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false);
				}
			}
		}

		private void MuramanaShock(Projectile proj, float f)
		{
			if (!((Object)(object)proj.Shooter == (Object)(object)((BraveBehaviour)proj.Owner).specRigidbody))
			{
				return;
			}
			GameActor owner = proj.Owner;
			PlayerController player = (PlayerController)(object)((owner is PlayerController) ? owner : null);
			if (player == null)
			{
				return;
			}
			Gun currentGun = ((GameActor)player).CurrentGun;
			if (currentGun == null)
			{
				return;
			}
			proj.OnHitEnemy = (Action<Projectile, SpeculativeRigidbody, bool>)Delegate.Combine(proj.OnHitEnemy, (Action<Projectile, SpeculativeRigidbody, bool>)delegate(Projectile projHit, SpeculativeRigidbody enemy, bool fatal)
			{
				//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)enemy != (Object)null && (Object)(object)((BraveBehaviour)enemy).healthHaver != (Object)null)
				{
					float num = Mathf.Max(0f, (player.stats.GetStatValue((StatType)16) - 1f) / 5f);
					float num2 = Mathf.Max(0f, (player.stats.GetStatValue((StatType)9) - 1f) / 5f);
					float num3 = Mathf.Max(1f, 1f + num + num2);
					float num4 = Mathf.Max(1f, MuramanaShockBaseDamage * num3);
					((BraveBehaviour)enemy).healthHaver.ApplyDamage(num4, Vector2.zero, "muramana_shock_damage", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false);
				}
			});
		}
	}
	internal class RodOfAges : PassiveItem
	{
		[CompilerGenerated]
		private sealed class <TimelessStackingTracker>d__12 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public PlayerController player;

			public RodOfAges <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <TimelessStackingTracker>d__12(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_002c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0036: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					break;
				case 1:
					<>1__state = -1;
					ItemBuilder.RemovePassiveStatModifier((PickupObject)(object)<>4__this, (StatType)5);
					ItemBuilder.RemovePassiveStatModifier((PickupObject)(object)<>4__this, (StatType)9);
					ItemBuilder.RemovePassiveStatModifier((PickupObject)(object)<>4__this, (StatType)16);
					<>4__this.TimelessStackCount++;
					ItemBuilder.AddPassiveStatModifier((PickupObject)(object)<>4__this, (StatType)5, 1f + TimelessDamageIncrementValue * (float)<>4__this.TimelessStackCount, (ModifyMethod)1);
					ItemBuilder.AddPassiveStatModifier((PickupObject)(object)<>4__this, (StatType)9, 1f + TimelessIncrementValue * (float)<>4__this.TimelessStackCount, (ModifyMethod)1);
					ItemBuilder.AddPassiveStatModifier((PickupObject)(object)<>4__this, (StatType)16, 1f + TimelessIncrementValue * (float)<>4__this.TimelessStackCount, (ModifyMethod)1);
					VolleyRebuildHelpers.RecalculateStatsWithoutRebuildingGunVolleys(player.stats, player);
					break;
				}
				if ((float)<>4__this.TimelessStackCount * TimelessIncrementValue < TimelessIncreaseMax)
				{
					<>2__current =