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 System.Security;
using System.Security.Permissions;
using BepInEx;
using UnboundLib.Cards;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Mod1")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Mod1")]
[assembly: AssemblyTitle("Mod1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Mod1;
public class OmegaSuperAccidentCard : CustomCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
gun.damage = 4f;
gun.ammo = 10;
statModifiers.health = 3f;
block.cooldown = 0.3f;
gun.projectileSpeed = 0.4f;
gun.reloadTime = 2.5f;
statModifiers.movementSpeed = 0.6f;
statModifiers.jump = 0.7f;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
}
protected override string GetTitle()
{
return "OmegaSuperAccident";
}
protected override string GetDescription()
{
return "A chaotic mistake of pure power. You are a slow, heavy god.";
}
protected override Rarity GetRarity()
{
return (Rarity)2;
}
protected override CardInfoStat[] GetStats()
{
return (CardInfoStat[])(object)new CardInfoStat[0];
}
protected override CardThemeColorType GetTheme()
{
return (CardThemeColorType)4;
}
protected override GameObject GetCardArt()
{
return null;
}
}
public class AdminCard : CustomCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
statModifiers.health = 0.5f;
cardInfo.allowMultiple = false;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler healthHandler, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
if ((Object)(object)((Component)player).gameObject.GetComponent<AdminFlyComponent>() == (Object)null)
{
((Component)player).gameObject.AddComponent<AdminFlyComponent>();
}
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler healthHandler, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
AdminFlyComponent component = ((Component)player).gameObject.GetComponent<AdminFlyComponent>();
if ((Object)(object)component != (Object)null)
{
Object.Destroy((Object)(object)component);
}
}
protected override string GetTitle()
{
return "Admin Card";
}
protected override string GetDescription()
{
return "Hold ~ to fly slowly, but sacrifice half your durability.";
}
protected override Rarity GetRarity()
{
return (Rarity)2;
}
protected override CardThemeColorType GetTheme()
{
return (CardThemeColorType)3;
}
protected override CardInfoStat[] GetStats()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: 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_002c: Expected O, but got Unknown
//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_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
return (CardInfoStat[])(object)new CardInfoStat[2]
{
new CardInfoStat
{
positive = true,
stat = "Tilde Flight",
amount = "Enabled"
},
new CardInfoStat
{
positive = false,
stat = "Max Health",
amount = "-50%"
}
};
}
protected override GameObject GetCardArt()
{
return null;
}
}
public class AdminFlyComponent : MonoBehaviour
{
private Rigidbody2D rb;
private void Start()
{
rb = ((Component)this).GetComponent<Rigidbody2D>();
}
private void Update()
{
//IL_003c: 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)
if (!((Object)(object)rb == (Object)null))
{
if (Input.GetKey((KeyCode)96))
{
rb.gravityScale = 0f;
rb.velocity = new Vector2(rb.velocity.x, 2.5f);
}
else
{
rb.gravityScale = 4f;
}
}
}
private void OnDestroy()
{
if ((Object)(object)rb != (Object)null)
{
rb.gravityScale = 4f;
}
}
}
public class Watching : CustomCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
cardInfo.allowMultiple = true;
gun.projectileSpeed = 1.5f;
statModifiers.movementSpeed = 0.5f;
GameObject val = Resources.Load<GameObject>("0 cards/Homing");
if ((Object)(object)val != (Object)null)
{
Gun component = val.GetComponent<Gun>();
if ((Object)(object)component != (Object)null && component.objectsToSpawn.Length != 0)
{
List<ObjectsToSpawn> list = gun.objectsToSpawn.ToList();
list.Add(component.objectsToSpawn[0]);
gun.objectsToSpawn = list.ToArray();
}
}
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers statModifiers)
{
((Component)player).gameObject.AddComponent<BlinkEffect>();
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers statModifiers)
{
BlinkEffect component = ((Component)player).gameObject.GetComponent<BlinkEffect>();
if ((Object)(object)component != (Object)null)
{
Object.Destroy((Object)(object)component);
}
}
protected override CardInfoStat[] GetStats()
{
return null;
}
protected override string GetTitle()
{
return "Watching";
}
protected override string GetDescription()
{
return "Your bullets see all and fly fast, but your hyper-focus forces you to blink... constantly.";
}
protected override Rarity GetRarity()
{
return (Rarity)2;
}
protected override CardThemeColorType GetTheme()
{
return (CardThemeColorType)4;
}
protected override GameObject GetCardArt()
{
return null;
}
}
public class BlinkEffect : MonoBehaviour
{
private Player player;
private float blinkTimer = 0f;
private float timeBetweenBlinks = 4f;
private void Start()
{
player = ((Component)this).GetComponent<Player>();
}
private void Update()
{
if (!((Object)(object)player == (Object)null))
{
blinkTimer += Time.deltaTime;
if (blinkTimer >= timeBetweenBlinks)
{
blinkTimer = 0f;
((MonoBehaviour)this).StartCoroutine(TriggerBlink());
}
}
}
private IEnumerator TriggerBlink()
{
if ((Object)(object)player != (Object)null)
{
Rigidbody2D rb = ((Component)player).GetComponent<Rigidbody2D>();
if ((Object)(object)rb != (Object)null)
{
rb.velocity = Vector2.zero;
yield return (object)new WaitForSeconds(0.3f);
}
}
}
}
public class DancepartyCard : CustomCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
((Component)player).gameObject.AddComponent<DancepartyBehavior>();
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
DancepartyBehavior component = ((Component)player).gameObject.GetComponent<DancepartyBehavior>();
if ((Object)(object)component != (Object)null)
{
Object.Destroy((Object)(object)component);
}
}
protected override string GetTitle()
{
return "Danceparty";
}
protected override string GetDescription()
{
return "Blocking forces nearby players to dance for 1 second, but costs 50% of your current health!";
}
protected override Rarity GetRarity()
{
return (Rarity)2;
}
protected override CardInfoStat[] GetStats()
{
return null;
}
protected override CardThemeColorType GetTheme()
{
return (CardThemeColorType)8;
}
protected override GameObject GetCardArt()
{
return null;
}
}
public class DancepartyBehavior : MonoBehaviour
{
private Player localPlayer;
private Block blockComponent;
private void Awake()
{
localPlayer = ((Component)this).GetComponent<Player>();
blockComponent = ((Component)this).GetComponent<Block>();
if ((Object)(object)blockComponent != (Object)null)
{
Block obj = blockComponent;
obj.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(obj.BlockAction, new Action<BlockTriggerType>(OnPlayerBlock));
}
}
private void OnPlayerBlock(BlockTriggerType triggerType)
{
//IL_00b3: 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_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)localPlayer != (Object)null && (Object)(object)localPlayer.data != (Object)null && !localPlayer.data.dead)
{
CharacterData data = localPlayer.data;
data.health *= 0.5f;
}
float num = 15f;
List<Player> players = PlayerManager.instance.players;
foreach (Player item in players)
{
if (!((Object)(object)item == (Object)(object)localPlayer) && !item.data.dead)
{
float num2 = Vector2.Distance(Vector2.op_Implicit(((Component)localPlayer).transform.position), Vector2.op_Implicit(((Component)item).transform.position));
if (num2 <= num)
{
((Component)item).gameObject.AddComponent<DancingStunEffect>().Initialize(1f);
}
}
}
}
private void OnDestroy()
{
if ((Object)(object)blockComponent != (Object)null)
{
Block obj = blockComponent;
obj.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(obj.BlockAction, new Action<BlockTriggerType>(OnPlayerBlock));
}
}
}
public class DancingStunEffect : MonoBehaviour
{
private Player targetPlayer;
private float duration;
private float timer;
private float originalSpeed;
public void Initialize(float freezeTime)
{
duration = freezeTime;
targetPlayer = ((Component)this).GetComponent<Player>();
if ((Object)(object)targetPlayer != (Object)null && (Object)(object)targetPlayer.data != (Object)null && (Object)(object)targetPlayer.data.stats != (Object)null)
{
originalSpeed = targetPlayer.data.stats.movementSpeed;
targetPlayer.data.stats.movementSpeed = 0f;
}
}
private void Update()
{
timer += Time.deltaTime;
if (timer >= duration)
{
Object.Destroy((Object)(object)this);
}
}
private void OnDestroy()
{
if ((Object)(object)targetPlayer != (Object)null && (Object)(object)targetPlayer.data != (Object)null && (Object)(object)targetPlayer.data.stats != (Object)null)
{
targetPlayer.data.stats.movementSpeed = originalSpeed;
}
}
}
public class FlipCard : CustomCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
gun.reloadTime = 3f;
statModifiers.movementSpeed = 0.75f;
statModifiers.jump = 2.5f;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
((Component)player).gameObject.AddComponent<FlipBehavior>();
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
FlipBehavior component = ((Component)player).gameObject.GetComponent<FlipBehavior>();
if ((Object)(object)component != (Object)null)
{
Object.Destroy((Object)(object)component);
}
}
protected override string GetTitle()
{
return "Flip";
}
protected override string GetDescription()
{
return "Activates a wild backflip jump that heals you completely, but forces you to rotate and wastes your reloading time!";
}
protected override Rarity GetRarity()
{
return (Rarity)1;
}
protected override CardInfoStat[] GetStats()
{
return null;
}
protected override CardThemeColorType GetTheme()
{
return (CardThemeColorType)0;
}
protected override GameObject GetCardArt()
{
return null;
}
}
public class FlipBehavior : MonoBehaviour
{
private Player localPlayer;
private void Awake()
{
localPlayer = ((Component)this).GetComponent<Player>();
}
private void Update()
{
if (!((Object)(object)localPlayer == (Object)null) && !((Object)(object)localPlayer.data == (Object)null) && !localPlayer.data.dead && localPlayer.data.input.jumpWasPressed)
{
localPlayer.data.health = localPlayer.data.MaxHealth;
((Component)localPlayer).gameObject.transform.Rotate(0f, 0f, 180f);
}
}
}
public class GlitchedCard : CustomCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
cardInfo.allowMultiple = false;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers statModifiers)
{
((Component)player).gameObject.AddComponent<GlitchedStalkerEffect>();
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers statModifiers)
{
GlitchedStalkerEffect component = ((Component)player).gameObject.GetComponent<GlitchedStalkerEffect>();
if ((Object)(object)component != (Object)null)
{
Object.Destroy((Object)(object)component);
}
}
protected override CardInfoStat[] GetStats()
{
return null;
}
protected override string GetTitle()
{
return "G\u0336L\u0336I\u0336T\u0336C\u0336H\u0336E\u0336D\u0336";
}
protected override string GetDescription()
{
return "IT'S WATCHING. DO NOT LET IT TOUCH YOU.";
}
protected override Rarity GetRarity()
{
return (Rarity)2;
}
protected override CardThemeColorType GetTheme()
{
return (CardThemeColorType)4;
}
protected override GameObject GetCardArt()
{
return null;
}
}
public class GlitchedStalkerEffect : MonoBehaviour
{
private Player player;
private GameObject stalkerBlock;
private float stalkerSpeed = 4.5f;
private float roundTimer = 0f;
private float cardDuration = 15f;
private void Start()
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Expected O, but got Unknown
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
//IL_0088: 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_00b8: 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_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
player = ((Component)this).GetComponent<Player>();
stalkerBlock = new GameObject("GlitchedStalkerBlock");
SpriteRenderer val = stalkerBlock.AddComponent<SpriteRenderer>();
Texture2D val2 = new Texture2D(16, 16);
for (int i = 0; i < 16; i++)
{
for (int j = 0; j < 16; j++)
{
val2.SetPixel(i, j, Color.black);
}
}
val2.Apply();
val.sprite = Sprite.Create(val2, new Rect(0f, 0f, 16f, 16f), new Vector2(0.5f, 0.5f));
stalkerBlock.transform.position = ((Component)this).transform.position + new Vector3(8f, 8f, 0f);
stalkerBlock.transform.localScale = new Vector3(2f, 2f, 1f);
}
private void Update()
{
//IL_003d: 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_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_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_00cc: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)player == (Object)null || (Object)(object)stalkerBlock == (Object)null)
{
return;
}
stalkerBlock.transform.position = Vector3.MoveTowards(stalkerBlock.transform.position, ((Component)this).transform.position, stalkerSpeed * Time.deltaTime);
float num = Vector3.Distance(stalkerBlock.transform.position, ((Component)this).transform.position);
if (num < 1f)
{
HealthHandler component = ((Component)player).GetComponent<HealthHandler>();
if ((Object)(object)component != (Object)null)
{
((Damagable)component).TakeDamage(Vector2.up * 9999f, Vector2.op_Implicit(((Component)this).transform.position), Color.black, (GameObject)null, (Player)null, true, true, (DamageSource)0);
}
SelfDestruct();
}
roundTimer += Time.deltaTime;
if (roundTimer >= cardDuration)
{
SelfDestruct();
}
}
private void SelfDestruct()
{
if ((Object)(object)stalkerBlock != (Object)null)
{
Object.Destroy((Object)(object)stalkerBlock);
}
Object.Destroy((Object)(object)this);
}
private void OnDestroy()
{
if ((Object)(object)stalkerBlock != (Object)null)
{
Object.Destroy((Object)(object)stalkerBlock);
}
}
}
[BepInPlugin("com.skate.rounds.mychaoticcards", "Skate's Chaotic Cards Pack", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Mod1Plugin : BaseUnityPlugin
{
private void Start()
{
CustomCard.BuildCard<OmegaSuperAccidentCard>();
CustomCard.BuildCard<DancepartyCard>();
CustomCard.BuildCard<FlipCard>();
CustomCard.BuildCard<AdminCard>();
CustomCard.BuildCard<Watching>();
CustomCard.BuildCard<GlitchedCard>();
}
}