Decompiled source of ShadeCards v1.2.3

ShadeCards.dll

Decompiled 2 weeks 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.Versioning;
using BepInEx;
using BepInEx.Configuration;
using GunChargePatch.Extensions;
using HarmonyLib;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using ModdingUtils.AIMinion.Patches;
using ModdingUtils.MonoBehaviours;
using ModdingUtils.Utils;
using ModsPlus;
using Photon.Pun;
using Shade;
using Shade.Extensions;
using Sonigon;
using Sonigon.Internal;
using TMPro;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.GameModes;
using UnboundLib.Utils.UI;
using UnityEngine;
using UnityEngine.Events;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")]
[assembly: AssemblyVersion("0.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public class Shade_Explosion : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <>c__DisplayClass33_0 : Object
	{
		public LineEffect tempEffect;

		internal void <Explode>b__0()
		{
			tempEffect.Stop();
			((Component)tempEffect).gameObject.SetActive(false);
			Object.Destroy((Object)(object)((Component)tempEffect).gameObject);
		}
	}

	[Header("Sounds")]
	public SoundEvent soundDamage;

	[Header("Settings")]
	public float slow;

	public float silence;

	public bool fastSlow;

	public float stun;

	public float force = 2000f;

	public float objectForceMultiplier = 1f;

	public bool forceIgnoreMass;

	public float damage = 25f;

	public Color dmgColor = Color.black;

	public float range = 5f;

	public float flyingFor;

	public bool auto = true;

	public bool ignoreTeam;

	public bool ignoreWalls;

	public bool staticRangeMultiplier;

	public bool scaleSlow = true;

	public bool scaleSilence = true;

	public bool scaleDmg = true;

	public bool scaleRadius = true;

	public bool scaleStun = true;

	public bool scaleForce = true;

	public float immunity;

	public SpawnedAttack spawned;

	public bool locallySimulated;

	public Action<Damagable> DealDamageAction;

	public Action<Damagable> DealHealAction;

	public Action<Damagable, float> HitTargetAction;

	public PhotonView view;

	public Action<CharacterData, float> hitPlayerAction;

	public GameObject particles = null;

	private bool angleIsCorrect(float angle, bool forwards)
	{
		if (forwards)
		{
			return angle < 60f;
		}
		return angle > 140f;
	}

	private void DoExplosionEffects(Collider2D hitCol, float rangeMultiplier, float distance)
	{
		//IL_0016: 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_0056: 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_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0578: Unknown result type (might be due to invalid IL or missing references)
		//IL_057d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0587: Unknown result type (might be due to invalid IL or missing references)
		//IL_058c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0591: Unknown result type (might be due to invalid IL or missing references)
		//IL_059c: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_05af: Unknown result type (might be due to invalid IL or missing references)
		//IL_05b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_05c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_05c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0440: Unknown result type (might be due to invalid IL or missing references)
		//IL_0445: Unknown result type (might be due to invalid IL or missing references)
		//IL_044f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0454: Unknown result type (might be due to invalid IL or missing references)
		//IL_0459: Unknown result type (might be due to invalid IL or missing references)
		//IL_0464: Unknown result type (might be due to invalid IL or missing references)
		//IL_0469: Unknown result type (might be due to invalid IL or missing references)
		//IL_046e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0473: Unknown result type (might be due to invalid IL or missing references)
		//IL_0477: Unknown result type (might be due to invalid IL or missing references)
		//IL_047d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0488: Unknown result type (might be due to invalid IL or missing references)
		//IL_048e: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04da: Unknown result type (might be due to invalid IL or missing references)
		//IL_04df: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_04fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0503: Unknown result type (might be due to invalid IL or missing references)
		//IL_050e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0514: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02de: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0302: Unknown result type (might be due to invalid IL or missing references)
		//IL_0306: Unknown result type (might be due to invalid IL or missing references)
		//IL_030b: Unknown result type (might be due to invalid IL or missing references)
		//IL_030d: Unknown result type (might be due to invalid IL or missing references)
		//IL_030f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0342: Unknown result type (might be due to invalid IL or missing references)
		//IL_0344: Unknown result type (might be due to invalid IL or missing references)
		//IL_0320: Unknown result type (might be due to invalid IL or missing references)
		//IL_0325: Unknown result type (might be due to invalid IL or missing references)
		//IL_0378: Unknown result type (might be due to invalid IL or missing references)
		//IL_037a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0385: Unknown result type (might be due to invalid IL or missing references)
		//IL_038a: Unknown result type (might be due to invalid IL or missing references)
		float num = (scaleDmg ? ((Component)this).transform.localScale.x : 1f);
		float num2 = (scaleForce ? ((Component)this).transform.localScale.x : 1f);
		float num3 = (scaleSlow ? ((Component)this).transform.localScale.x : 1f);
		float num4 = (scaleSilence ? ((Component)this).transform.localScale.x : 1f);
		float num5 = (scaleStun ? ((1f + ((Component)this).transform.localScale.x) * 0.5f) : 1f);
		Damagable componentInParent = ((Component)hitCol).gameObject.GetComponentInParent<Damagable>();
		CharacterData val = null;
		Bounds bounds;
		Vector2 val2;
		if (Object.op_Implicit((Object)(object)componentInParent))
		{
			val = ((Component)hitCol).gameObject.GetComponentInParent<CharacterData>();
			if ((immunity > 0f && Object.op_Implicit((Object)(object)val) && ((Component)val).GetComponent<PlayerImmunity>().IsImune(immunity, num * damage * rangeMultiplier, ((Object)((Component)this).gameObject).name)) || (!ignoreWalls && Object.op_Implicit((Object)(object)val) && !PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)this).transform.position), val.player).canSee))
			{
				return;
			}
			if (slow != 0f && Object.op_Implicit((Object)(object)((Component)componentInParent).GetComponent<CharacterStatModifiers>()) && locallySimulated && spawned.IsMine() && !val.block.IsBlocking())
			{
				val.stats.RPCA_AddSlow(slow * rangeMultiplier * num3, fastSlow);
			}
			if (Object.op_Implicit((Object)(object)spawned))
			{
				Player spawner = spawned.spawner;
			}
			hitPlayerAction?.Invoke(val, rangeMultiplier);
			if (damage < 0f)
			{
				if (Object.op_Implicit((Object)(object)val))
				{
					val.healthHandler.Heal(0f - damage);
				}
				if (DealHealAction != null)
				{
					DealHealAction.Invoke(componentInParent);
				}
			}
			else if (damage > 0f)
			{
				if ((Object)(object)soundDamage != (Object)null && (Object)(object)val != (Object)null)
				{
					SoundManager.Instance.Play(soundDamage, ((Component)val).transform);
				}
				bounds = hitCol.bounds;
				val2 = Vector2.op_Implicit(((Bounds)(ref bounds)).ClosestPoint(((Component)this).transform.position)) - Vector2.op_Implicit(((Component)this).transform.position);
				Vector2 val3 = ((Vector2)(ref val2)).normalized;
				if (val3 == Vector2.zero)
				{
					val3 = Vector2.up;
				}
				Debug.Log(String.Format("Should deal {0} damage, improved to {1}", (object)damage, (object)(num * damage * rangeMultiplier * val3)));
				if (spawned.IsMine())
				{
					componentInParent.CallTakeDamage(num * damage * rangeMultiplier * val3, Vector2.op_Implicit(((Component)this).transform.position), (GameObject)null, spawned.spawner, true);
				}
				if (DealDamageAction != null)
				{
					DealDamageAction.Invoke(componentInParent);
				}
			}
		}
		if (Object.op_Implicit((Object)(object)val))
		{
			if (HitTargetAction != null)
			{
				HitTargetAction.Invoke(componentInParent, distance);
			}
			if (force != 0f)
			{
				Debug.Log(String.Format("Basic force applied: {0}", (object)force));
				if (locallySimulated)
				{
					HealthHandler healthHandler = val.healthHandler;
					bounds = hitCol.bounds;
					val2 = Vector2.op_Implicit(((Bounds)(ref bounds)).ClosestPoint(((Component)this).transform.position)) - Vector2.op_Implicit(((Component)this).transform.position);
					healthHandler.TakeForce(((Vector2)(ref val2)).normalized * rangeMultiplier * force * num2, (ForceMode2D)1, forceIgnoreMass, false, 0f);
				}
				else if (spawned.IsMine())
				{
					HealthHandler healthHandler2 = val.healthHandler;
					bounds = hitCol.bounds;
					val2 = Vector2.op_Implicit(((Bounds)(ref bounds)).ClosestPoint(((Component)this).transform.position)) - Vector2.op_Implicit(((Component)this).transform.position);
					healthHandler2.CallTakeForce(((Vector2)(ref val2)).normalized * rangeMultiplier * force * num2, (ForceMode2D)1, forceIgnoreMass, false, flyingFor * rangeMultiplier);
				}
			}
			if (stun > 0f)
			{
				val.stunHandler.AddStun(stun * num5);
			}
		}
		else if (Object.op_Implicit((Object)(object)hitCol.attachedRigidbody))
		{
			Rigidbody2D attachedRigidbody = hitCol.attachedRigidbody;
			bounds = hitCol.bounds;
			val2 = Vector2.op_Implicit(((Bounds)(ref bounds)).ClosestPoint(((Component)this).transform.position)) - Vector2.op_Implicit(((Component)this).transform.position);
			attachedRigidbody.AddForce(((Vector2)(ref val2)).normalized * rangeMultiplier * force * num2, (ForceMode2D)1);
		}
	}

	public void Explode(Player player, Vector3 facing_dir, LineEffect lineEffect, bool forwards)
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0378: Unknown result type (might be due to invalid IL or missing references)
		//IL_0370: Unknown result type (might be due to invalid IL or missing references)
		//IL_0371: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_038c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0398: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_0128: 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)
		//IL_0135: Unknown result type (might be due to invalid IL or missing references)
		//IL_013f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0144: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0204: Unknown result type (might be due to invalid IL or missing references)
		//IL_020f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0219: Unknown result type (might be due to invalid IL or missing references)
		//IL_0220: Unknown result type (might be due to invalid IL or missing references)
		//IL_022b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0232: Unknown result type (might be due to invalid IL or missing references)
		//IL_0237: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0300: Expected O, but got Unknown
		float num = (scaleRadius ? ((Component)this).transform.localScale.x : 1f);
		Collider2D[] array = Physics2D.OverlapCircleAll(Vector2.op_Implicit(((Component)this).transform.position), range * num);
		for (int i = 0; i < array.Length; i++)
		{
			if (((Component)array[i]).gameObject.layer == 19 || !((Object)(object)((Component)((Component)array[i]).transform).gameObject != (Object)(object)((Component)player).gameObject))
			{
				continue;
			}
			float num2 = Vector2.Angle(Vector2.op_Implicit(((Component)array[i]).transform.position - ((Component)player).transform.position), Vector2.op_Implicit(facing_dir));
			Debug.Log(String.Format("Angle between {0} and {1} is {2}", (object)(((Component)array[i]).transform.position - ((Component)player).transform.position), (object)facing_dir, (object)num2));
			if (!angleIsCorrect(num2, forwards))
			{
				continue;
			}
			Debug.Log("Passed");
			Damagable componentInParent = ((Component)array[i]).gameObject.GetComponentInParent<Damagable>();
			Vector2 val = Vector2.op_Implicit(((Component)this).transform.position);
			Bounds bounds = array[i].bounds;
			float num3 = Vector2.Distance(val, Vector2.op_Implicit(((Bounds)(ref bounds)).ClosestPoint(((Component)this).transform.position)));
			float num4 = 1f - num3 / (range * num);
			if (staticRangeMultiplier)
			{
				num4 = 1f;
			}
			num4 = Mathf.Clamp(num4, 0f, 1f);
			NetworkPhysicsObject component = ((Component)array[i]).GetComponent<NetworkPhysicsObject>();
			if (Object.op_Implicit((Object)(object)component) && component.photonView.IsMine)
			{
				float num5 = (scaleForce ? ((Component)this).transform.localScale.x : 1f);
				Vector3 val2 = ((Component)component).transform.position - ((Component)this).transform.position;
				component.BulletPush(Vector2.op_Implicit(((Vector3)(ref val2)).normalized) * objectForceMultiplier * 1f * num4 * force * num5, Vector2.zero, (CharacterData)null);
			}
			if ((!Object.op_Implicit((Object)(object)componentInParent) && !Object.op_Implicit((Object)(object)array[i].attachedRigidbody)) || (ignoreTeam && Object.op_Implicit((Object)(object)spawned) && (Object)(object)((Component)spawned.spawner).gameObject == (Object)(object)((Component)((Component)array[i]).transform).gameObject))
			{
				continue;
			}
			if (ShadeCards.DEBUG.Value)
			{
				<>c__DisplayClass33_0 CS$<>8__locals0 = new <>c__DisplayClass33_0();
				CS$<>8__locals0.tempEffect = Object.Instantiate<LineEffect>(lineEffect);
				CS$<>8__locals0.tempEffect.Play(((Component)player).transform, ((Component)array[i]).transform, 0f);
				ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)this, 0.125f, (Action)delegate
				{
					CS$<>8__locals0.tempEffect.Stop();
					((Component)CS$<>8__locals0.tempEffect).gameObject.SetActive(false);
					Object.Destroy((Object)(object)((Component)CS$<>8__locals0.tempEffect).gameObject);
				});
			}
			DoExplosionEffects(array[i], num4, num3);
		}
		if ((Object)(object)particles != (Object)null)
		{
			Debug.Log(String.Format("Facing direction: {0}", (object)forwards));
			GameObject val3 = Object.Instantiate<GameObject>(particles, ((Component)player).transform, true);
			val3.transform.LookAt(forwards ? facing_dir : (-facing_dir));
			val3.transform.position = ((Component)player).transform.position + val3.transform.forward * 2f;
		}
		else
		{
			Debug.Log("Shade_Explosion particles was null");
		}
	}
}
public class Adrenaline : PlayerHook
{
	public float HP_amount = 2f;

	public float damage_amount = 2f;

	public float shot_speed_amount = 2f;

	private StatChanges stat_changes;

	private StatChangeTracker stat_changes_tracker;

	protected override void Start()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: 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_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Expected O, but got Unknown
		stat_changes = new StatChanges
		{
			MaxHealth = HP_amount,
			Damage = damage_amount,
			BulletSpeed = shot_speed_amount
		};
		((CardEffect)this).Start();
	}

	public override void OnReloadDone(int bulletsReloaded)
	{
		StatManager.Remove(stat_changes_tracker);
		((CardEffect)this).OnReloadDone(bulletsReloaded);
	}

	public override void OnOutOfAmmo(int bulletsReloaded)
	{
		stat_changes_tracker = StatManager.Apply(((CardEffect)this).player, stat_changes);
		((CardEffect)this).OnOutOfAmmo(bulletsReloaded);
	}
}
public class BackBlast : DirectedExplosion
{
	protected override void Awake()
	{
		forwards = false;
		((PlayerHook)this).Awake();
		BackBlast[] componentsInChildren = ((Component)((CardEffect)this).player).GetComponentsInChildren<BackBlast>();
		if (componentsInChildren.Length > 1)
		{
			Enumerable.First<BackBlast>((IEnumerable<BackBlast>)(object)componentsInChildren, (Func<BackBlast, bool>)([CompilerGenerated] (BackBlast e) => (Object)(object)e != (Object)(object)this)).Upgrade();
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
public class CardHolder : MonoBehaviour
{
	public List<GameObject> Cards;

	public List<GameObject> HiddenCards;

	internal void RegisterCards()
	{
		//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_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		Enumerator<GameObject> enumerator = Cards.GetEnumerator();
		try
		{
			while (enumerator.MoveNext())
			{
				GameObject current = enumerator.Current;
				CustomCard.RegisterUnityCard(current, ShadeCards.modInitials, current.GetComponent<CardInfo>().cardName, true, (Action<CardInfo>)null);
			}
		}
		finally
		{
			((IDisposable)enumerator).Dispose();
		}
		Enumerator<GameObject> enumerator2 = HiddenCards.GetEnumerator();
		try
		{
			while (enumerator2.MoveNext())
			{
				GameObject current2 = enumerator2.Current;
				CustomCard.RegisterUnityCard(current2, ShadeCards.modInitials, current2.GetComponent<CardInfo>().cardName, false, (Action<CardInfo>)null);
				Cards.instance.AddHiddenCard(current2.GetComponent<CardInfo>());
			}
		}
		finally
		{
			((IDisposable)enumerator2).Dispose();
		}
	}
}
public class DirectedExplosion : PlayerHook
{
	[CompilerGenerated]
	private sealed class <>c__DisplayClass15_0 : Object
	{
		public GameObject projectile;

		public DirectedExplosion <>4__this;

		public float gun_dmg_cap;

		public Shade_Explosion s_explode;

		internal void <Emit_DirectedExplosion>b__0()
		{
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)projectile))
			{
				Debug.Log(String.Format("Blast - Damage Total: {0}. Force Total: {1}", (object)(<>4__this.blastDamage * <>4__this.blastDamageMult * gun_dmg_cap), (object)(<>4__this.blastForce * <>4__this.blastForceMult * gun_dmg_cap)));
				s_explode.damage = <>4__this.blastDamage * <>4__this.blastDamageMult * gun_dmg_cap;
				s_explode.force = <>4__this.blastForce * <>4__this.blastForceMult * gun_dmg_cap;
				s_explode.range = <>4__this.blastRange;
				s_explode.particles = <>4__this.blastParticles;
				s_explode.Explode(((CardEffect)<>4__this).player, projectile.transform.forward, <>4__this.lineEffect, <>4__this.forwards);
			}
		}
	}

	public float blastRange = 7f;

	public float blastForce = 10000f;

	public float blastForceMult = 1f;

	public float blastDamage = 40f;

	public float blastDamageMult = 1f;

	public float blastStun = 0f;

	public bool scaleRadius = true;

	public bool ignoreWalls = false;

	protected LineEffect lineEffect;

	protected GameObject explosive;

	protected GameObject blastParticles;

	protected bool forwards;

	protected override void Start()
	{
		((CardEffect)this).Start();
		lineEffect = ((Component)this).GetComponentInChildren<LineEffect>(true);
		explosive = ShadeCards.assets.LoadAsset<GameObject>("Shade_DirectedExplosion");
		blastParticles = ShadeCards.assets.LoadAsset<GameObject>("Shade_BurstParticles");
		lineEffect = ShadeCards.assets.LoadAsset<GameObject>("Shade_LineEffect").GetComponent<LineEffect>();
	}

	public void Upgrade()
	{
		blastDamageMult += 1f;
		blastForceMult += 0.5f;
		blastStun += 1f;
	}

	public override void OnShoot(GameObject projectile)
	{
		((CardEffect)this).OnShoot(projectile);
		Emit_DirectedExplosion(projectile);
	}

	protected void Emit_DirectedExplosion(GameObject projectile)
	{
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Expected O, but got Unknown
		<>c__DisplayClass15_0 CS$<>8__locals0 = new <>c__DisplayClass15_0();
		CS$<>8__locals0.projectile = projectile;
		CS$<>8__locals0.<>4__this = this;
		GameObject val = Object.Instantiate<GameObject>(explosive, ((Component)((CardEffect)this).player).transform);
		CS$<>8__locals0.s_explode = val.GetComponent<Shade_Explosion>();
		CS$<>8__locals0.s_explode.spawned = val.GetComponent<SpawnedAttack>();
		CS$<>8__locals0.s_explode.spawned.spawner = ((CardEffect)this).player;
		CS$<>8__locals0.s_explode.view = val.GetComponent<PhotonView>();
		CS$<>8__locals0.gun_dmg_cap = Mathf.Clamp(((CardEffect)this).gun.damage, 0.2f, 1f);
		ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)this, 1, (Action)delegate
		{
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)CS$<>8__locals0.projectile))
			{
				Debug.Log(String.Format("Blast - Damage Total: {0}. Force Total: {1}", (object)(CS$<>8__locals0.<>4__this.blastDamage * CS$<>8__locals0.<>4__this.blastDamageMult * CS$<>8__locals0.gun_dmg_cap), (object)(CS$<>8__locals0.<>4__this.blastForce * CS$<>8__locals0.<>4__this.blastForceMult * CS$<>8__locals0.gun_dmg_cap)));
				CS$<>8__locals0.s_explode.damage = CS$<>8__locals0.<>4__this.blastDamage * CS$<>8__locals0.<>4__this.blastDamageMult * CS$<>8__locals0.gun_dmg_cap;
				CS$<>8__locals0.s_explode.force = CS$<>8__locals0.<>4__this.blastForce * CS$<>8__locals0.<>4__this.blastForceMult * CS$<>8__locals0.gun_dmg_cap;
				CS$<>8__locals0.s_explode.range = CS$<>8__locals0.<>4__this.blastRange;
				CS$<>8__locals0.s_explode.particles = CS$<>8__locals0.<>4__this.blastParticles;
				CS$<>8__locals0.s_explode.Explode(((CardEffect)CS$<>8__locals0.<>4__this).player, CS$<>8__locals0.projectile.transform.forward, CS$<>8__locals0.<>4__this.lineEffect, CS$<>8__locals0.<>4__this.forwards);
			}
		});
	}
}
public class Exp_Toxin : PlayerHook
{
	public float statDuration = 7f;

	public int effectStrength = 2;

	private List<Shade_StatChanges> usableEffects = new List<Shade_StatChanges>();

	private Shade_StatChanges[] temporaryEffects = new Shade_StatChanges[15]
	{
		new Shade_StatChanges
		{
			AttackSpeed = 0.75f
		},
		new Shade_StatChanges
		{
			MovementSpeed = 0.75f
		},
		new Shade_StatChanges
		{
			BulletSpeed = 0.5f
		},
		new Shade_StatChanges
		{
			BulletSpread = 1.5f
		},
		new Shade_StatChanges
		{
			Damage = 0.75f
		},
		new Shade_StatChanges
		{
			JumpHeight = 0.75f
		},
		new Shade_StatChanges
		{
			MaxHealth = 0.75f
		},
		new Shade_StatChanges
		{
			MaxAmmo = -1
		},
		new Shade_StatChanges
		{
			PlayerGravity = 1.5f
		},
		new Shade_StatChanges
		{
			ProjectileGravity = 1.5f
		},
		new Shade_StatChanges
		{
			projectileColor = Color.red
		},
		new Shade_StatChanges
		{
			reloadTime_add = 0.25f
		},
		new Shade_StatChanges
		{
			reloadTime_mult = 1.1f
		},
		new Shade_StatChanges
		{
			size_add = 2f
		},
		new Shade_StatChanges
		{
			slow_add = 0.5f
		}
	};

	public Shade_StatChanges random_status()
	{
		if (usableEffects.Count == 0)
		{
			usableEffects = Enumerable.ToList<Shade_StatChanges>((IEnumerable<Shade_StatChanges>)(object)temporaryEffects);
		}
		int num = Random.Range(0, usableEffects.Count);
		Shade_StatChanges result = Enumerable.ElementAt<Shade_StatChanges>((IEnumerable<Shade_StatChanges>)(object)usableEffects, num);
		usableEffects.RemoveAt(num);
		return result;
	}

	protected override void Awake()
	{
		((PlayerHook)this).Awake();
		Exp_Toxin[] componentsInChildren = ((Component)((CardEffect)this).player).GetComponentsInChildren<Exp_Toxin>();
		if (componentsInChildren.Length > 1)
		{
			Enumerable.First<Exp_Toxin>((IEnumerable<Exp_Toxin>)(object)componentsInChildren, (Func<Exp_Toxin, bool>)([CompilerGenerated] (Exp_Toxin e) => (Object)(object)e != (Object)(object)this)).Upgrade();
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	public void Upgrade()
	{
		statDuration += 10f;
		effectStrength++;
	}

	[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
	public override IEnumerator OnBulletHitCoroutine(GameObject projectile, HitInfo hit)
	{
		if (!Object.op_Implicit((Object)(object)((Component)hit.collider).gameObject.GetComponentInChildren<Player>()) || !((Object)(object)((Component)hit.collider).gameObject.GetComponentInChildren<Player>() != (Object)null))
		{
			yield break;
		}
		Player other = ((Component)hit.collider).gameObject.GetComponentInChildren<Player>();
		Shade_StatChanges random_stat = random_status();
		List<Shade_StatChangeTracker> effects = new List<Shade_StatChangeTracker>();
		for (int i = 0; i < effectStrength; i++)
		{
			effects.Add(SupportClass.Apply(other, random_stat));
		}
		Debug.Log(String.Format("D20: Tried to apply: {0}", (object)effects));
		yield return new WaitForSeconds(statDuration);
		Debug.Log("D20: effect ended");
		Enumerator<Shade_StatChangeTracker> enumerator = effects.GetEnumerator();
		try
		{
			while (enumerator.MoveNext())
			{
				Shade_StatChangeTracker effect = enumerator.Current;
				SupportClass.Remove(effect);
			}
		}
		finally
		{
			((IDisposable)enumerator).Dispose();
		}
	}
}
public class LaserPointer : PlayerHook
{
	[CompilerGenerated]
	private sealed class <>c__DisplayClass8_0 : Object
	{
		public LaserPointer <>4__this;

		public MoveTransform proj;

		internal void <OnShootCoroutine>b__0()
		{
			<>4__this.bullet_gravity = proj.gravity * proj.multiplier;
			Debug.Log(String.Format("Velocity: {0}. Gravity: {1}. Drag: {2}", (object)((Vector3)(ref proj.velocity)).magnitude, (object)proj.gravity, (object)proj.drag));
		}
	}

	private LineRenderer lr;

	private LineRenderer sanityCheck;

	public int sanity_positions = 5;

	public int fidelity = 55;

	private int debug_counter = 0;

	public float bullet_gravity = 30f;

	protected override void Awake()
	{
		//IL_006b: 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)
		((PlayerHook)this).Awake();
		lr = Object.Instantiate<GameObject>(ShadeCards.assets.LoadAsset<GameObject>("Shade_Laser")).GetComponent<LineRenderer>();
		((Renderer)lr).enabled = true;
		lr.positionCount = fidelity;
		sanityCheck = Object.Instantiate<GameObject>(ShadeCards.assets.LoadAsset<GameObject>("Shade_Laser")).GetComponent<LineRenderer>();
		sanityCheck.startColor = Color.green;
		sanityCheck.endColor = Color.cyan;
		sanityCheck.positionCount = sanity_positions;
		sanityCheck.startWidth = 0.15f;
		sanityCheck.endWidth = 0.15f;
		((Renderer)sanityCheck).enabled = true;
	}

	public void Update()
	{
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: 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_007b: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)((CardEffect)this).player) && ((Renderer)lr).enabled && ((CardEffect)this).player.data.view.IsMine)
		{
			lr.SetPositions(Points().ToArray());
			Vector3 val = MainCam.instance.cam.ScreenToWorldPoint(Input.mousePosition) - ((Component)((CardEffect)this).player).transform.position;
			val.z = 0f;
			((Vector3)(ref val)).Normalize();
			Vector3 val2 = ((Component)((CardEffect)this).player).transform.position + val * 2f;
			List<Vector3> val3 = new List<Vector3>();
			for (int i = 0; i < sanity_positions; i++)
			{
				val3.Add(val2 + val * (float)i);
			}
			sanityCheck.SetPositions(val3.ToArray());
		}
	}

	public override IEnumerator OnShootCoroutine(GameObject projectile)
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Expected O, but got Unknown
		<>c__DisplayClass8_0 CS$<>8__locals0 = new <>c__DisplayClass8_0();
		CS$<>8__locals0.<>4__this = this;
		CS$<>8__locals0.proj = projectile.GetComponent<MoveTransform>();
		ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)this, 1, (Action)delegate
		{
			CS$<>8__locals0.<>4__this.bullet_gravity = CS$<>8__locals0.proj.gravity * CS$<>8__locals0.proj.multiplier;
			Debug.Log(String.Format("Velocity: {0}. Gravity: {1}. Drag: {2}", (object)((Vector3)(ref CS$<>8__locals0.proj.velocity)).magnitude, (object)CS$<>8__locals0.proj.gravity, (object)CS$<>8__locals0.proj.drag));
		});
		return ((CardEffect)this).OnShootCoroutine(projectile);
	}

	public override IEnumerator OnPointStart(IGameModeHandler gameModeHandler)
	{
		((Renderer)lr).enabled = true;
		return ((CardEffect)this).OnPointStart(gameModeHandler);
	}

	public override IEnumerator OnPointEnd(IGameModeHandler gameModeHandler)
	{
		((Renderer)lr).enabled = false;
		return ((CardEffect)this).OnPointEnd(gameModeHandler);
	}

	protected override void OnDestroy()
	{
		((Renderer)lr).enabled = false;
		((CardEffect)this).OnDestroy();
		Object.Destroy((Object)(object)lr);
	}

	protected List<Vector3> Points()
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: 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_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0146: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_020a: Unknown result type (might be due to invalid IL or missing references)
		//IL_020f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0215: Unknown result type (might be due to invalid IL or missing references)
		//IL_021a: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = MainCam.instance.cam.ScreenToWorldPoint(Input.mousePosition) - ((Component)this).transform.position;
		val.z = 0f;
		((Vector3)(ref val)).Normalize();
		float num = ((CardEffect)this).gun.projectileSpeed * (55f - Vector2.Angle(Vector2.op_Implicit(val), Vector2.op_Implicit(Vector3.up)) / 18f);
		float num2 = bullet_gravity * 30f;
		float num3 = Vector2.Angle(Vector2.op_Implicit(val), Vector2.op_Implicit(Vector3.up));
		float num4 = num * Mathf.Sin(num3 * ((float)Math.PI / 180f)) * (float)((val.x > 0f) ? 1 : (-1));
		float num5 = num * Mathf.Cos(num3 * ((float)Math.PI / 180f));
		Vector3 val2 = default(Vector3);
		((Vector3)(ref val2))..ctor(num4, num5);
		Vector3 position = ((Component)((CardEffect)this).gun).transform.position;
		Vector3 val3 = ((Component)((CardEffect)this).player).transform.position + val * 2f;
		List<Vector3> val4 = new List<Vector3>();
		float num6 = val3.y;
		float num7 = 1f;
		for (int i = 0; (float)i < num * num7; i++)
		{
			float num8 = (float)i / num;
			val4.Add(position + new Vector3(val2.x * num8, num6, 0f));
			num6 = position.y + num5 * num8 - 0.5f * num2 * Mathf.Pow(num8, 2f);
		}
		if (++debug_counter > 500)
		{
			debug_counter = 0;
			Debug.Log(String.Format("Speed: {0}. X:{1}, Y:{2}", (object)num, (object)num4, (object)num5));
			Debug.Log(String.Format("Laser origin: {0}", (object)val3));
			Debug.Log(String.Format("Laser angle: {0}", (object)num3));
			string text = "";
			Enumerator<Vector3> enumerator = val4.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					Vector3 current = enumerator.Current;
					text = String.Concat(text, ((Object)(Vector3)(ref current)).ToString());
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			Debug.Log(String.Format("Laser Path ({0}): {1}", (object)val4.Count, (object)text));
		}
		return val4;
	}
}
public class LooseCannon : PlayerHook
{
	public float teamDmgMlt = 2f;

	public int numCards = 1;

	protected override void Start()
	{
		((CardEffect)this).Start();
		((CardEffect)this).gun.GenAdditionalData().teamDamageMultiplier *= teamDmgMlt;
	}

	protected override void Awake()
	{
		((PlayerHook)this).Awake();
		LooseCannon[] componentsInChildren = ((Component)((CardEffect)this).player).GetComponentsInChildren<LooseCannon>();
		if (componentsInChildren.Length > 1)
		{
			Enumerable.First<LooseCannon>((IEnumerable<LooseCannon>)(object)componentsInChildren, (Func<LooseCannon, bool>)([CompilerGenerated] (LooseCannon e) => (Object)(object)e != (Object)(object)this)).Upgrade();
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	public void Upgrade()
	{
		numCards++;
		((CardEffect)this).gun.GenAdditionalData().teamDamageMultiplier *= teamDmgMlt;
	}

	protected override void OnDestroy()
	{
		((CardEffect)this).OnDestroy();
		((CardEffect)this).gun.GenAdditionalData().teamDamageMultiplier /= Mathf.Pow(teamDmgMlt, (float)numCards);
	}
}
public class Martyrdom : PlayerHook
{
	private Explosion explosion;

	private float minDamage = 80f;

	private int damageMult = 1;

	protected override void Awake()
	{
		((PlayerHook)this).Awake();
		Martyrdom[] componentsInChildren = ((Component)((CardEffect)this).player).GetComponentsInChildren<Martyrdom>();
		if (componentsInChildren.Length > 1)
		{
			Enumerable.First<Martyrdom>((IEnumerable<Martyrdom>)(object)componentsInChildren, (Func<Martyrdom, bool>)([CompilerGenerated] (Martyrdom e) => (Object)(object)e != (Object)(object)this)).Upgrade();
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	protected override void Start()
	{
		((CardEffect)this).Start();
		ObjectsToSpawn val = Resources.Load<GameObject>("0 cards/Explosive Bullet").GetComponent<Gun>().objectsToSpawn[0];
		GameObject val2 = Object.Instantiate<GameObject>(val.effect);
		((Object)val2).hideFlags = (HideFlags)61;
		((Object)val2).name = "A_SHADE_MartyrExplosion";
		Object.Destroy((Object)(object)val2.GetComponent<RemoveAfterSeconds>());
		val2.AddComponent<SpawnedAttack>().spawner = ((CardEffect)this).player;
		explosion = val2.GetComponent<Explosion>();
		explosion.scaleDmg = true;
		explosion.scaleRadius = true;
		explosion.scaleForce = true;
	}

	public void Upgrade()
	{
		damageMult++;
	}

	public override void OnTakeDamage(Vector2 damage, bool selfDamage)
	{
		if (((CardEffect)this).player.data.health < 0f)
		{
			BlowUp();
		}
	}

	public void BlowUp()
	{
		//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_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
		Vector3 position = ((Component)((CardEffect)this).player).transform.position;
		float x = ((Component)((CardEffect)this).player).transform.localScale.x;
		float num = ((CardEffect)this).gun.damage * ((CardEffect)this).gun.damage;
		explosion.damage = Mathf.Max(num, minDamage) * (float)damageMult;
		explosion.range = 40f;
		explosion.dmgColor = Color.yellow;
		Object.Instantiate<GameObject>(((Component)explosion).gameObject, position, Quaternion.identity).transform.localScale = Vector3.one * x;
	}
}
public class NothinPersonnel : PlayerHook
{
	public float maxCooldown = 5f;

	protected float currentCooldown = 0f;

	public override void OnBlock(BlockTriggerType blockTriggerType)
	{
		//IL_0017: 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_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: 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_0097: Unknown result type (might be due to invalid IL or missing references)
		if (currentCooldown < Time.time)
		{
			((CardEffect)this).OnBlock(blockTriggerType);
			Player closestPlayerInOtherTeam = PlayerManagerExtensions.GetClosestPlayerInOtherTeam(PlayerManager.instance, ((Component)((CardEffect)this).player).transform.position, ((CardEffect)this).player.teamID, false);
			if ((Object)(object)closestPlayerInOtherTeam != (Object)null)
			{
				currentCooldown = maxCooldown + Time.time;
				((Component)this).GetComponentInParent<PlayerCollision>().IgnoreWallForFrames(2);
				Vector3 position = ((Component)closestPlayerInOtherTeam).transform.position + ((Component)closestPlayerInOtherTeam).transform.forward;
				((Component)((CardEffect)this).player).transform.position = position;
			}
			else
			{
				Debug.Log("Nothin Personnel: No other player found?");
			}
		}
	}
}
public class Overpressure : DirectedExplosion
{
	protected override void Awake()
	{
		forwards = true;
		((PlayerHook)this).Awake();
		Overpressure[] componentsInChildren = ((Component)((CardEffect)this).player).GetComponentsInChildren<Overpressure>();
		if (componentsInChildren.Length > 1)
		{
			Enumerable.First<Overpressure>((IEnumerable<Overpressure>)(object)componentsInChildren, (Func<Overpressure, bool>)([CompilerGenerated] (Overpressure e) => (Object)(object)e != (Object)(object)this)).Upgrade();
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
public class Projectile_VariableDamage : RayHitEffect
{
	private MoveTransform move;

	public float variableDamageMin;

	public float variableDamageMax;

	private SpawnedAttack spawned;

	public bool normalizeDamage = true;

	private void Start()
	{
		move = ((Component)this).GetComponentInParent<MoveTransform>();
		((Component)this).GetComponentInParent<ProjectileHit>().bulletCanDealDeamage = false;
		spawned = ((Component)this).GetComponentInParent<SpawnedAttack>();
	}

	public override HasToReturn DoHitEffect(HitInfo hit)
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d7: 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_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)hit.transform))
		{
			return (HasToReturn)1;
		}
		ProjectileHit componentInParent = ((Component)this).GetComponentInParent<ProjectileHit>();
		HealthHandler component = ((Component)hit.transform).GetComponent<HealthHandler>();
		if (Object.op_Implicit((Object)(object)component) && spawned.IsMine())
		{
			float num = Random.Range(variableDamageMin, variableDamageMax);
			if (normalizeDamage)
			{
				num = Mathf.Max(num, Random.Range(variableDamageMin, variableDamageMax));
			}
			((Damagable)component).CallTakeDamage(Vector2.op_Implicit(num * componentInParent.damage * ((Component)this).transform.forward), Vector2.op_Implicit(((Component)this).transform.position), ((Component)this).GetComponentInParent<ProjectileHit>().ownWeapon, ((Component)this).GetComponentInParent<ProjectileHit>().ownPlayer, true);
		}
		return (HasToReturn)1;
	}
}
public class PulseRifle : MonoBehaviour
{
	private Player player;

	private Gun gun;

	private GunAmmo gunAmmo;

	private Coroutine thereCanOnlyBeOne = null;

	private ReversibleColorEffect colorEffect = null;

	private Color color = Color.white;

	private float colorCooldown = 3f;

	private bool shouldFlash = true;

	internal float startChargeAmmo;

	internal float chargeSpeed = 5f;

	internal float maxCharge = 3f;

	internal float bulletsToRemove = 0f;

	internal float previousMaxAmmo = 0f;

	internal bool previouslyCharging = false;

	private void Start()
	{
		player = ((Component)this).GetComponentInParent<Player>();
		gun = player.data.weaponHandler.gun;
		gunAmmo = ((Component)gun).GetComponentInChildren<GunAmmo>();
		GunExtensions.GetAdditionalData(gun).maxCharge = Mathf.Max(GunExtensions.GetAdditionalData(gun).maxCharge, maxCharge);
		updateChargeInfo();
	}

	private void Update()
	{
		if (!Object.op_Implicit((Object)(object)player) || !player.data.view.IsMine || !Object.op_Implicit((Object)(object)gun) || !gun.useCharge)
		{
			return;
		}
		if (gun.currentCharge == maxCharge && shouldFlash)
		{
			shouldFlash = false;
			((MonoBehaviour)this).StartCoroutine(ColorFlash());
		}
		if (previouslyCharging != gun.GenAdditionalData().charging)
		{
			previouslyCharging = gun.GenAdditionalData().charging;
			if (previouslyCharging)
			{
				gun.isReloading = false;
				StartCharging();
			}
			else
			{
				((MonoBehaviour)this).StopCoroutine(thereCanOnlyBeOne);
				bulletsToRemove = 0f;
				gun.isReloading = true;
			}
		}
	}

	private void OnDestroy()
	{
		if ((Object)(object)colorEffect != (Object)null)
		{
			((ColorEffect)colorEffect).Destroy();
		}
	}

	private void OnDisable()
	{
		if ((Object)(object)colorEffect != (Object)null)
		{
			((ColorEffect)colorEffect).Destroy();
		}
	}

	private void StartCharging()
	{
		if (thereCanOnlyBeOne != null)
		{
			((MonoBehaviour)this).StopCoroutine(thereCanOnlyBeOne);
		}
		if ((float)gunAmmo.maxAmmo != previousMaxAmmo)
		{
			updateChargeInfo();
		}
		float timeBetweenCharges = GunExtensions.GetAdditionalData(gun).chargeTime / GunExtensions.GetAdditionalData(gun).maxCharge;
		thereCanOnlyBeOne = ((MonoBehaviour)this).StartCoroutine(KeepCharging(timeBetweenCharges));
	}

	[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
	private IEnumerator KeepCharging(float timeBetweenCharges)
	{
		while (gun.currentCharge < GunExtensions.GetAdditionalData(gun).maxCharge && 0 < (int)(Int32)ExtensionMethods.GetFieldValue((object)gunAmmo, "currentAmmo"))
		{
			yield return new WaitForSeconds(timeBetweenCharges);
			chargeBullet();
		}
	}

	private void chargeBullet()
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Expected I4, but got Unknown
		bulletsToRemove += previousMaxAmmo / (maxCharge + 1f);
		int num = (int)(Int32)ExtensionMethods.GetFieldValue((object)gunAmmo, "currentAmmo");
		ExtensionMethods.SetFieldValue((object)gunAmmo, "currentAmmo", (object)(num - Mathf.FloorToInt(bulletsToRemove)));
		bulletsToRemove -= Mathf.FloorToInt(bulletsToRemove);
		ExtensionMethods.SetFieldValue((object)gunAmmo, "freeReloadCounter", (object)0);
		ExtensionMethods.SetFieldValue((object)gunAmmo, "reloadCounter", (object)((gunAmmo.reloadTime + gunAmmo.reloadTimeAdd) * gunAmmo.reloadTimeMultiplier));
		ExtensionMethods.InvokeMethod((object)gunAmmo, "SetActiveBullets", (object[])(object)new Object[1] { (object)(Boolean)0 });
	}

	private void updateChargeInfo()
	{
		startChargeAmmo = gun.ammo;
		previousMaxAmmo = gunAmmo.maxAmmo;
		GunExtensions.GetAdditionalData(gun).chargeTime = chargeSpeed * gun.attackSpeed * gun.attackSpeedMultiplier / previousMaxAmmo * GunExtensions.GetAdditionalData(gun).maxCharge;
	}

	[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
	private IEnumerator ColorFlash(float howLong = 0.33f)
	{
		colorEffect = ((Component)player).gameObject.AddComponent<ReversibleColorEffect>();
		((ColorEffect)colorEffect).SetColor(color);
		yield return new WaitForSeconds(howLong);
		((ColorEffect)colorEffect).Destroy();
		yield return new WaitForSeconds(colorCooldown);
		shouldFlash = true;
	}
}
public class Railgun : PlayerHook
{
	private Coroutine thereCanOnlyBeOne = null;

	internal bool runningCoroutine = false;

	private ReversibleColorEffect colorEffect = null;

	internal float chargeSpeed = 5f;

	internal float maxChargeMult = 0.75f;

	internal bool previouslyCharging = false;

	private StatChanges oneBullet = new StatChanges
	{
		Bullets = -999,
		MaxAmmo = -999
	};

	private StatChangeTracker limiter = null;

	protected override void Start()
	{
		((MonoBehaviour)this).StartCoroutine(updateChargeInfo());
	}

	public override IEnumerator OnPickPhaseEnd(IGameModeHandler gameModeHandler)
	{
		((MonoBehaviour)this).StartCoroutine(updateChargeInfo());
		return ((CardEffect)this).OnPickPhaseEnd(gameModeHandler);
	}

	private void Update()
	{
		if (Object.op_Implicit((Object)(object)((CardEffect)this).gun) && ((CardEffect)this).gun.useCharge && previouslyCharging != ((CardEffect)this).gun.GenAdditionalData().charging)
		{
			previouslyCharging = ((CardEffect)this).gun.GenAdditionalData().charging;
			Debug.Log(String.Format("Railgun - Currently charging: {0}", (object)previouslyCharging));
			if (previouslyCharging)
			{
				StartCharging();
			}
			else if (runningCoroutine)
			{
				((MonoBehaviour)this).StopCoroutine(thereCanOnlyBeOne);
			}
		}
	}

	private void StartCharging()
	{
		if (runningCoroutine)
		{
			((MonoBehaviour)this).StopCoroutine(thereCanOnlyBeOne);
			runningCoroutine = false;
			if ((Object)(object)colorEffect != (Object)null)
			{
				Object.Destroy((Object)(object)colorEffect);
				colorEffect = null;
			}
		}
		if (((CardEffect)this).gunAmmo.maxAmmo != 1)
		{
			((MonoBehaviour)this).StartCoroutine(updateChargeInfo());
		}
		float chargeTime = GunExtensions.GetAdditionalData(((CardEffect)this).gun).chargeTime;
		thereCanOnlyBeOne = ((MonoBehaviour)this).StartCoroutine(KeepCharging(chargeTime));
	}

	[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
	private IEnumerator KeepCharging(float timeBetweenCharges)
	{
		runningCoroutine = true;
		Debug.Log(String.Format("Started Charging. Charge time: {0}", (object)timeBetweenCharges));
		yield return new WaitForSeconds(timeBetweenCharges);
		Debug.Log("Charged a bullet");
		colorEffect = ((Component)((CardEffect)this).player).gameObject.AddComponent<ReversibleColorEffect>();
		((ColorEffect)colorEffect).SetColor(Color.white);
		yield return new WaitForSecondsRealtime(0.25f);
		Object.Destroy((Object)(object)colorEffect);
		colorEffect = null;
		runningCoroutine = false;
	}

	[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
	private IEnumerator updateChargeInfo()
	{
		if (limiter != null)
		{
			StatManager.Remove(limiter);
		}
		yield return new WaitForFixedUpdate();
		GunExtensions.GetAdditionalData(((CardEffect)this).gun).maxCharge = Mathf.Max(maxChargeMult * ((float)((CardEffect)this).gunAmmo.maxAmmo + Mathf.Pow((float)((CardEffect)this).gun.bursts, 2f)), 1f);
		GunExtensions.GetAdditionalData(((CardEffect)this).gun).chargeTime = chargeSpeed / (((CardEffect)this).gun.attackSpeed * ((CardEffect)this).gun.attackSpeedMultiplier * GunExtensions.GetAdditionalData(((CardEffect)this).gun).maxCharge);
		Debug.Log(String.Format("MaxCharge: {0}, ChargeTime: {1}", (object)GunExtensions.GetAdditionalData(((CardEffect)this).gun).maxCharge, (object)GunExtensions.GetAdditionalData(((CardEffect)this).gun).chargeTime));
		oneBullet.Bullets = -((CardEffect)this).gun.bursts;
		oneBullet.MaxAmmo = -((CardEffect)this).gunAmmo.maxAmmo + 1;
		Debug.Log(String.Format("Before - MaxAmmo: {0}, Bursts: {1}", (object)((CardEffect)this).gunAmmo.maxAmmo, (object)((CardEffect)this).gun.bursts));
		limiter = StatManager.Apply(((CardEffect)this).player, oneBullet);
		yield return new WaitForFixedUpdate();
		Debug.Log(String.Format("After - MaxAmmo: {0}, Bursts: {1}", (object)((CardEffect)this).gunAmmo.maxAmmo, (object)((CardEffect)this).gun.bursts));
		_ = (int)(Int32)ExtensionMethods.GetFieldValue((object)((CardEffect)this).gunAmmo, "currentAmmo");
		ExtensionMethods.SetFieldValue((object)((CardEffect)this).gunAmmo, "currentAmmo", (object)1);
		ExtensionMethods.InvokeMethod((object)((CardEffect)this).gunAmmo, "SetActiveBullets", (object[])(object)new Object[1] { (object)(Boolean)0 });
	}
}
public class Relativity : PlayerHook
{
	private float maxDamageMult = 1.5f;

	private float maxReloadRate = 2f;

	private float maxSpeedMult = 1.5f;

	private const float bulletSpeedCutoff = 1f;

	private const float upgradeDamage = 1.5f;

	private const float upgradeReload = 2f;

	private const float upgradeSpeed = 1.5f;

	private StatChanges statChanges = null;

	private StatChangeTracker statChangeTracker = null;

	protected override void Awake()
	{
		((PlayerHook)this).Awake();
		Relativity[] componentsInChildren = ((Component)((CardEffect)this).player).GetComponentsInChildren<Relativity>();
		if (componentsInChildren.Length > 1)
		{
			Enumerable.First<Relativity>((IEnumerable<Relativity>)(object)componentsInChildren, (Func<Relativity, bool>)([CompilerGenerated] (Relativity e) => (Object)(object)e != (Object)(object)this)).Upgrade();
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
		if (statChanges == null)
		{
			UpdateStats();
		}
	}

	private void Upgrade()
	{
		maxDamageMult += 1.5f;
		maxReloadRate += 2f;
		maxSpeedMult += 1.5f;
		UpdateStats();
	}

	private void UpdateStats()
	{
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: 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_009c: Expected O, but got Unknown
		if (statChangeTracker != null)
		{
			StatManager.Remove(statChangeTracker);
		}
		float num = ((CardEffect)this).gun.projectielSimulatonSpeed * ((CardEffect)this).gun.projectileSpeed;
		statChanges = new StatChanges
		{
			Damage = ((num > 1f) ? maxDamageMult : 1f),
			AttackSpeed = ((num < 1f) ? (((CardEffect)this).gun.defaultCooldown / maxReloadRate) : 1f),
			MovementSpeed = ((num == 1f) ? maxSpeedMult : 1f)
		};
		statChangeTracker = StatManager.Apply(((CardEffect)this).player, statChanges);
	}
}
public class RingBehaviour : MonoBehaviour
{
	public float cosMultiplier = 1f;

	public float sinMultiplier = 1f;

	public float period = 20f;

	private void Update()
	{
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = default(Vector3);
		((Vector3)(ref val))..ctor(Mathf.Cos(Time.time * period) * 10f * cosMultiplier * Time.smoothDeltaTime, Mathf.Sin(Time.time * period * 1.5f + (float)Math.PI / 2f) * 10f * sinMultiplier * Time.smoothDeltaTime, 0f);
		Transform root = ((Component)this).transform.root;
		root.position += val;
	}
}
public class RingWorm : PlayerHook
{
	private float amplitudeRandom = 0.1f;

	private float amplitudeRandomUpgrade = 0.1f;

	private float ringMult = 1.5f;

	private int upgradeCount = 1;

	protected override void Start()
	{
		((CardEffect)this).Start();
	}

	protected override void Awake()
	{
		((PlayerHook)this).Awake();
		WiggleWorm[] componentsInChildren = ((Component)((CardEffect)this).player).GetComponentsInChildren<WiggleWorm>();
		if (componentsInChildren.Length > 1)
		{
			Enumerable.First<WiggleWorm>((IEnumerable<WiggleWorm>)(object)componentsInChildren, (Func<WiggleWorm, bool>)([CompilerGenerated] (WiggleWorm e) => (Object)(object)e != (Object)(object)this)).Upgrade();
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	public override void OnShoot(GameObject projectile)
	{
		((CardEffect)this).OnShoot(projectile);
		float num = Random.Range(0f - amplitudeRandom, amplitudeRandom);
		RingBehaviour orAddComponent = ExtensionMethods.GetOrAddComponent<RingBehaviour>(projectile.gameObject, false);
		orAddComponent.cosMultiplier = (float)upgradeCount * ringMult * (1f + num) * ((CardEffect)this).gun.projectileSpeed * 2f;
		orAddComponent.sinMultiplier = (float)upgradeCount * ringMult * (1f + num);
		orAddComponent.period *= 0.8f;
	}

	public void Upgrade()
	{
		amplitudeRandom += amplitudeRandomUpgrade;
		upgradeCount++;
	}
}
public class S_SyncProjectile : MonoBehaviour
{
	private SyncProjectile sync = null;

	private void Start()
	{
		sync = ((Component)this).GetComponentInParent<SyncProjectile>();
		sync.active = true;
	}
}
public class SC_Ammo : SupportClass
{
	protected override void updateStats()
	{
		teamStatEffects = new Shade_StatChanges
		{
			MaxAmmo = 2,
			reloadTime_mult = 0.75f,
			damageAfterDistanceMult_mult = 1.2f,
			bounces = 2
		};
	}
}
public class SC_AntiGrav : SupportClass
{
	protected override void updateStats()
	{
		teamStatEffects = new Shade_StatChanges
		{
			PlayerGravity = 0.5f
		};
	}
}
public class SC_Bandaid : SupportClass
{
	protected override void updateStats()
	{
		teamStatEffects = new Shade_StatChanges
		{
			decay_add = 5f
		};
	}
}
public class SC_Booster : SupportClass
{
	protected override void updateStats()
	{
		teamStatEffects = new Shade_StatChanges
		{
			MaxHealth = 0.1f + ((CardEffect)this).gun.damage / 2f
		};
	}
}
public class SC_Frenzy : SupportClass
{
	protected override void updateStats()
	{
		statDuration = 5f;
		teamStatEffects = new Shade_StatChanges
		{
			AttackSpeed = 1.5f,
			MovementSpeed = 1.5f,
			JumpHeight = 1.3f,
			PlayerSize = 0.75f,
			reloadTime_mult = 0.8f
		};
	}
}
public class SC_Lifesteal : SupportClass
{
	[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
	public override IEnumerator OnBulletHitCoroutine(GameObject projectile, HitInfo hit)
	{
		if (canApplyEffect && Object.op_Implicit((Object)(object)((Component)hit.collider).gameObject.GetComponentInChildren<Player>()) && (Object)(object)((Component)hit.collider).gameObject.GetComponentInChildren<Player>() != (Object)null && ((Component)hit.collider).gameObject.GetComponentInChildren<Player>().teamID == ((CardEffect)this).player.teamID)
		{
			Player other = ((Component)hit.collider).gameObject.GetComponentInChildren<Player>();
			Debug.Log(String.Format("{0} => {1}", (object)teamStatEffects, (object)((StatChanges)(object)teamStatEffects).MyToString()));
			Shade_StatChangeTracker effect = SupportClass.Apply(other, teamStatEffects);
			Shade_StatChangeTracker myEffect = SupportClass.Apply(((CardEffect)this).player, new Shade_StatChanges
			{
				lifesteal_add = 0f - ((CardEffect)this).characterStats.lifeSteal
			});
			canApplyEffect = canApplyMultipleTimes;
			yield return new WaitForSeconds(statDuration);
			Debug.Log(String.Format("finished {0}", (object)teamStatEffects));
			SupportClass.Remove(effect);
			SupportClass.Remove(myEffect);
			canApplyEffect = true;
		}
	}

	protected override void updateStats()
	{
		canApplyMultipleTimes = false;
		teamStatEffects = new Shade_StatChanges
		{
			lifesteal_add = ((CardEffect)this).characterStats.lifeSteal
		};
	}
}
public class SC_Medic : SupportClass
{
	protected override void updateStats()
	{
		teamStatEffects = new Shade_StatChanges
		{
			MaxHealth = 1.75f,
			regen_add = 5f + ((CardEffect)this).gun.damage / 55f
		};
	}
}
public class SC_Power : SupportClass
{
	protected override void updateStats()
	{
		statDuration = 5f;
		teamStatEffects = new Shade_StatChanges
		{
			Damage = 1.2f,
			damage_add = ((CardEffect)this).gun.damage / 2f
		};
	}
}
public class SC_Revive : SupportClass
{
	protected override void updateStats()
	{
		statDuration = 5f;
		statCooldown = 10f;
		canApplyMultipleTimes = false;
		teamStatEffects = new Shade_StatChanges
		{
			respawns = 1
		};
	}
}
public class Stinky : PlayerHook
{
	private int maxStacks = 3;

	private float currentStacks = 0f;

	private float movespeedPerStack = 0.33f;

	private float jumpHeightPerStack = 0.1f;

	private List<StatChangeTracker> effects = new List<StatChangeTracker>();

	private GameObject cloud;

	protected override void Start()
	{
		((CardEffect)this).Start();
		cloud = ShadeCards.assets.LoadAsset<GameObject>("Shade_Cloud");
	}

	protected override void Awake()
	{
		((PlayerHook)this).Awake();
		Stinky[] componentsInChildren = ((Component)((CardEffect)this).player).GetComponentsInChildren<Stinky>();
		if (componentsInChildren.Length > 1)
		{
			Enumerable.First<Stinky>((IEnumerable<Stinky>)(object)componentsInChildren, (Func<Stinky, bool>)([CompilerGenerated] (Stinky e) => (Object)(object)e != (Object)(object)this)).Upgrade();
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	public override IEnumerator OnBattleStart(IGameModeHandler gameModeHandler)
	{
		//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)
		Enumerator<StatChangeTracker> enumerator = effects.GetEnumerator();
		try
		{
			while (enumerator.MoveNext())
			{
				StatChangeTracker current = enumerator.Current;
				StatManager.Remove(current);
			}
		}
		finally
		{
			((IDisposable)enumerator).Dispose();
		}
		currentStacks = 0f;
		return ((CardEffect)this).OnBattleStart(gameModeHandler);
	}

	[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
	public override IEnumerator OnOutOfAmmoCoroutine(int bulletsReloaded)
	{
		if (currentStacks < (float)maxStacks)
		{
			float stacksToGain = Mathf.Min((float)(bulletsReloaded / ((CardEffect)this).gunAmmo.maxAmmo), (float)maxStacks - currentStacks);
			currentStacks += stacksToGain;
			float movementToGain = 1f + stacksToGain * movespeedPerStack;
			float jumpToGain = 1f + stacksToGain * jumpHeightPerStack;
			StatChanges statsToChange = new StatChanges
			{
				MovementSpeed = movementToGain,
				JumpHeight = jumpToGain
			};
			StatChangeTracker effect = StatManager.Apply(((CardEffect)this).player, statsToChange);
			effects.Add(effect);
			GameObject obj = Object.Instantiate<GameObject>(cloud, ((Component)((CardEffect)this).player).transform, false);
			obj.transform.position = ((Component)((CardEffect)this).player).transform.position;
			ParticleSystem ps = obj.GetComponent<ParticleSystem>();
			_ = ps.main;
			ShadeCards.playSoundFromAsset("balloon", ((Component)((CardEffect)this).player).transform, 0.6f);
			yield return null;
		}
	}

	public void Upgrade()
	{
		maxStacks *= 2;
	}
}
public class SupportClass : PlayerHook
{
	[SerializeField]
	protected float teamDmgMlt = 0.5f;

	[SerializeField]
	protected float statDuration = 5f;

	[SerializeField]
	protected float statCooldown = 10f;

	protected Shade_StatChanges teamStatEffects;

	private ColorEffect colorEffect = null;

	[SerializeField]
	protected bool canApplyMultipleTimes = false;

	protected bool canApplyEffect = true;

	protected override void Start()
	{
		((CardEffect)this).Start();
		((CardEffect)this).gun.GenAdditionalData().teamDamageMultiplier *= teamDmgMlt;
		updateStats();
	}

	protected override void OnDestroy()
	{
		((CardEffect)this).OnDestroy();
		if ((Object)(object)colorEffect != (Object)null)
		{
			Object.Destroy((Object)(object)colorEffect);
			colorEffect = null;
		}
		((CardEffect)this).gun.GenAdditionalData().teamDamageMultiplier /= teamDmgMlt;
	}

	[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
	public override IEnumerator OnBulletHitCoroutine(GameObject projectile, HitInfo hit)
	{
		if (canApplyEffect && Object.op_Implicit((Object)(object)((Component)hit.collider).gameObject.GetComponentInChildren<Player>()) && (Object)(object)((Component)hit.collider).gameObject.GetComponentInChildren<Player>() != (Object)null && ((Component)hit.collider).gameObject.GetComponentInChildren<Player>().teamID == ((CardEffect)this).player.teamID)
		{
			Player other = ((Component)hit.collider).gameObject.GetComponentInChildren<Player>();
			Shade_StatChangeTracker effect = Apply(other, teamStatEffects);
			colorEffect = (ColorEffect)(object)((Component)other).gameObject.AddComponent<ReversibleColorEffect>();
			colorEffect.SetColor(Color.green);
			Debug.Log(String.Format("{0} => {1}\nRevives: {2}", (object)teamStatEffects, (object)((StatChanges)(object)teamStatEffects).MyToString(), (object)((CardEffect)this).characterStats.respawns));
			canApplyEffect = canApplyMultipleTimes;
			yield return new WaitForSeconds(statDuration);
			Remove(effect);
			Object.Destroy((Object)(object)colorEffect);
			colorEffect = null;
			Debug.Log(String.Format("finished {0}\nRevives: {1}", (object)teamStatEffects, (object)((CardEffect)this).characterStats.respawns));
			yield return new WaitForSeconds(statCooldown);
			canApplyEffect = true;
		}
	}

	public static Shade_StatChangeTracker Apply(Player player, Shade_StatChanges stats)
	{
		Shade_TemporaryEffect shade_TemporaryEffect = ((Component)player).gameObject.AddComponent<Shade_TemporaryEffect>();
		return shade_TemporaryEffect.Initialize(stats);
	}

	public static void Remove(Shade_StatChangeTracker status)
	{
		Debug.Log(status.active);
		if (status.active)
		{
			Object.Destroy((Object)(object)status.effect);
		}
	}

	public override IEnumerator OnPickPhaseEnd(IGameModeHandler gameModeHandler)
	{
		updateStats();
		return ((CardEffect)this).OnPickPhaseEnd(gameModeHandler);
	}

	protected virtual void updateStats()
	{
	}
}
public static class StatChanges_Extension : Object
{
	public static string MyToString(this StatChanges stats)
	{
		return String.Concat((string[])(object)new String[15]
		{
			"\n",
			String.Format("Bullets:      {0}\n", (object)stats.Bullets),
			String.Format("Jumps:        {0}\n", (object)stats.Jumps),
			String.Format("Max Ammo:     {0}\n", (object)stats.MaxAmmo),
			"-------------\n",
			String.Format("AttackSpeed:  {0} \n", (object)stats.AttackSpeed),
			String.Format("PlayerGravity:{0} \n", (object)stats.PlayerGravity),
			String.Format("MoveSpeed:    {0} \n", (object)stats.MovementSpeed),
			String.Format("ProjGravity:  {0} \n", (object)stats.ProjectileGravity),
			String.Format("Damage:       {0} \n", (object)stats.Damage),
			String.Format("PlayerSize:   {0} \n", (object)stats.PlayerSize),
			String.Format("MaxHealth:    {0} \n", (object)stats.MaxHealth),
			String.Format("BulletSpread: {0} \n", (object)stats.BulletSpread),
			String.Format("BulletSpeed:  {0} \n", (object)stats.BulletSpeed),
			String.Format("JumpHeight:   {0} \n", (object)stats.JumpHeight)
		});
	}
}
public class Tests : PlayerHook
{
	private float numCards = 1f;

	private float teamDmgMlt = 0.5f;

	private float statDuration = 15f;

	protected override void Start()
	{
		((CardEffect)this).Start();
		((CardEffect)this).gun.GenAdditionalData().teamDamageMultiplier *= teamDmgMlt;
	}

	protected override void Awake()
	{
		((PlayerHook)this).Awake();
		Tests[] componentsInChildren = ((Component)((CardEffect)this).player).GetComponentsInChildren<Tests>();
		if (componentsInChildren.Length > 1)
		{
			Enumerable.First<Tests>((IEnumerable<Tests>)(object)componentsInChildren, (Func<Tests, bool>)([CompilerGenerated] (Tests e) => (Object)(object)e != (Object)(object)this)).Upgrade();
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	public void Upgrade()
	{
		numCards += 1f;
		((CardEffect)this).gun.GenAdditionalData().teamDamageMultiplier *= teamDmgMlt;
	}

	protected override void OnDestroy()
	{
		((CardEffect)this).OnDestroy();
		((CardEffect)this).gun.GenAdditionalData().teamDamageMultiplier /= Mathf.Pow(teamDmgMlt, numCards);
	}

	[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
	public override IEnumerator OnBulletHitCoroutine(GameObject projectile, HitInfo hit)
	{
		if (Object.op_Implicit((Object)(object)((Component)hit.collider).gameObject.GetComponentInChildren<Player>()) && (Object)(object)((Component)hit.collider).gameObject.GetComponentInChildren<Player>() != (Object)null && ((Component)hit.collider).gameObject.GetComponentInChildren<Player>().teamID == ((CardEffect)this).player.teamID)
		{
			StatChangeTracker effect = StatManager.Apply(((CardEffect)this).player, TeamStatEffects());
			yield return new WaitForSeconds(statDuration);
			StatManager.Remove(effect);
		}
	}

	protected virtual StatChanges TeamStatEffects()
	{
		return null;
	}
}
public class WiggleWorm : PlayerHook
{
	private float amplitudeRandom = 0.1f;

	private float amplitudeRandomUpgrade = 0.1f;

	private float cosMult = 1.5f;

	private int upgradeCount = 1;

	protected override void Awake()
	{
		((PlayerHook)this).Awake();
		WiggleWorm[] componentsInChildren = ((Component)((CardEffect)this).player).GetComponentsInChildren<WiggleWorm>();
		if (componentsInChildren.Length > 1)
		{
			Enumerable.First<WiggleWorm>((IEnumerable<WiggleWorm>)(object)componentsInChildren, (Func<WiggleWorm, bool>)([CompilerGenerated] (WiggleWorm e) => (Object)(object)e != (Object)(object)this)).Upgrade();
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	public override void OnShoot(GameObject projectile)
	{
		((CardEffect)this).OnShoot(projectile);
		float num = Random.Range(0f - amplitudeRandom, amplitudeRandom);
		ExtensionMethods.GetOrAddComponent<Cos>(projectile.gameObject, false).multiplier = (float)upgradeCount * cosMult * (1f + num);
	}

	public void Upgrade()
	{
		amplitudeRandom += amplitudeRandomUpgrade;
		upgradeCount++;
	}
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
public static class TemporaryModifiers_Patch : Object
{
	[HarmonyPostfix]
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	public static void RemoveCharacterStatModifiers_Patch(CharacterStatModifiers characterStatModifiers)
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Expected I4, but got Unknown
		ExtensionMethods.SetFieldValue((object)characterStatModifiers, "remainingRespawns", (object)Mathf.Min((int)(Int32)ExtensionMethods.GetFieldValue((object)characterStatModifiers, "remainingRespawns"), characterStatModifiers.respawns));
	}
}
namespace Shade
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("shade.plugin.trinkets", "Shade's Trinkets", "0.2.2")]
	[BepInProcess("Rounds.exe")]
	public class ShadeCards : BaseUnityPlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c : Object
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__6_0;

			public static UnityAction<bool> <>9__10_0;

			internal void <Start>b__6_0()
			{
			}

			internal void <NewGUI>b__10_0(bool value)
			{
				DEBUG.Value = value;
			}
		}

		internal const string ModId = "shade.plugin.trinkets";

		internal const string modName = "Shade's Trinkets";

		internal const string version = "0.2.2";

		internal static string modInitials = "ST";

		internal static AssetBundle assets = AssetUtils.LoadAssetBundleFromResources("shadecards", typeof(ShadeCards).Assembly);

		public static ConfigEntry<bool> DEBUG;

		private void Start()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			object obj = <>c.<>9__6_0;
			if (obj == null)
			{
				UnityAction val = delegate
				{
				};
				<>c.<>9__6_0 = val;
				obj = (object)val;
			}
			Unbound.RegisterMenu("Shade's Trinkets", (UnityAction)obj, (Action<GameObject>)NewGUI, (GameObject)null, false);
		}

		private void Awake()
		{
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			DEBUG = ((BaseUnityPlugin)this).Config.Bind<bool>("shade.plugin.trinkets", "Debug", false, "Enable to turn on console info from this mod.");
			assets.LoadAsset<GameObject>("_ModCards").GetComponent<CardHolder>().RegisterCards();
			assets.LoadAsset<GameObject>("_SC_ClassCards").GetComponent<CardHolder>().RegisterCards();
			new Harmony("Shade's Trinkets").PatchAll();
		}

		private void Update()
		{
		}

		public static void playSoundFromAsset(string AssetName, Transform where, float volume = 0.3f)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			SoundEvent val = null;
			SoundParameterIntensity val2 = new SoundParameterIntensity(volume, (UpdateMode)1);
			SoundParameterPitchRatio val3 = new SoundParameterPitchRatio(0.9f + Random.Range(0f, 0.2f), (UpdateMode)1);
			AudioClip val4 = assets.LoadAsset<AudioClip>(AssetName);
			SoundContainer val5 = ScriptableObject.CreateInstance<SoundContainer>();
			val5.audioClip[0] = val4;
			val5.setting.volumeIntensityEnable = true;
			val = ScriptableObject.CreateInstance<SoundEvent>();
			val.soundContainerArray[0] = val5;
			SoundManager.Instance.Play(val, where, (SoundParameterBase[])(object)new SoundParameterBase[1] { (SoundParameterBase)val2 });
		}

		private void NewGUI(GameObject menu)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			TextMeshProUGUI val = default(TextMeshProUGUI);
			MenuHandler.CreateText("Shade's Trinkets", menu, ref val, 60, false, default(Nullable<Color>), (TMP_FontAsset)null, (Material)null, default(Nullable<TextAlignmentOptions>));
			MenuHandler.CreateToggle(DEBUG.Value, "Debug Mode", menu, (UnityAction<bool>)delegate(bool value)
			{
				DEBUG.Value = value;
			}, 50, false, new Nullable<Color>(Color.red), (TMP_FontAsset)null, (Material)null, default(Nullable<TextAlignmentOptions>));
		}
	}
	public static class Debug : Object
	{
		public static void Log(object msg, bool important = false)
		{
			if (important || ShadeCards.DEBUG.Value)
			{
				Debug.Log((object)String.Format("{0}=>{1}", (object)"shade.plugin.trinkets", msg));
			}
		}
	}
}
namespace Shade.Patches
{
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	internal class Gun_Patch : Object
	{
		[HarmonyPostfix]
		[HarmonyPatch("ApplyProjectileStats")]
		public static void APS_Postfix(Gun __instance, GameObject obj)
		{
			if (__instance.GenAdditionalData().cosAmplitude > 0f)
			{
				Cos component = obj.GetComponent<Cos>();
				if ((Object)(object)component != (Object)null)
				{
					component.multiplier = __instance.GenAdditionalData().cosAmplitude;
				}
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch("DoAttacks")]
		public static void DoAttacks_Prefix(ref Gun __instance, int attacks)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected I4, but got Unknown
			if (__instance.GenAdditionalData().ammoToAddBeforeFiring > 0)
			{
				GunAmmo componentInChildren = ((Component)__instance).GetComponentInChildren<GunAmmo>();
				int num = (int)(Int32)ExtensionMethods.GetFieldValue((object)componentInChildren, "currentAmmo");
				ExtensionMethods.SetFieldValue((object)componentInChildren, "currentAmmo", (object)(num + __instance.GenAdditionalData().ammoToAddBeforeFiring));
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("Attack")]
		public static void Attack_Postfix(ref Gun __instance, float charge, bool __result)
		{
			if (__instance.useCharge)
			{
				__instance.StopCharging();
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch("ResetStats")]
		private static void ResetStats_Prefix(Gun __instance)
		{
			__instance.GenAdditionalData().variableDamage = 0f;
			__instance.GenAdditionalData().charging = false;
		}
	}
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	internal class WeaponHandler_Patch : Object
	{
		[HarmonyPrefix]
		[HarmonyPatch("Attack")]
		public static void Attack_Prefix(WeaponHandler __instance, CharacterData ___data)
		{
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Invalid comparison between I4 and Unknown
			if (Object.op_Implicit((Object)(object)__instance) && Object.op_Implicit((Object)(object)___data) && Object.op_Implicit((Object)(object)__instance.gun) && __instance.gun.useCharge && !__instance.gun.GenAdditionalData().charging && ___data.input.shootIsPressed && !___data.dead && (int)(Boolean)typeof(PlayerVelocity).GetField("simulated", (BindingFlags)1060).GetValue((object)___data.playerVel) != 0 && 0 < (int)(Int32)typeof(GunAmmo).GetField("currentAmmo", (BindingFlags)1060).GetValue((object)((Component)__instance.gun).GetComponentInChildren<GunAmmo>()) && __instance.gun.useCharge)
			{
				__instance.gun.StartCharging();
			}
		}
	}
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	internal class HealthHandler_Patch : Object
	{
		[HarmonyPrefix]
		[HarmonyPatch("CallTakeDamage")]
		public static void HH_Prefix(HealthHandler __instance, ref Vector2 damage, GameObject damagingWeapon, Player damagingPlayer)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)damagingPlayer != (Object)null && ((Player)ExtensionMethods.GetFieldValue((object)__instance, "player")).teamID == damagingPlayer.teamID && (Object)(object)damagingWeapon != (Object)null && damagingWeapon.GetComponent<Gun>().GenAdditionalData().teamDamageMultiplier != 1f)
			{
				damage *= damagingWeapon.GetComponent<Gun>().GenAdditionalData().teamDamageMultiplier;
			}
		}
	}
}
namespace Shade.Extensions
{
	public class Shade_StatChangeTracker : Object
	{
		public bool active;

		internal Shade_TemporaryEffect effect;

		internal Shade_StatChangeTracker(Shade_TemporaryEffect effect)
		{
			this.effect = effect;
		}
	}
	[Serializable]
	public class Shade_StatChanges : StatChanges
	{
		public float regen_add = 0f;

		public float regen_mult = 1f;

		public float decay_add = 0f;

		public float decay_mult = 1f;

		public float lifesteal_add = 0f;

		public float lifesteal_mult = 1f;

		public int respawns = 0;

		public int additionalBlocks = 0;

		public float cdAdd_add = 0f;

		public float cdAdd_mult = 1f;

		public int bounces = 0;

		public float damage_add = 0f;

		public float damageAfterDistanceMult_add = 0f;

		public float damageAfterDistanceMult_mult = 1f;

		public float slow_add = 0f;

		public float multiplySpread_mult = 1f;

		public float size_add = 0f;

		public float size_mult = 1f;

		public Color projectileColor = Color.black;

		public float reloadTime_add = 0f;

		public float reloadTime_mult = 1f;
	}
	public class Shade_TemporaryEffect : ReversibleEffect
	{
		private Shade_StatChanges statChanges;

		private Shade_StatChangeTracker status;

		public Shade_StatChangeTracker Initialize(Shade_StatChanges stats)
		{
			statChanges = stats;
			status = new Shade_StatChangeTracker(this);
			return status;
		}

		public override void OnStart()
		{
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			base.healthHandlerModifier.regen_add = statChanges.regen_add;
			base.healthHandlerModifier.regen_mult = statChanges.regen_mult;
			base.characterStatModifiersModifier.secondsToTakeDamageOver_add = statChanges.decay_add;
			base.characterStatModifiersModifier.secondsToTakeDamageOver_mult = statChanges.decay_mult;
			base.characterStatModifiersModifier.lifeSteal_add = statChanges.lifesteal_add;
			base.characterStatModifiersModifier.lifeSteal_mult = statChanges.lifesteal_mult;
			base.characterStatModifiersModifier.respawns_add = statChanges.respawns;
			base.blockModifier.additionalBlocks_add = statChanges.additionalBlocks;
			base.blockModifier.cdAdd_add = statChanges.cdAdd_add;
			base.blockModifier.cdAdd_mult = statChanges.cdAdd_mult;
			base.gunAmmoStatModifier.reloadTimeAdd_add = statChanges.reloadTime_add;
			base.gunAmmoStatModifier.reloadTimeMultiplier_mult = statChanges.reloadTime_mult;
			base.gunStatModifier.reflects_add = statChanges.bounces;
			base.gunStatModifier.damage_add = statChanges.damage_add;
			base.gunStatModifier.damageAfterDistanceMultiplier_add = statChanges.damageAfterDistanceMult_add;
			base.gunStatModifier.damageAfterDistanceMultiplier_mult = statChanges.damageAfterDistanceMult_mult;
			base.gunStatModifier.slow_add = statChanges.slow_add;
			base.gunStatModifier.spread_mult = statChanges.multiplySpread_mult;
			base.gunStatModifier.size_add = statChanges.size_add;
			base.gunStatModifier.size_mult = statChanges.size_mult;
			base.gunStatModifier.projectileColor = statChanges.projectileColor;
			base.characterStatModifiersModifier.sizeMultiplier_mult = ((StatChanges)statChanges).PlayerSize;
			base.characterStatModifiersModifier.movementSpeed_mult = ((StatChanges)statChanges).MovementSpeed;
			base.characterStatModifiersModifier.jump_mult = ((StatChanges)statChanges).JumpHeight;
			base.characterDataModifier.numberOfJumps_add = ((StatChanges)statChanges).Jumps;
			base.characterDataModifier.maxHealth_mult = ((StatChanges)statChanges).MaxHealth;
			base.gravityModifier.gravityForce_mult = ((StatChanges)statChanges).PlayerGravity;
			base.gunStatModifier.numberOfProjectiles_add = ((StatChanges)statChanges).Bullets;
			base.gunStatModifier.spread_mult = ((StatChanges)statChanges).BulletSpread;
			base.gunStatModifier.attackSpeed_mult = ((StatChanges)statChanges).AttackSpeed;
			base.gunStatModifier.gravity_mult = ((StatChanges)statChanges).ProjectileGravity;
			base.gunStatModifier.damage_mult = ((StatChanges)statChanges).Damage;
			base.gunStatModifier.projectileSpeed_mult = ((StatChanges)statChanges).BulletSpeed;
			base.gunAmmoStatModifier.maxAmmo_add = ((StatChanges)statChanges).MaxAmmo;
			status.active = true;
		}

		public override void OnOnDestroy()
		{
			status.active = false;
		}
	}
	[Serializable]
	public class GunAdditionalData : Object
	{
		public float variableDamage;

		public bool charging;

		public int ammoToAddBeforeFiring;

		public float cosAmplitude;

		public float teamDamageMultiplier;

		public GunAdditionalData()
		{
			variableDamage = 0f;
			charging = false;
			ammoToAddBeforeFiring = 0;
			cosAmplitude = 0f;
			teamDamageMultiplier = 1f;
		}
	}
	public static class GunExtension : Object
	{
		public static readonly ConditionalWeakTable<Gun, GunAdditionalData> data = new ConditionalWeakTable<Gun, GunAdditionalData>();

		public static GunAdditionalData GenAdditionalData(this Gun gun)
		{
			return data.GetOrCreateValue(gun);
		}

		public static void AddData(this Gun gun, GunAdditionalData value)
		{
			try
			{
				data.Add(gun, value);
			}
			catch (Exception)
			{
			}
		}

		public static void StartCharging(this Gun gun)
		{
			gun.GenAdditionalData().charging = true;
		}

		public static void StopCharging(this Gun gun)
		{
			gun.GenAdditionalData().charging = false;
		}
	}
}