Decompiled source of League of Legends Items v3.0.1

LOLItems.dll

Decompiled 5 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
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)
		{
			return;
		}
		AIActor val = null;
		if ((Object)(object)((BraveBehaviour)enemyRigidbody).aiActor != (Object)null)
		{
			val = ((BraveBehaviour)enemyRigidbody).aiActor;
		}
		else
		{
			if (!((Object)(object)((Component)enemyRigidbody).GetComponentInParent<AIActor>() != (Object)null))
			{
				return;
			}
			val = ((Component)enemyRigidbody).GetComponentInParent<AIActor>();
		}
		List<AIActor> list = ChainEnemies(val);
		if (PlaysSFX)
		{
			HelpfulMethods.PlayRandomSFX(((Component)val).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_0050: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)enemyRigidbody == (Object)null)
		{
			return;
		}
		AIActor val = null;
		if ((Object)(object)((BraveBehaviour)enemyRigidbody).aiActor != (Object)null)
		{
			val = ((BraveBehaviour)enemyRigidbody).aiActor;
		}
		else
		{
			if (!((Object)(object)((Component)enemyRigidbody).GetComponentInParent<AIActor>() != (Object)null))
			{
				return;
			}
			val = ((Component)enemyRigidbody).GetComponentInParent<AIActor>();
		}
		List<AIActor> list = ChainEnemies(((GameActor)val).CenterPosition);
		if (PlaysSFX)
		{
			HelpfulMethods.PlayRandomSFX(((Component)val).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 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_0bcb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bdf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c0f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c14: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d49: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d60: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d8f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d96: 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,
				VirtueForm1.ID,
				VirtueForm2.ID,
				VirtueForm3.ID,
				SoulSpear.ID,
				ShieldOfMoltenStone.ID,
				CloakOfStarryNight.ID,
				ZekesConvergence.ID,
				Redemption.ID,
				Sheen.ID,
				FatedAshes.ID,
				Cull.ID,
				PerfectlyTimedStopwatch.ID,
				TearOfTheGoddess.ID,
				RefillablePotion.ID,
				TalismanOfAscension.ID,
				SilverBolts.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);
		}
	}
	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 GameObject Attach<T>(this GameObject go, Action<T> predicate = null, bool allowDuplicates = false) where T : MonoBehaviour
		{
			T obj = (allowDuplicates ? go.gameObject.AddComponent<T>() : GameObjectExtensions.GetOrAddComponent<T>(go.gameObject));
			predicate?.Invoke(obj);
			return go;
		}

		public static List<string> GetResourceFrames(this string baseString, int length)
		{
			List<string> list = new List<string>(length);
			for (int i = 1; i <= length; i++)
			{
				list.Add($"{baseString}_{i:D3}");
			}
			return list;
		}

		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 };
				}
			}
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Ricky2148.etg.LOLItems", "League of legends Items", "3.0.1")]
	public class Plugin : BaseUnityPlugin
	{
		public const string GUID = "Ricky2148.etg.LOLItems";

		public const string NAME = "League of legends Items";

		public const string VERSION = "3.0.1";

		public const string TEXT_COLOR = "#F1C232";

		internal static Harmony _Harmony;

		public void Start()
		{
			ETGModMainBehaviour.WaitForGameManagerStart((Action<GameManager>)GMStart);
		}

		public void GMStart(GameManager g)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			Assets.SetupSpritesFromAssembly(Assembly.GetExecutingAssembly(), "LOLItems/Resources/weapon_sprites");
			SoundManager.LoadSoundbanksFromAssembly((Assembly)null);
			_Harmony = new Harmony("Ricky2148.etg.LOLItems");
			BladeOfTheRuinedKing.Init();
			ExperimentalHexplate.Init();
			GuardianAngel.Init();
			GuinsoosRageblade.Init();
			Hubris.Init();
			KrakenSlayer.Init();
			LiandrysTorment.Init();
			Manamune.Init();
			Muramana.Init();
			StatikkShiv.Init();
			Stridebreaker.Init();
			SunfireAegis.Init();
			Thornmail.Init();
			ZhonyasHourglass.Init();
			Collector.Init();
			FrozenHeart.Init();
			RodOfAges.Init();
			HorizonFocus.Init();
			Puppeteer.Init();
			Galeforce.Init();
			RylaisCrystalScepter.Init();
			Shadowflame.Init();
			NavoriQuickblades.Init();
			BraumsShield.Init();
			ShieldOfMoltenStone.Init();
			CloakOfStarryNight.Init();
			ZekesConvergence.Init();
			Redemption.Init();
			Sheen.Init();
			FatedAshes.Init();
			Cull.Init();
			PerfectlyTimedStopwatch.Init();
			TearOfTheGoddess.Init();
			DetonationOrb.Init();
			RefillablePotion.Init();
			TalismanOfAscension.Init();
			SilverBolts.Init();
			PowPow.Add();
			PowPowAltForm.Add();
			HextechRifle.Add();
			ElectricRifle.Add();
			PrayerBeads.Add();
			Whisper.Add();
			Crossblade.Add();
			VirtueForm1.Add();
			VirtueForm2.Add();
			VirtueForm3.Add();
			SoulSpear.Add();
			Bubbs.Init();
			LOLItemsSynergies.Init();
			Log("League of legends Items v3.0.1 started successfully.", "#F1C232");
			Log("Thirty seconds until minions spawn!", "#155DFC");
		}

		public static void Log(string text, string color = "#FF007F")
		{
			ETGModConsole.Log((object)("<color=" + color + ">" + text + "</color>"), false);
		}
	}
	public static class LOLItemsSynergies
	{
		private static int _NUM_SYNERGIES = Enum.GetNames(typeof(Synergy)).Length;

		public static List<CustomSynergyType> _Synergies = Enumerable.Repeat<CustomSynergyType>((CustomSynergyType)0, _NUM_SYNERGIES).ToList();

		public static List<string> _SynergyNames = Enumerable.Repeat<string>(null, _NUM_SYNERGIES).ToList();

		public static List<string> _SynergyEnums = new List<string>(Enum.GetNames(typeof(Synergy)));

		public static List<int> _SynergyIds = Enumerable.Repeat(0, _NUM_SYNERGIES).ToList();

		public static void InitEnums()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < _SynergyNames.Count; i++)
			{
				_Synergies[i] = _SynergyEnums[i].ExtendEnum<CustomSynergyType>();
			}
		}

		public static T ExtendEnum<T>(this string s) where T : Enum
		{
			return ETGModCompatibility.ExtendEnum<T>("LOLItems".ToUpper(), s);
		}

		public static void Init()
		{
			NewSynergy(LOLItems.Synergy.YOU_DARE_FACE_A_KING, "You dare face a king?!", new string[1] { IName(BladeOfTheRuinedKing.ItemName) }, new string[3] { "crown_of_guns", "gilded_bullets", "coin_crown" });
			NewSynergy(LOLItems.Synergy.FOR_ISOLDE, "For Isolde!", new string[1] { IName(BladeOfTheRuinedKing.ItemName) }, new string[2] { "excaliber", "blasphemy" });
			NewSynergy(LOLItems.Synergy.HEAVEN_AND_EARTH_COMBINED, "Heaven and Earth Combined", new string[2]
			{
				IName(CloakOfStarryNight.ItemName),
				IName(ShieldOfMoltenStone.ItemName)
			});
			NewSynergy(LOLItems.Synergy.RETURN_ON_INVESTMENT, "Return on Investment", new string[1] { IName(Collector.ItemName) }, new string[2] { "loot_bag", "briefcase_of_cash" });
			NewSynergy(LOLItems.Synergy.STROKE_OF_LUCK, "Stroke of Luck", new string[2]
			{
				IName(Collector.ItemName),
				"fortunes_favor"
			});
			NewSynergy(LOLItems.Synergy.AN_OFFERING, "An offering", new string[2]
			{
				IName(Collector.ItemName),
				"daruma"
			});
			NewSynergy(LOLItems.Synergy.BETTER_RNG, "Better RNG", new string[2]
			{
				IName(Collector.ItemName),
				"chance_bullets"
			});
			NewSynergy(LOLItems.Synergy.WEAK_EARLY_GAME, "weak early game...", new string[2]
			{
				IName(Cull.ItemName),
				"unfinished_gun"
			});
			NewSynergy(LOLItems.Synergy.BAUSEN_LAW, "Bausen Law", new string[2]
			{
				IName(Cull.ItemName),
				"huntsman"
			});
			NewSynergy(LOLItems.Synergy.LIFE_AND_DEATH, "Life & Death", new string[2]
			{
				IName(DetonationOrb.ItemName),
				"life_orb"
			});
			NewSynergy(LOLItems.Synergy.OVERCHARGED, "OVERCHARGED", new string[2]
			{
				IName(DetonationOrb.ItemName),
				"raiden_coil"
			});
			NewSynergy(LOLItems.Synergy.THAT_GOOD_SHIT, "that GOOD $#%&", new string[2]
			{
				IName(ExperimentalHexplate.ItemName),
				"cigarettes"
			});
			NewSynergy(LOLItems.Synergy.SPEED_BLITZ, "Speed Blitz", new string[1] { IName(ExperimentalHexplate.ItemName) }, new string[5] { "bionic_leg", "shotgun_coffee", "shotga_cola", "ballistic_boots", "magic_sweet" });
			NewSynergy(LOLItems.Synergy.FILLER_UP, "Fill'Er-Up", new string[2]
			{
				IName(ExperimentalHexplate.ItemName),
				"gungine"
			});
			NewSynergy(LOLItems.Synergy.ICE_TO_THE_CORE, "Ice to the core", new string[1] { IName(FrozenHeart.ItemName) }, new string[3] { "frost_bullets", "snowballets", "heart_of_ice" });
			NewSynergy(LOLItems.Synergy.FROZEN_BULLETS, "Frozen Bullets", new string[1] { IName(FrozenHeart.ItemName) }, new string[2] { "cold_45", "frost_giant" });
			NewSynergy(LOLItems.Synergy.DIVINE_JUDGEMENT, "Divine Judgement!", new string[2]
			{
				IName(GuardianAngel.ItemName),
				VirtueForm3.internalName
			});
			NewSynergy(LOLItems.Synergy.WHY_WONT_YOU_DIE, "Why won't you DIE!", new string[1] { IName(GuardianAngel.ItemName) }, new string[3] { "clone", "gun_soul", "pig" });
			NewSynergy(LOLItems.Synergy.BLADES_OF_CHAOS, "Blades of Chaos", new string[1] { IName(GuinsoosRageblade.ItemName) }, new string[2] { "chaos_ammolet", "chaos_bullets" });
			NewSynergy(LOLItems.Synergy.POSEIGUNS_WRATH, "Poseigun's Wrath", new string[2]
			{
				IName(GuinsoosRageblade.ItemName),
				"trident"
			});
			NewSynergy(LOLItems.Synergy.TRIPLE_DELUXE, "TRIPLE DELUXE", new string[3]
			{
				IName(GuinsoosRageblade.ItemName),
				IName(BladeOfTheRuinedKing.ItemName),
				IName(KrakenSlayer.ItemName)
			});
			NewSynergy(LOLItems.Synergy.AMPLIFIED_LENS, "Amplified Lens", new string[1] { IName(HorizonFocus.ItemName) }, new string[3] { "sniper_rifle", "m1", "awp" });
			NewSynergy(LOLItems.Synergy.FUTURISTIC_COMPATIBILITY, "Futuristic Compatibility", new string[1] { IName(HorizonFocus.ItemName) }, new string[3]
			{
				"railgun",
				"prototype_railgun",
				HextechRifle.internalName
			});
			NewSynergy(LOLItems.Synergy.GUARANTEED_HIT_IF_IT_HITS, "guaranteed hit \"IF\" it hits", new string[2]
			{
				IName(HorizonFocus.ItemName),
				"eyepatch"
			});
			NewSynergy(LOLItems.Synergy.QUADRATIC_SCALING, "Quadratic Scaling", new string[3]
			{
				IName(Hubris.ItemName),
				"metronome",
				"platinum_bullets"
			});
			NewSynergy(LOLItems.Synergy.GLADITORIAL_CHALLENGE, "Gladitorial Challenge", new string[2]
			{
				IName(Hubris.ItemName),
				"lament_configurum"
			});
			NewSynergy(LOLItems.Synergy.PEACE_AND_WAR, "Peace & War", new string[2]
			{
				IName(Hubris.ItemName),
				"really_special_lute"
			});
			NewSynergy(LOLItems.Synergy.TOP_TIER_FISHING_TOOL, "TOP TIER Fishing Tool", new string[1] { IName(KrakenSlayer.ItemName) }, new string[3] { "siren", "trident", "barrel" });
			NewSynergy(LOLItems.Synergy.ENTANGLEMENT, "Entanglement", new string[2]
			{
				IName(KrakenSlayer.ItemName),
				"abyssal_tentacle"
			});
			NewSynergy(LOLItems.Synergy.MEGALODON_SLAYER, "Megalodon Slayer", new string[2]
			{
				IName(KrakenSlayer.ItemName),
				"compressed_air_tank"
			});
			NewSynergy(LOLItems.Synergy.A_SAILORS_BEST_FRIEND, "A sailor's best friend.", new string[2]
			{
				IName(KrakenSlayer.ItemName),
				"double_vision"
			});
			NewSynergy(LOLItems.Synergy.BUILDS_INTO_LIANDRYS_TORMENT, "builds into Liandry's Torment", new string[2]
			{
				IName(FatedAshes.ItemName),
				IName(LiandrysTorment.ItemName)
			});
			NewSynergy(LOLItems.Synergy.BURNING_VENGENCE, "Burning Vengence", new string[1] { IName(LiandrysTorment.ItemName) }, new string[2] { "phoenix", "napalm_strike" });
			NewSynergy(LOLItems.Synergy.BLAZING_UNIVERSE, "Blazing Universe!", new string[1] { IName(LiandrysTorment.ItemName) }, new string[2] { "hot_lead", "gungeon_pepper" });
			NewSynergy(LOLItems.Synergy.BUILDS_INTO_MANAMUNE, "builds into Manamune", new string[2]
			{
				IName(TearOfTheGoddess.ItemName),
				IName(Manamune.ItemName)
			});
			NewSynergy(LOLItems.Synergy.BLADE_OF_THE_ONI_MANAMUNE, "Blade of the Oni", new string[2]
			{
				IName(Manamune.ItemName),
				"demon_head"
			});
			NewSynergy(LOLItems.Synergy.BLADE_OF_THE_ONI_MURAMANA, "Blade of the Oni", new string[2]
			{
				IName(Muramana.ItemName),
				"demon_head"
			});
			NewSynergy(LOLItems.Synergy.IT_HAS_TO_BE_THIS_WAY, "It Has To Be This Way", new string[2]
			{
				IName(Muramana.ItemName),
				"raiden_coil"
			});
			NewSynergy(LOLItems.Synergy.JETSTREAM_SAM, "Jetstream Sam", new string[2]
			{
				IName(Muramana.ItemName),
				"bionic_leg"
			});
			NewSynergy(LOLItems.Synergy.SPONSORED_BY_NAVORI, "*sponsored by Navori*", new string[1] { IName(NavoriQuickblades.ItemName) }, new string[2] { "knife_shield", "katana_bullets" });
			NewSynergy(LOLItems.Synergy.QUICKBLADES_AND_QUICKBULLETS, "Quickblades and Quickbullets", new string[2]
			{
				IName(NavoriQuickblades.ItemName),
				"rocket_powered_bullets"
			});
			NewSynergy(LOLItems.Synergy.LIGHTSLINGER, "Lightslinger", new string[1] { IName(NavoriQuickblades.ItemName) }, new string[2] { "big_iron", "the_judge" });
			NewSynergy(LOLItems.Synergy.PLUS25_CHARM, "+25 Charm", new string[1] { IName(Puppeteer.ItemName) }, new string[4] { "shotgun_full_of_love", "charmed_bow", "really_special_lute", "charming_rounds" });
			NewSynergy(LOLItems.Synergy.CHARMING_REINVIGORATION, "Charming Reinvigoration", new string[2]
			{
				IName(Puppeteer.ItemName),
				"charm_horn"
			});
			NewSynergy(LOLItems.Synergy.SUPER_TRAINING, "Super Training", new string[2]
			{
				IName(RodOfAges.ItemName),
				"macho_brace"
			});
			NewSynergy(LOLItems.Synergy.AGE_OLD_WISDOM, "Age old wisdom", new string[1] { IName(RodOfAges.ItemName) }, new string[3] { "old_knights_shield", "old_knights_helm", "old_knights_flask" });
			NewSynergy(LOLItems.Synergy.ARCANE_MASTERY, "Arcane Mastery", new string[3]
			{
				IName(RodOfAges.ItemName),
				"bundle_of_wands",
				"staff_of_firepower"
			});
			NewSynergy(LOLItems.Synergy.ICE_II, "Ice II", new string[1] { IName(RylaisCrystalScepter.ItemName) }, new string[4] { "ice_breaker", "freeze_ray", "glacier", "snowballer" });
			NewSynergy(LOLItems.Synergy.WITCHCRAFT, "witchcraft...", new string[1] { IName(RylaisCrystalScepter.ItemName) }, new string[2] { "witch_pistol", "hexagun" });
			NewSynergy(LOLItems.Synergy.HELLS_SHADOWS, "Hell's Shadows", new string[1] { IName(Shadowflame.ItemName) }, new string[2] { "pitchfork", "demon_head" });
			NewSynergy(LOLItems.Synergy.SOLAR_FLAME, "Solar Flame", new string[2]
			{
				IName(Shadowflame.ItemName),
				"sunlight_javelin"
			});
			NewSynergy(LOLItems.Synergy.EXTRA_SILVER, "Extra Silver", new string[2]
			{
				IName(SilverBolts.ItemName),
				"silver_bullets"
			});
			NewSynergy(LOLItems.Synergy.THE_NIGHT_HUNTER, "The Night Hunter", new string[2]
			{
				IName(SilverBolts.ItemName),
				"crossbow"
			});
			NewSynergy(LOLItems.Synergy.STATIKK_ELECTRICITY, "statikk electricity", new string[1] { IName(StatikkShiv.ItemName) }, new string[2] { "thunderclap", "laser_lotus" });
			NewSynergy(LOLItems.Synergy.MO_LIGHTNING, "Mo' Lightning!", new string[2]
			{
				IName(StatikkShiv.ItemName),
				"shock_rounds"
			});
			NewSynergy(LOLItems.Synergy.EMPEROR_OF_LIGHTNING, "EMPEROR OF LIGHTNING", new string[2]
			{
				IName(StatikkShiv.ItemName),
				"the_emperor"
			});
			NewSynergy(LOLItems.Synergy.TRUE_SUN_GOD, "TRUE SUN GOD", new string[2]
			{
				IName(SunfireAegis.ItemName),
				"sunlight_javelin"
			});
			NewSynergy(LOLItems.Synergy.VOLTAGE_NOVA, "Voltage Nova", new string[2]
			{
				IName(SunfireAegis.ItemName),
				"gungeon_pepper"
			});
			NewSynergy(LOLItems.Synergy.ICE_COLD_THORNS, "Ice cold thorns", new string[2]
			{
				IName(Thornmail.ItemName),
				"heart_of_ice"
			});
			NewSynergy(LOLItems.Synergy.THORN_MAELSTROM, "Thorn Maelstrom", new string[2]
			{
				IName(Thornmail.ItemName),
				"armor_of_thorns"
			});
			NewSynergy(LOLItems.Synergy.OW_SPLINTER, "Ow! Splinter", new string[2]
			{
				IName(Thornmail.ItemName),
				"wood_beam"
			});
			NewSynergy(LOLItems.Synergy.ABSOLUTE_CONVERGENCE, "ABSOLUTE CONVERGENCE", new string[2]
			{
				IName(ZekesConvergence.ItemName),
				"dark_marker"
			});
			NewSynergy(LOLItems.Synergy.FLAME_OVER_ICE, "Flame > Ice", new string[3]
			{
				IName(ZekesConvergence.ItemName),
				"hot_lead",
				"phoenix"
			});
			NewSynergy(LOLItems.Synergy.ICE_OVER_FLAME, "Ice > Flame", new string[3]
			{
				IName(ZekesConvergence.ItemName),
				"frost_giant",
				"frost_bullets"
			});
			NewSynergy(LOLItems.Synergy.GALEFORCE_FOUR, "FOUR!", new string[2]
			{
				IName(Galeforce.ItemName),
				Whisper.internalName
			});
			NewSynergy(LOLItems.Synergy.BOW_MASTERY, "Bow Mastery", new string[1] { IName(Galeforce.ItemName) }, new string[3] { "bow", "charmed_bow", "gunbow" });
			NewSynergy(LOLItems.Synergy.ENLIGHTENED_BULLETS, "Enlightened Bullets", new string[2]
			{
				IName(Redemption.ItemName),
				"silver_bullets"
			});
			NewSynergy(LOLItems.Synergy.TERROR_TO_THE_GUNDEAD, "Terror to the Gundead", new string[2]
			{
				IName(Redemption.ItemName),
				"mourning_star"
			});
			NewSynergy(LOLItems.Synergy.BUNCH_O_POTIONS, "BunchO Potions", new string[2]
			{
				IName(RefillablePotion.ItemName),
				"old_knights_flask"
			});
			NewSynergy(LOLItems.Synergy.COCKTAIL_POTION, "Cocktail Potion", new string[1] { IName(RefillablePotion.ItemName) }, new string[2] { "potion_of_lead_skin", "potion_of_gun_friendship" });
			NewSynergy(LOLItems.Synergy.DEMACIAN_TRAITOR, "Demacian Traitor", new string[2]
			{
				IName(Stridebreaker.ItemName),
				"betrayers_shield"
			});
			NewSynergy(LOLItems.Synergy.BUILDS_INTO_ZHONYAS_HOURGLASS, "builds into Zhonya's Hourglass", new string[2]
			{
				IName(PerfectlyTimedStopwatch.ItemName),
				IName(ZhonyasHourglass.ItemName)
			});
			NewSynergy(LOLItems.Synergy.CHAOS_CONTROL, "CHAOS CONTROL!", new string[3]
			{
				IName(ZhonyasHourglass.ItemName),
				"chaos_bullets",
				"chaos_bullets"
			});
			NewSynergy(LOLItems.Synergy.SEVEN_SECONDS_REMAIN, "Seven seconds remain...", new string[2]
			{
				IName(ZhonyasHourglass.ItemName),
				"super_hot_watch"
			});
			NewSynergy(LOLItems.Synergy.BOUNCEMAXXING, "Bouncemaxxing", new string[1] { Crossblade.internalName }, new string[2] { "bouncy_bullets", "boomerang" });
			NewSynergy(LOLItems.Synergy.ME_MISS_NOT_BY_A_LONG_SHOT, "\"Me, miss? Not by a long shot.\"", new string[1] { HextechRifle.internalName }, new string[2] { "scope", "laser_sight" });
			NewSynergy(LOLItems.Synergy.RUNAANS_BULLETS, "Runaan's Bullets", new string[2]
			{
				PowPow.internalName,
				"scattershot"
			});
			NewSynergy(LOLItems.Synergy.THREE_PRONGED_SPEARS, "Three-pronged spears", new string[1] { SoulSpear.internalName }, new string[2] { "trident", "pitchfork" });
			NewSynergy(LOLItems.Synergy.EXP_SHARE_FORM_1, "EXP. Share", new string[1] { VirtueForm1.internalName }, new string[3] { "macho_brace", "scouter", "life_orb" });
			NewSynergy(LOLItems.Synergy.EXP_SHARE_FORM_2, "EXP. Share", new string[1] { VirtueForm2.internalName }, new string[3] { "macho_brace", "scouter", "life_orb" });
			NewSynergy(LOLItems.Synergy.EXP_SHARE_FORM_3, "EXP. Share", new string[1] { VirtueForm3.internalName }, new string[3] { "macho_brace", "scouter", "life_orb" });
		}

		private static AdvancedSynergyEntry NewSynergy(Synergy synergy, string name, string[] mandatory, string[] optional = null, bool ignoreLichEyeBullets = false)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			AdvancedSynergyEntry result = RegisterSynergy(_Synergies[(int)synergy], name, mandatory.ToList(), optional?.ToList(), ignoreLichEyeBullets);
			_SynergyNames[(int)synergy] = name;
			_SynergyIds[(int)synergy] = GameManager.Instance.SynergyManager.synergies.Length - 1;
			return result;
		}

		public static AdvancedSynergyEntry RegisterSynergy(CustomSynergyType synergy, string name, List<string> mandatoryConsoleIDs, List<string> optionalConsoleIDs = null, bool ignoreLichEyeBullets = false)
		{
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Expected O, but got Unknown
			List<int> list = new List<int>();
			List<int> list2 = new List<int>();
			List<int> list3 = new List<int>();
			List<int> list4 = new List<int>();
			foreach (string mandatoryConsoleID in mandatoryConsoleIDs)
			{
				PickupObject val = Game.Items[mandatoryConsoleID];
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Component)val).GetComponent<Gun>()))
				{
					list2.Add(val.PickupObjectId);
				}
				else if (Object.op_Implicit((Object)(object)val) && (Object.op_Implicit((Object)(object)((Component)val).GetComponent<PlayerItem>()) || Object.op_Implicit((Object)(object)((Component)val).GetComponent<PassiveItem>())))
				{
					list.Add(val.PickupObjectId);
				}
			}
			if (optionalConsoleIDs != null)
			{
				foreach (string optionalConsoleID in optionalConsoleIDs)
				{
					PickupObject val2 = Game.Items[optionalConsoleID];
					if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)((Component)val2).GetComponent<Gun>()))
					{
						list4.Add(val2.PickupObjectId);
					}
					else if (Object.op_Implicit((Object)(object)val2) && (Object.op_Implicit((Object)(object)((Component)val2).GetComponent<PlayerItem>()) || Object.op_Implicit((Object)(object)((Component)val2).GetComponent<PassiveItem>())))
					{
						list3.Add(val2.PickupObjectId);
					}
				}
			}
			string text = "#" + ETGMod.ToID(name).ToUpperInvariant();
			Databases.Strings.Synergy.Set(text, name);
			AdvancedSynergyEntry val3 = new AdvancedSynergyEntry
			{
				NameKey = text,
				MandatoryItemIDs = list,
				MandatoryGunIDs = list2,
				OptionalItemIDs = list3,
				OptionalGunIDs = list4,
				bonusSynergies = new List<CustomSynergyType> { synergy },
				statModifiers = new List<StatModifier>(),
				IgnoreLichEyeBullets = ignoreLichEyeBullets
			};
			int num = GameManager.Instance.SynergyManager.synergies.Length;
			Array.Resize(ref GameManager.Instance.SynergyManager.synergies, num + 1);
			GameManager.Instance.SynergyManager.synergies[num] = val3;
			return val3;
		}

		private static string IName(string itemName)
		{
			return "LOLItems:" + ETGMod.ToID(itemName);
		}

		public static CustomSynergyType Synergy(this Synergy synergy)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return _Synergies[(int)synergy];
		}

		public static string SynergyName(this Synergy synergy)
		{
			return _SynergyNames[(int)synergy];
		}

		public static bool HasSynergy(this PlayerController player, Synergy synergy)
		{
			return player.ActiveExtraSynergies.Contains(_SynergyIds[(int)synergy]);
		}
	}
	public enum Synergy
	{
		RETURN_ON_INVESTMENT,
		STROKE_OF_LUCK,
		AN_OFFERING,
		BETTER_RNG,
		HEAVEN_AND_EARTH_COMBINED,
		ICE_TO_THE_CORE,
		FROZEN_BULLETS,
		GALEFORCE_FOUR,
		BOW_MASTERY,
		SUPER_TRAINING,
		AGE_OLD_WISDOM,
		YOU_DARE_FACE_A_KING,
		FOR_ISOLDE,
		BOUNCEMAXXING,
		ME_MISS_NOT_BY_A_LONG_SHOT,
		EXP_SHARE_FORM_1,
		EXP_SHARE_FORM_2,
		EXP_SHARE_FORM_3,
		WEAK_EARLY_GAME,
		BAUSEN_LAW,
		THAT_GOOD_SHIT,
		SPEED_BLITZ,
		FILLER_UP,
		DIVINE_JUDGEMENT,
		WHY_WONT_YOU_DIE,
		BUNCH_O_POTIONS,
		COCKTAIL_POTION,
		BLADES_OF_CHAOS,
		POSEIGUNS_WRATH,
		TRIPLE_DELUXE,
		AMPLIFIED_LENS,
		FUTURISTIC_COMPATIBILITY,
		GUARANTEED_HIT_IF_IT_HITS,
		QUADRATIC_SCALING,
		GLADITORIAL_CHALLENGE,
		PEACE_AND_WAR,
		TOP_TIER_FISHING_TOOL,
		ENTANGLEMENT,
		MEGALODON_SLAYER,
		A_SAILORS_BEST_FRIEND,
		BUILDS_INTO_LIANDRYS_TORMENT,
		BUILDS_INTO_MANAMUNE,
		BUILDS_INTO_ZHONYAS_HOURGLASS,
		BLADE_OF_THE_ONI_MANAMUNE,
		BLADE_OF_THE_ONI_MURAMANA,
		IT_HAS_TO_BE_THIS_WAY,
		JETSTREAM_SAM,
		BURNING_VENGENCE,
		BLAZING_UNIVERSE,
		SPONSORED_BY_NAVORI,
		QUICKBLADES_AND_QUICKBULLETS,
		LIGHTSLINGER,
		PLUS25_CHARM,
		CHARMING_REINVIGORATION,
		ARCANE_MASTERY,
		ICE_II,
		WITCHCRAFT,
		HELLS_SHADOWS,
		SOLAR_FLAME,
		STATIKK_ELECTRICITY,
		MO_LIGHTNING,
		EMPEROR_OF_LIGHTNING,
		TRUE_SUN_GOD,
		VOLTAGE_NOVA,
		ICE_COLD_THORNS,
		THORN_MAELSTROM,
		OW_SPLINTER,
		ABSOLUTE_CONVERGENCE,
		FLAME_OVER_ICE,
		ICE_OVER_FLAME,
		ENLIGHTENED_BULLETS,
		TERROR_TO_THE_GUNDEAD,
		DEMACIAN_TRAITOR,
		CHAOS_CONTROL,
		SEVEN_SECONDS_REMAIN,
		THREE_PRONGED_SPEARS,
		RUNAANS_BULLETS,
		EXTRA_SILVER,
		THE_NIGHT_HUNTER,
		LIFE_AND_DEATH,
		OVERCHARGED
	}
}
namespace LOLItems.weapons
{
	internal class Crossblade : AdvancedGunBehavior
	{
		public static string internalName = "Crossblade";

		public static int ID;

		public static string realName = "Crossblade";

		private static int ammoStat = 250;

		private static float reloadDuration = 0f;

		private static float fireRateStat = 0.6f;

		private static int spreadAngle = 5;

		private static int ricochetRange = 5;

		private static int ricochetCount = 8;

		private static float ricochetDamageScale = 0.4f;

		private static float ricochetSpeedScale = 0.5f;

		private static float projectileDamageStat = 10f;

		private static float projectileSpeedS