Decompiled source of KittyCards v1.0.1

plugins/Rawrnd.dll

Decompiled 19 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
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: AssemblyTitle("Rawrnd")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Rawrnd")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("aea7e004-0691-44a5-8e3c-55a0a9c2fe66")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
[HarmonyPatch(typeof(HealthHandler), "DoDamage")]
public class CollarHitPatch
{
	private static void Postfix(HealthHandler __instance, Vector2 damage, Vector2 position, Color blinkColor, GameObject damagingWeapon, Player damagingPlayer, bool healthRemoval, bool lethal, bool ignoreBlock)
	{
		if ((Object)(object)damagingPlayer == (Object)null)
		{
			return;
		}
		CollarEffect component = ((Component)damagingPlayer).GetComponent<CollarEffect>();
		if (!((Object)(object)component == (Object)null) && !((Object)(object)component.pet != (Object)null))
		{
			Player component2 = ((Component)__instance).GetComponent<Player>();
			if ((Object)(object)component2 != (Object)null && (Object)(object)component2 != (Object)(object)damagingPlayer)
			{
				component.AssignPet(component2);
			}
		}
	}
}
public class CollarEffect : MonoBehaviour
{
	public Player owner;

	public Player pet;

	private LineRenderer leashLine;

	private const float leashLength = 6f;

	private const float pullForce = 15f;

	private const float extraDamage = 1.25f;

	private void Start()
	{
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Expected O, but got Unknown
		//IL_0055: 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)
		leashLine = ((Component)this).gameObject.AddComponent<LineRenderer>();
		leashLine.startWidth = 0.1f;
		leashLine.endWidth = 0.1f;
		((Renderer)leashLine).material = new Material(Shader.Find("Sprites/Default"));
		leashLine.startColor = Color.yellow;
		leashLine.endColor = Color.yellow;
		((Renderer)leashLine).enabled = false;
	}

	private void Update()
	{
		//IL_0058: 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_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: 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_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: 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)
		if ((Object)(object)owner == (Object)null)
		{
			return;
		}
		if ((Object)(object)pet == (Object)null)
		{
			((Renderer)leashLine).enabled = false;
			return;
		}
		((Renderer)leashLine).enabled = true;
		leashLine.SetPosition(0, ((Component)owner).transform.position);
		leashLine.SetPosition(1, ((Component)pet).transform.position);
		float num = Vector2.Distance(Vector2.op_Implicit(((Component)owner).transform.position), Vector2.op_Implicit(((Component)pet).transform.position));
		if (num > 6f)
		{
			Vector3 val = ((Component)owner).transform.position - ((Component)pet).transform.position;
			Vector2 val2 = Vector2.op_Implicit(((Vector3)(ref val)).normalized);
			((Component)pet).GetComponent<Rigidbody2D>().AddForce(val2 * 15f);
		}
	}

	public void AssignPet(Player newPet)
	{
		pet = newPet;
	}
}
public class CollarCard : CustomCard
{
	public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers)
	{
		cardInfo.allowMultiple = false;
	}

	public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers statModifiers)
	{
		CollarEffect collarEffect = ((Component)player).gameObject.AddComponent<CollarEffect>();
		collarEffect.owner = player;
	}

	public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers statModifiers)
	{
		CollarEffect component = ((Component)player).gameObject.GetComponent<CollarEffect>();
		if ((Object)(object)component != (Object)null)
		{
			Object.Destroy((Object)(object)component);
		}
	}

	protected override string GetTitle()
	{
		return "Collar";
	}

	protected override string GetDescription()
	{
		return "Bonk someone to make them your kitty! They can't wander too far, and they're extra sensitive to your love (+25% damage from you).";
	}

	protected override CardInfoStat[] GetStats()
	{
		//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_0014: 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_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Expected O, but got Unknown
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: 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_0056: 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_005e: Expected O, but got Unknown
		return (CardInfoStat[])(object)new CardInfoStat[2]
		{
			new CardInfoStat
			{
				positive = true,
				stat = "Own an enemy",
				amount = "on hit",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Pet damage taken",
				amount = "+25%",
				simepleAmount = (SimpleAmount)0
			}
		};
	}

	protected override Rarity GetRarity()
	{
		return (Rarity)2;
	}

	protected override GameObject GetCardArt()
	{
		return null;
	}

	protected override CardThemeColorType GetTheme()
	{
		return (CardThemeColorType)8;
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Rawrnd.rounds.kittycards", "Kitty Cards", "1.0.0")]
[BepInProcess("Rounds.exe")]
public class Plugin : BaseUnityPlugin
{
	private void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		new Harmony("com.Rawrnd.rounds.kittycards").PatchAll();
	}

	private void Start()
	{
		CustomCard.BuildCard<ClawCard>();
		CustomCard.BuildCard<CollarCard>();
	}
}
public class ClawCard : CustomCard
{
	public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers)
	{
		cardInfo.allowMultiple = true;
	}

	public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers statModifiers)
	{
		block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, (Action<BlockTriggerType>)delegate
		{
			OnBlock(player);
		});
	}

	private void OnBlock(Player player)
	{
		//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_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: 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_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		Player[] array = Object.FindObjectsOfType<Player>();
		Player[] array2 = array;
		foreach (Player val in array2)
		{
			if ((Object)(object)val == (Object)(object)player)
			{
				continue;
			}
			float num = Vector2.Distance(Vector2.op_Implicit(((Component)player).transform.position), Vector2.op_Implicit(((Component)val).transform.position));
			if (num < 3f)
			{
				CharacterData component = ((Component)val).GetComponent<CharacterData>();
				if ((Object)(object)component != (Object)null)
				{
					float num2 = component.maxHealth * 0.08f;
					((Component)val).GetComponent<HealthHandler>().DoDamage(new Vector2(num2 / 5f, 0f), Vector2.op_Implicit(((Component)val).transform.position), Color.red, (GameObject)null, player, true, true, false);
				}
			}
		}
	}

	public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers statModifiers)
	{
	}

	protected override string GetTitle()
	{
		return "Claw";
	}

	protected override string GetDescription()
	{
		return "These claws aren't for decoration, nya~";
	}

	protected override CardInfoStat[] GetStats()
	{
		//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_0014: 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_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Expected O, but got Unknown
		return (CardInfoStat[])(object)new CardInfoStat[1]
		{
			new CardInfoStat
			{
				positive = true,
				stat = "Bleed on block",
				amount = "8% max HP / 5s",
				simepleAmount = (SimpleAmount)0
			}
		};
	}

	protected override Rarity GetRarity()
	{
		return (Rarity)1;
	}

	protected override GameObject GetCardArt()
	{
		return null;
	}

	protected override CardThemeColorType GetTheme()
	{
		return (CardThemeColorType)0;
	}
}