Decompiled source of Animebirds Boomboom Cards v6.1.0
AnimebirdsBoomBoomCards/Animebirds Boomboom cards.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Text; using AnimebirdsBoomboomCards.Cards; using BepInEx; using HarmonyLib; using Photon.Pun; using TMPro; using UnboundLib; using UnboundLib.Cards; using UnboundLib.GameModes; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("Animebirds Boomboom cards")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Animebirds Boomboom cards")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("9029e8c3-f22f-4414-a6ce-1fa377c2e99a")] [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")] namespace AnimebirdsBoomboomCards.Cards { public class PuppetMaster : CustomCard { protected override string GetTitle() { return "Puppet Master"; } protected override string GetDescription() { return "Convert your enemies to friends, collect all to win"; } public override string GetModName() { return "Animebirds Boomboom Cards"; } protected override Rarity GetRarity() { return (Rarity)2; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)4; } 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 = "Conversion", amount = "+5s", simepleAmount = (SimpleAmount)3 } }; } protected override GameObject GetCardArt() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Animebirds_Boomboom_cards.Resources.PuppetMasterart.png"); if (stream == null) { return new GameObject("PuppetMasterart_missing"); } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ImageConversion.LoadImage(val, array); Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 1f); GameObject val2 = new GameObject("PuppetMasterart"); Image obj = val2.AddComponent<Image>(); obj.sprite = sprite; obj.preserveAspect = true; val2.GetComponent<RectTransform>().sizeDelta = new Vector2((float)((Texture)val).width * 2.1f, (float)((Texture)val).height * 2.1f); ((Object)val2).hideFlags = (HideFlags)61; return val2; } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers stats, Block block) { } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers stats) { PuppetMasterPatches.EnsurePatched(); PuppetMasterEffect orAddComponent = ExtensionMethods.GetOrAddComponent<PuppetMasterEffect>(((Component)player).gameObject, false); orAddComponent.ownerPlayer = player; orAddComponent.stacks++; if (orAddComponent.stacks == 1) { orAddComponent.gun = gun; gun.ShootPojectileAction = (Action<GameObject>)Delegate.Combine(gun.ShootPojectileAction, new Action<GameObject>(orAddComponent.OnShootProjectile)); } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers stats) { PuppetMasterEffect puppetMasterEffect = ((player != null) ? ((Component)player).gameObject.GetComponent<PuppetMasterEffect>() : null); if (!((Object)(object)puppetMasterEffect != (Object)null)) { return; } puppetMasterEffect.stacks--; if (puppetMasterEffect.stacks <= 0) { if ((Object)(object)puppetMasterEffect.gun != (Object)null) { Gun gun2 = puppetMasterEffect.gun; gun2.ShootPojectileAction = (Action<GameObject>)Delegate.Remove(gun2.ShootPojectileAction, new Action<GameObject>(puppetMasterEffect.OnShootProjectile)); } Object.Destroy((Object)(object)puppetMasterEffect); } } } public class PuppetMasterEffect : MonoBehaviour { [CompilerGenerated] private sealed class <CleanupPuppets>d__10 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CleanupPuppets>d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; PuppetState[] array = Object.FindObjectsOfType<PuppetState>(); foreach (PuppetState puppetState in array) { if ((Object)(object)puppetState != (Object)null) { puppetState.ForceRestore(); } } <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <EndRoundForInfection>d__8 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Player master; private int <originalMasterTeam>5__2; private List<Player> <allPlayers>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <EndRoundForInfection>d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <allPlayers>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)master == (Object)null) { return false; } <originalMasterTeam>5__2 = master.teamID; <allPlayers>5__3 = PlayerManager.instance.players; foreach (Player item in <allPlayers>5__3) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item.data == (Object)null)) { PuppetState component = ((Component)item).GetComponent<PuppetState>(); if ((Object)(object)component != (Object)null) { component.ForceRestore(); } } } <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 2; return true; case 2: <>1__state = -1; foreach (Player item2 in <allPlayers>5__3) { if (!((Object)(object)item2 == (Object)null) && !((Object)(object)item2.data == (Object)null) && !item2.data.dead && item2.teamID != <originalMasterTeam>5__2) { ((Damagable)item2.data.healthHandler).CallTakeDamage(Vector2.up * 999f, Vector2.op_Implicit(((Component)item2).transform.position), (GameObject)null, master, true); } } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Player ownerPlayer; public Gun gun; public int stacks; private const float BaseConversionTime = 5f; private static bool isCheckingInfection; public float GetConversionTime() { return 5f * (float)stacks; } public void OnShootProjectile(GameObject projectile) { ProjectileHit component = projectile.GetComponent<ProjectileHit>(); if ((Object)(object)component != (Object)null) { component.bulletCanDealDeamage = false; } } public static void CheckInfectionComplete(Player master) { if (isCheckingInfection || (Object)(object)master == (Object)null) { return; } isCheckingInfection = true; List<Player> players = PlayerManager.instance.players; if (players == null || players.Count <= 1) { isCheckingInfection = false; return; } int teamID = master.teamID; bool flag = true; int num = 0; bool flag2 = false; foreach (Player item in players) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item.data == (Object)null) && !item.data.dead) { num++; if (item.teamID != teamID) { flag = false; break; } if ((Object)(object)((Component)item).GetComponent<PuppetState>() != (Object)null) { flag2 = true; } } } if (flag && num > 1 && flag2) { PuppetMasterEffect component = ((Component)master).GetComponent<PuppetMasterEffect>(); if ((Object)(object)component != (Object)null) { ((MonoBehaviour)component).StartCoroutine(component.EndRoundForInfection(master)); } } isCheckingInfection = false; } [IteratorStateMachine(typeof(<EndRoundForInfection>d__8))] private IEnumerator EndRoundForInfection(Player master) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <EndRoundForInfection>d__8(0) { master = master }; } private void Start() { GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)CleanupPuppets); } [IteratorStateMachine(typeof(<CleanupPuppets>d__10))] private IEnumerator CleanupPuppets(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CleanupPuppets>d__10(0); } private void OnDestroy() { GameModeManager.RemoveHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)CleanupPuppets); if ((Object)(object)gun != (Object)null) { Gun obj = gun; obj.ShootPojectileAction = (Action<GameObject>)Delegate.Remove(obj.ShootPojectileAction, new Action<GameObject>(OnShootProjectile)); } } } public class PuppetState : MonoBehaviour { [CompilerGenerated] private sealed class <AutoShootRoutine>d__14 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PuppetState <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <AutoShootRoutine>d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown int num = <>1__state; PuppetState puppetState = <>4__this; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; if ((Object)(object)puppetState.puppet == (Object)null || (Object)(object)puppetState.puppet.data == (Object)null || puppetState.puppet.data.dead) { goto IL_00fa; } WeaponHandler component = ((Component)puppetState.puppet).GetComponent<WeaponHandler>(); if ((Object)(object)component != (Object)null && (Object)(object)component.gun != (Object)null) { ((Weapon)component.gun).Attack(0f, true, 1f, 1f, false); } } else { <>1__state = -1; } if (puppetState.isActive && (Object)(object)puppetState.puppet != (Object)null && (Object)(object)puppetState.puppet.data != (Object)null && !puppetState.puppet.data.dead) { <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 1; return true; } goto IL_00fa; IL_00fa: return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <OnPointEnd>d__12 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PuppetState <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <OnPointEnd>d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; PuppetState puppetState = <>4__this; if (num != 0) { return false; } <>1__state = -1; puppetState.ForceRestore(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <RestoreAfterDelay>d__23 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PuppetState <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <RestoreAfterDelay>d__23(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown int num = <>1__state; PuppetState puppetState = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; float conversionDuration = puppetState.GetConversionDuration(); <>2__current = (object)new WaitForSeconds(conversionDuration); <>1__state = 1; return true; } case 1: <>1__state = -1; puppetState.RestoreOriginal(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Player puppet; private Player masterPlayer; private int originalTeamID; private int originalPlayerID; private Coroutine restoreCoroutine; private Coroutine autoShootCoroutine; private GameObject visualEffect; private bool isActive; private bool hasCleanedUp; private bool reviveHookRegistered; private Dictionary<Renderer, Color> savedColors = new Dictionary<Renderer, Color>(); private void Start() { GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)OnPointEnd); } [IteratorStateMachine(typeof(<OnPointEnd>d__12))] private IEnumerator OnPointEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <OnPointEnd>d__12(0) { <>4__this = this }; } public void Initialize(Player targetPlayer, Player master) { if ((Object)(object)targetPlayer == (Object)null || (Object)(object)master == (Object)null || (Object)(object)targetPlayer == (Object)(object)master || (Object)(object)targetPlayer.data == (Object)null || targetPlayer.data.dead) { return; } puppet = targetPlayer; masterPlayer = master; if (!isActive) { originalTeamID = puppet.teamID; originalPlayerID = puppet.playerID; if (!reviveHookRegistered && (Object)(object)puppet.data.healthHandler != (Object)null) { HealthHandler healthHandler = puppet.data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnPuppetRevive)); reviveHookRegistered = true; } SaveOriginalColors(); } if (restoreCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(restoreCoroutine); } ChangeToPuppet(master.teamID, master.playerID); CreateVisualEffect(); isActive = true; if (autoShootCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(autoShootCoroutine); } autoShootCoroutine = ((MonoBehaviour)this).StartCoroutine(AutoShootRoutine()); restoreCoroutine = ((MonoBehaviour)this).StartCoroutine(RestoreAfterDelay()); } [IteratorStateMachine(typeof(<AutoShootRoutine>d__14))] private IEnumerator AutoShootRoutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <AutoShootRoutine>d__14(0) { <>4__this = this }; } private void SaveOriginalColors() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)puppet == (Object)null) { return; } savedColors.Clear(); Renderer[] componentsInChildren = ((Component)((Component)puppet).transform.root).GetComponentsInChildren<Renderer>(true); foreach (Renderer val in componentsInChildren) { if (!((Object)(object)val == (Object)null) && !((Object)((Component)val).gameObject).name.ToLower().Contains("heat")) { SpriteRenderer val2 = (SpriteRenderer)(object)((val is SpriteRenderer) ? val : null); if (val2 != null) { savedColors[val] = val2.color; } else if ((Object)(object)val.material != (Object)null && val.material.HasProperty("_Color")) { savedColors[val] = val.material.color; } } } } private void OnPuppetRevive() { if (!((Object)(object)puppet == (Object)null) && !hasCleanedUp) { if (autoShootCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(autoShootCoroutine); autoShootCoroutine = null; } if ((Object)(object)visualEffect != (Object)null) { Object.Destroy((Object)(object)visualEffect); visualEffect = null; } puppet.teamID = originalTeamID; RestoreOriginalColors(); } } public Player GetMaster() { return masterPlayer; } private float GetConversionDuration() { if ((Object)(object)masterPlayer == (Object)null) { return 5f; } PuppetMasterEffect component = ((Component)masterPlayer).GetComponent<PuppetMasterEffect>(); if ((Object)(object)component != (Object)null) { return component.GetConversionTime(); } return 5f; } private void ChangeToPuppet(int newTeamID, int masterPlayerID) { if (!((Object)(object)puppet == (Object)null)) { puppet.teamID = newTeamID; ChangeToPuppetColor(masterPlayerID); } } private void ChangeToPuppetColor(int masterPlayerID) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)puppet == (Object)null) { return; } PlayerSkin playerSkinColors = PlayerSkinBank.GetPlayerSkinColors(masterPlayerID); Color color = playerSkinColors.color; Renderer[] componentsInChildren = ((Component)((Component)puppet).transform.root).GetComponentsInChildren<Renderer>(true); foreach (Renderer val in componentsInChildren) { if (!((Object)(object)val == (Object)null) && !((Object)((Component)val).gameObject).name.ToLower().Contains("heat")) { SpriteRenderer val2 = (SpriteRenderer)(object)((val is SpriteRenderer) ? val : null); if (val2 != null) { val2.color = color; } else if ((Object)(object)val.material != (Object)null && val.material.HasProperty("_Color")) { val.material.color = color; } } } SetTeamColor[] componentsInChildren2 = ((Component)((Component)puppet).transform.root).GetComponentsInChildren<SetTeamColor>(true); foreach (SetTeamColor val3 in componentsInChildren2) { if ((Object)(object)val3 != (Object)null) { val3.Set(playerSkinColors); } } } private void RestoreOriginalColors() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)puppet == (Object)null) { return; } foreach (KeyValuePair<Renderer, Color> savedColor in savedColors) { if (!((Object)(object)savedColor.Key == (Object)null)) { Renderer key = savedColor.Key; SpriteRenderer val = (SpriteRenderer)(object)((key is SpriteRenderer) ? key : null); if (val != null) { val.color = savedColor.Value; } else if ((Object)(object)savedColor.Key.material != (Object)null && savedColor.Key.material.HasProperty("_Color")) { savedColor.Key.material.color = savedColor.Value; } } } PlayerSkin playerSkinColors = PlayerSkinBank.GetPlayerSkinColors(originalPlayerID); SetTeamColor[] componentsInChildren = ((Component)((Component)puppet).transform.root).GetComponentsInChildren<SetTeamColor>(true); foreach (SetTeamColor val2 in componentsInChildren) { if ((Object)(object)val2 != (Object)null) { val2.Set(playerSkinColors); } } savedColors.Clear(); } private void CreateVisualEffect() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Expected O, but got Unknown if ((Object)(object)visualEffect != (Object)null) { Object.Destroy((Object)(object)visualEffect); } visualEffect = new GameObject("PuppetVisual"); visualEffect.transform.SetParent(((Component)puppet).transform); visualEffect.transform.localPosition = Vector3.zero; ParticleSystem obj = visualEffect.AddComponent<ParticleSystem>(); MainModule main = obj.main; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(1f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0.5f); ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0.15f); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(0.6f, 0f, 0.8f, 0.8f)); ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(-0.2f); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).maxParticles = 30; ((MainModule)(ref main)).loop = true; EmissionModule emission = obj.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(15f); ShapeModule shape = obj.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).radius = 1.2f; ParticleSystemRenderer component = ((Component)obj).GetComponent<ParticleSystemRenderer>(); ((Renderer)component).sortingOrder = 100; ((Renderer)component).material = new Material(Shader.Find("Sprites/Default")); visualEffect.AddComponent<PuppetStringEffect>(); obj.Play(); } [IteratorStateMachine(typeof(<RestoreAfterDelay>d__23))] private IEnumerator RestoreAfterDelay() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <RestoreAfterDelay>d__23(0) { <>4__this = this }; } public void ForceRestore() { if (!hasCleanedUp) { if (restoreCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(restoreCoroutine); } if (autoShootCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(autoShootCoroutine); autoShootCoroutine = null; } RestoreOriginal(); } } private void RestoreOriginal() { if (!hasCleanedUp) { if (autoShootCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(autoShootCoroutine); autoShootCoroutine = null; } if ((Object)(object)puppet == (Object)null || (Object)(object)puppet.data == (Object)null) { CleanupAndDestroy(); return; } puppet.teamID = originalTeamID; RestoreOriginalColors(); CleanupAndDestroy(); } } private void CleanupAndDestroy() { if (!hasCleanedUp) { hasCleanedUp = true; if ((Object)(object)visualEffect != (Object)null) { Object.Destroy((Object)(object)visualEffect); } savedColors.Clear(); isActive = false; GameModeManager.RemoveHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)OnPointEnd); if (reviveHookRegistered && (Object)(object)puppet != (Object)null && (Object)(object)puppet.data != (Object)null && (Object)(object)puppet.data.healthHandler != (Object)null) { HealthHandler healthHandler = puppet.data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnPuppetRevive)); reviveHookRegistered = false; } Object.Destroy((Object)(object)this); } } private void OnDestroy() { if (!hasCleanedUp) { if ((Object)(object)visualEffect != (Object)null) { Object.Destroy((Object)(object)visualEffect); } savedColors.Clear(); GameModeManager.RemoveHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)OnPointEnd); if (reviveHookRegistered && (Object)(object)puppet != (Object)null && (Object)(object)puppet.data != (Object)null && (Object)(object)puppet.data.healthHandler != (Object)null) { HealthHandler healthHandler = puppet.data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnPuppetRevive)); reviveHookRegistered = false; } } } private void Update() { if ((Object)(object)puppet != (Object)null && (Object)(object)puppet.data != (Object)null && puppet.data.dead && !hasCleanedUp) { if (autoShootCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(autoShootCoroutine); autoShootCoroutine = null; } if ((Object)(object)visualEffect != (Object)null) { Object.Destroy((Object)(object)visualEffect); visualEffect = null; } RestoreOriginalColors(); CleanupAndDestroy(); } } } public class PuppetStringEffect : MonoBehaviour { private LineRenderer[] strings; private Transform puppet; private int stringCount = 5; private float stringHeight = 3f; private float waveSpeed = 2f; private float waveAmount = 0.3f; private void Start() { //IL_0039: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) puppet = ((Component)this).transform.parent; strings = (LineRenderer[])(object)new LineRenderer[stringCount]; for (int i = 0; i < stringCount; i++) { GameObject val = new GameObject($"String_{i}"); val.transform.SetParent(((Component)this).transform); LineRenderer val2 = val.AddComponent<LineRenderer>(); val2.startWidth = 0.02f; val2.endWidth = 0.01f; val2.positionCount = 10; ((Renderer)val2).material = new Material(Shader.Find("Sprites/Default")); val2.startColor = new Color(0.6f, 0f, 0.8f, 0.6f); val2.endColor = new Color(0.4f, 0f, 0.6f, 0.2f); ((Renderer)val2).sortingOrder = 99; val2.useWorldSpace = true; strings[i] = val2; } } private void Update() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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) //IL_0078: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)puppet == (Object)null) { return; } Vector3 position = puppet.position; for (int i = 0; i < stringCount; i++) { if (!((Object)(object)strings[i] == (Object)null)) { float num = 360f / (float)stringCount * (float)i * ((float)Math.PI / 180f); float num2 = 0.5f; Vector3 val = position + new Vector3(Mathf.Cos(num) * num2, Mathf.Sin(num) * num2 * 0.5f, 0f); Vector3 val2 = val + Vector3.up * stringHeight; for (int j = 0; j < strings[i].positionCount; j++) { float num3 = (float)j / (float)(strings[i].positionCount - 1); Vector3 val3 = Vector3.Lerp(val, val2, num3); float num4 = Mathf.Sin(Time.time * waveSpeed + (float)i * 0.5f + num3 * 3f) * waveAmount; val3.x += num4; strings[i].SetPosition(j, val3); } } } } private void OnDestroy() { if (strings == null) { return; } LineRenderer[] array = strings; foreach (LineRenderer val in array) { if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)((Component)val).gameObject); } } } } [HarmonyPatch] internal static class PuppetMasterPatches { private static bool _patched; private static Harmony _harmony; public static void EnsurePatched() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (_patched) { return; } try { _harmony = new Harmony("animebirds.puppetmaster"); _harmony.PatchAll(typeof(PuppetMasterPatches)); _patched = true; } catch { } } [HarmonyPrefix] [HarmonyPatch(typeof(HealthHandler), "TakeDamage", new Type[] { typeof(Vector2), typeof(Vector2), typeof(Color), typeof(GameObject), typeof(Player), typeof(bool), typeof(bool) })] private static bool TakeDamage_Prefix(HealthHandler __instance, Player damagingPlayer) { try { if ((Object)(object)damagingPlayer == (Object)null) { return true; } Player component = ((Component)__instance).GetComponent<Player>(); if ((Object)(object)component == (Object)null) { return true; } if (damagingPlayer.teamID == component.teamID && damagingPlayer.playerID != component.playerID) { return false; } return true; } catch { return true; } } [HarmonyPostfix] [HarmonyPatch(typeof(HealthHandler), "TakeDamage", new Type[] { typeof(Vector2), typeof(Vector2), typeof(Color), typeof(GameObject), typeof(Player), typeof(bool), typeof(bool) })] private static void TakeDamage_Postfix(HealthHandler __instance, Player damagingPlayer) { try { if ((Object)(object)damagingPlayer == (Object)null) { return; } Player component = ((Component)__instance).GetComponent<Player>(); if (!((Object)(object)component == (Object)null) && !((Object)(object)component == (Object)(object)damagingPlayer) && !component.data.dead) { Player val = null; PuppetState component2 = ((Component)damagingPlayer).GetComponent<PuppetState>(); if ((Object)(object)component2 != (Object)null) { val = component2.GetMaster(); } else if ((Object)(object)((Component)damagingPlayer).GetComponent<PuppetMasterEffect>() != (Object)null) { val = damagingPlayer; } if (!((Object)(object)val == (Object)null) && component.teamID != val.teamID) { ExtensionMethods.GetOrAddComponent<PuppetState>(((Component)component).gameObject, false).Initialize(component, val); PuppetMasterEffect.CheckInfectionComplete(val); } } } catch { } } } } namespace AnimebirdsBoomboomcards { public class AllForOne : CustomCard { protected override string GetTitle() { return "AllForOne"; } protected override string GetDescription() { return "He who takes from All."; } protected override Rarity GetRarity() { return (Rarity)1; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)3; } 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 //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_00ae: 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_00b6: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00cf: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[6] { new CardInfoStat { positive = false, stat = "Opponents", amount = "-20% Damage", simepleAmount = (SimpleAmount)1 }, new CardInfoStat { positive = false, stat = "Opponents", amount = "-20% HP", simepleAmount = (SimpleAmount)1 }, new CardInfoStat { positive = false, stat = "Opponents", amount = "-20% Move speed", simepleAmount = (SimpleAmount)1 }, new CardInfoStat { positive = false, stat = "Opponents", amount = "-20% Lifesteal", simepleAmount = (SimpleAmount)1 }, new CardInfoStat { positive = false, stat = "Opponents", amount = "+20% Reload", simepleAmount = (SimpleAmount)1 }, new CardInfoStat { positive = false, stat = "Opponents", amount = "+20% Block CD", simepleAmount = (SimpleAmount)1 } }; } protected override GameObject GetCardArt() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Animebirds_Boomboom_cards.Resources.AllForOne.png"); if (stream == null) { return new GameObject("AllForOne_missing"); } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ImageConversion.LoadImage(val, array); Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 1f); GameObject val2 = new GameObject("AllForOne"); Image obj = val2.AddComponent<Image>(); obj.sprite = sprite; obj.preserveAspect = true; val2.GetComponent<RectTransform>().sizeDelta = new Vector2((float)((Texture)val).width * 2.5f, (float)((Texture)val).height * 2.5f); ((Object)val2).hideFlags = (HideFlags)61; return val2; } public override void OnAddCard(Player player, Gun gun, GunAmmo ammo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers stats) { AllForOnePatches.EnsurePatched(); AllForOne_Marker allForOne_Marker = ((Component)player).gameObject.GetComponent<AllForOne_Marker>(); if (!Object.op_Implicit((Object)(object)allForOne_Marker)) { allForOne_Marker = ((Component)player).gameObject.AddComponent<AllForOne_Marker>(); } allForOne_Marker.stacks++; if (!((Object)(object)PlayerManager.instance != (Object)null) || PlayerManager.instance.players == null) { return; } foreach (Player player2 in PlayerManager.instance.players) { if (!((Object)(object)player2 == (Object)null) && !((Object)(object)player2 == (Object)(object)player)) { AllForOne_Effect.ApplyTo(player2, 1); } } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo ammo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers stats) { AllForOne_Marker component = ((Component)player).gameObject.GetComponent<AllForOne_Marker>(); if ((Object)(object)component != (Object)null) { component.stacks = Mathf.Max(0, component.stacks - 1); if (component.stacks == 0) { Object.Destroy((Object)(object)component); } } } public override string GetModName() { return "Animebirds Boomboom Cards"; } } public class AllForOne_Marker : MonoBehaviour { public int stacks; } [HarmonyPatch] internal static class AllForOnePatches { private static bool _patched; private static Harmony _harmony; public static void EnsurePatched() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (_patched) { return; } try { _harmony = new Harmony("animebirds.allforone"); _harmony.PatchAll(typeof(AllForOnePatches)); _patched = true; } catch { } } [HarmonyPostfix] [HarmonyPatch(typeof(PlayerManager), "AddPlayer")] private static void Post_AddPlayer(Player __result) { try { if ((Object)(object)__result == (Object)null || (Object)(object)PlayerManager.instance == (Object)null) { return; } List<Player> players = PlayerManager.instance.players; if (players == null) { return; } foreach (Player item in players) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item == (Object)(object)__result)) { AllForOne_Marker component = ((Component)item).GetComponent<AllForOne_Marker>(); if ((Object)(object)component != (Object)null && component.stacks > 0) { AllForOne_Effect.ApplyTo(__result, component.stacks); } } } } catch { } } } public class AllForOne_Effect : MonoBehaviour { private int totalStacks; public static void ApplyTo(Player victim, int stacks) { if (Object.op_Implicit((Object)(object)victim)) { AllForOne_Effect component = ((Component)victim).gameObject.GetComponent<AllForOne_Effect>(); if (!Object.op_Implicit((Object)(object)component)) { component = ((Component)victim).gameObject.AddComponent<AllForOne_Effect>(); component.Initialize(victim, stacks); } else { component.AddStacks(stacks); } } } private void Initialize(Player victim, int stacks) { totalStacks = stacks; ApplyDebuffs(victim); SceneManager.sceneLoaded += OnSceneLoaded; } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { Object.Destroy((Object)(object)this); } public void AddStacks(int stacks) { totalStacks += stacks; } private void ApplyDebuffs(Player victim) { if (Object.op_Implicit((Object)(object)victim) && Object.op_Implicit((Object)(object)victim.data)) { float num = Mathf.Pow(0.8f, (float)totalStacks); float num2 = Mathf.Pow(1.2f, (float)totalStacks); CharacterStatModifiers component = ((Component)victim).GetComponent<CharacterStatModifiers>(); if ((Object)(object)component != (Object)null) { component.movementSpeed *= num; component.lifeSteal *= num; } CharacterData data = victim.data; if ((Object)(object)data != (Object)null) { float num3 = ((data.maxHealth > 0f) ? Mathf.Clamp01(data.health / data.maxHealth) : 1f); data.maxHealth = Mathf.Max(1f, data.maxHealth * num); data.health = Mathf.Clamp(data.maxHealth * num3, 0f, data.maxHealth); } Block component2 = ((Component)victim).GetComponent<Block>(); if ((Object)(object)component2 != (Object)null) { component2.cdMultiplier *= num2; } Holding component3 = ((Component)victim).GetComponent<Holding>(); object obj; if (component3 == null) { obj = null; } else { Holdable holdable = component3.holdable; obj = ((holdable != null) ? ((Component)holdable).GetComponent<Gun>() : null); } Gun val = (Gun)obj; if (!Object.op_Implicit((Object)(object)val)) { val = ((Component)victim).GetComponentInChildren<Gun>(true); } if ((Object)(object)val != (Object)null) { Gun obj2 = val; obj2.damage *= num; Gun obj3 = val; obj3.reloadTime *= num2; } } } private void OnDestroy() { SceneManager.sceneLoaded -= OnSceneLoaded; } } public class Anticipation : CustomCard { private static GameObject s_FacePrefab; protected override string GetTitle() { return "Anticipation"; } protected override string GetDescription() { return "You know it's coming for you"; } protected override GameObject GetCardArt() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0072: 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_0096: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_00e2: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Animebirds_Boomboom_cards.Resources.Anticipationart.png"); if (stream == null) { Debug.LogError("[Anticipationart] Resource not found!"); return new GameObject("Anticipationart_missing"); } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ImageConversion.LoadImage(val, array); Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 1f); GameObject val2 = new GameObject("Anticipationart"); Image obj = val2.AddComponent<Image>(); obj.sprite = sprite; obj.preserveAspect = true; val2.GetComponent<RectTransform>().sizeDelta = new Vector2((float)((Texture)val).width * 2.5f, (float)((Texture)val).height * 2.5f); ((Object)val2).hideFlags = (HideFlags)61; return val2; } protected override Rarity GetRarity() { return (Rarity)1; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)2; } 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 //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[3] { new CardInfoStat { positive = true, stat = "Damage", amount = "+150%", simepleAmount = (SimpleAmount)3 }, new CardInfoStat { positive = false, stat = "Projectile speed", amount = "-50%", simepleAmount = (SimpleAmount)6 }, new CardInfoStat { positive = false, stat = "Reload time", amount = "+0.5s", simepleAmount = (SimpleAmount)0 } }; } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers stats, Block block) { gun.damage *= 2.5f; gun.projectielSimulatonSpeed *= 0.5f; gun.reloadTimeAdd += 0.5f; } public override void OnAddCard(Player player, Gun gun, GunAmmo ammo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers stats) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown EnsureFacePrefab(); List<ObjectsToSpawn> list = ((gun.objectsToSpawn != null) ? new List<ObjectsToSpawn>(gun.objectsToSpawn) : new List<ObjectsToSpawn>()); list.Add(new ObjectsToSpawn { AddToProjectile = s_FacePrefab }); gun.objectsToSpawn = list.ToArray(); } private static void EnsureFacePrefab() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown if (!((Object)(object)s_FacePrefab != (Object)null)) { s_FacePrefab = new GameObject("AB_EvilLaughFaceFx"); ((Object)s_FacePrefab).hideFlags = (HideFlags)61; s_FacePrefab.AddComponent<EvilLaughFaceEffect>(); } } public override string GetModName() { return "Animebirds Boomboom Cards"; } } public class EvilLaughFaceEffect : MonoBehaviour { private const float AnimFps = 10f; private const float MinWorldScale = 0.18f; private const float MaxWorldScale = 3f; private const float ScaleFromRadius = 3f; private const float OffsetFromRadius = 0.65f; private Transform root; private Rigidbody2D rb; private Renderer[] rootRenderers; private Collider2D[] rootColliders; private GameObject faceGO; private SpriteRenderer faceSR; private float animTimer; private int frameIndex; private static Sprite[] s_frames; private static readonly string[] kNames = new string[8] { "EvilLaughAni/EvilLaugh_1", "EvilLaughAni/EvilLaugh_2", "EvilLaughAni/EvilLaugh_3", "EvilLaughAni/EvilLaugh_4", "EvilLaughAni/EvilLaugh_5", "EvilLaughAni/EvilLaugh_6", "EvilLaughAni/EvilLaugh_7", "EvilLaughAni/EvilLaugh_8" }; private void Awake() { //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown root = ((Component)this).transform.root; rb = (Object.op_Implicit((Object)(object)root) ? ((Component)root).GetComponent<Rigidbody2D>() : null); rootRenderers = (Object.op_Implicit((Object)(object)root) ? ((Component)root).GetComponentsInChildren<Renderer>(true) : null); rootColliders = (Object.op_Implicit((Object)(object)root) ? ((Component)root).GetComponentsInChildren<Collider2D>(true) : null); if (s_frames == null) { List<Sprite> list = new List<Sprite>(kNames.Length); string[] array = kNames; for (int i = 0; i < array.Length; i++) { Sprite val = Resources.Load<Sprite>(array[i]); if ((Object)(object)val != (Object)null) { list.Add(val); } } s_frames = list.ToArray(); if (s_frames.Length == 0) { Debug.LogWarning("[EvilLaughFaceEffect] No sprites found under Resources/EvilLaughAni/…"); } } faceGO = new GameObject("evilLaugh_face"); faceGO.transform.SetParent(root, false); faceSR = faceGO.AddComponent<SpriteRenderer>(); faceSR.sprite = ((s_frames != null && s_frames.Length != 0) ? s_frames[0] : null); SpriteRenderer componentInChildren = ((Component)root).GetComponentInChildren<SpriteRenderer>(); if ((Object)(object)componentInChildren != (Object)null) { ((Renderer)faceSR).sortingLayerID = ((Renderer)componentInChildren).sortingLayerID; ((Renderer)faceSR).sortingOrder = ((Renderer)componentInChildren).sortingOrder + 50; } } private void LateUpdate() { if (!Object.op_Implicit((Object)(object)root) || !Object.op_Implicit((Object)(object)faceGO) || !Object.op_Implicit((Object)(object)faceSR)) { Object.Destroy((Object)(object)this); } else if (!((Component)root).gameObject.activeInHierarchy || ((Object)(object)rb != (Object)null && !rb.simulated) || RenderersDisabled(rootRenderers) || CollidersDisabled(rootColliders)) { Object.Destroy((Object)(object)faceGO); Object.Destroy((Object)(object)this); } else { UpdateAnimation(); UpdateTransform(); } } private void UpdateAnimation() { if (s_frames != null && s_frames.Length != 0) { animTimer += Time.deltaTime * 10f; while (animTimer >= 1f) { animTimer -= 1f; frameIndex = (frameIndex + 1) % s_frames.Length; faceSR.sprite = s_frames[frameIndex]; } } } private void UpdateTransform() { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_0060: Unknown result type (might be due to invalid IL or missing references) float num = 0.2f; if (rootRenderers != null && rootRenderers.Length != 0) { float num2 = 0f; Renderer[] array = rootRenderers; foreach (Renderer val in array) { if (Object.op_Implicit((Object)(object)val) && val.enabled) { Bounds bounds = val.bounds; Vector3 extents = ((Bounds)(ref bounds)).extents; float num3 = Mathf.Max(extents.x, extents.y); if (num3 > num2) { num2 = num3; } } } num = ((num2 > 0f) ? num2 : num); } float num4 = Mathf.Clamp(num * 3f, 0.18f, 3f); float num5 = 1f; Vector3 lossyScale = root.lossyScale; if (Mathf.Abs(lossyScale.x) > 0.0001f) { num5 = 1f / Mathf.Abs(lossyScale.x); } faceGO.transform.localScale = Vector3.one * (num4 * num5); Vector2 right = Vector2.right; if ((Object)(object)rb != (Object)null) { Vector2 velocity = rb.velocity; if (((Vector2)(ref velocity)).sqrMagnitude > 0.0001f) { velocity = rb.velocity; right = ((Vector2)(ref velocity)).normalized; goto IL_0159; } } right = Vector2.op_Implicit(root.right); goto IL_0159; IL_0159: float num6 = Mathf.Clamp(num * 0.65f, 0.05f, 1.5f); Vector3 val2 = root.InverseTransformDirection(Vector2.op_Implicit(right)); faceGO.transform.localPosition = val2 * num6; float num7 = Mathf.Atan2(right.y, right.x) * 57.29578f; faceGO.transform.rotation = Quaternion.AngleAxis(num7, Vector3.forward); } private static bool RenderersDisabled(Renderer[] rs) { if (rs == null || rs.Length == 0) { return false; } foreach (Renderer val in rs) { if (Object.op_Implicit((Object)(object)val) && val.enabled) { return false; } } return true; } private static bool CollidersDisabled(Collider2D[] cs) { if (cs == null || cs.Length == 0) { return false; } foreach (Collider2D val in cs) { if (Object.op_Implicit((Object)(object)val) && ((Behaviour)val).enabled) { return false; } } return true; } private void OnDestroy() { if (Object.op_Implicit((Object)(object)faceGO)) { Object.Destroy((Object)(object)faceGO); } } } public class Artillery : CustomCard { protected override string GetTitle() { return "Artillery"; } protected override string GetDescription() { return "Who does'nt love a good artillery."; } protected override GameObject GetCardArt() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0072: 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_0096: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_00e2: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Animebirds_Boomboom_cards.Resources.Artilleryart.png"); if (stream == null) { Debug.LogError("[Artilleryart] Resource not found!"); return new GameObject("Artilleryart_missing"); } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ImageConversion.LoadImage(val, array); Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 1f); GameObject val2 = new GameObject("Artilleryart"); Image obj = val2.AddComponent<Image>(); obj.sprite = sprite; obj.preserveAspect = true; val2.GetComponent<RectTransform>().sizeDelta = new Vector2((float)((Texture)val).width * 2f, (float)((Texture)val).height * 2f); ((Object)val2).hideFlags = (HideFlags)61; return val2; } protected override Rarity GetRarity() { return (Rarity)0; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)1; } 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 //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[3] { new CardInfoStat { positive = true, stat = "Damage", amount = "+125%", simepleAmount = (SimpleAmount)3 }, new CardInfoStat { positive = false, stat = "Reload time", amount = "+0.5s", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Move Speed", amount = "-30%", simepleAmount = (SimpleAmount)6 } }; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { gun.damage *= 2.25f; characterStats.movementSpeed *= 0.7f; gun.reloadTimeAdd += 0.5f; } public override string GetModName() { return "Animebirds Boomboom Cards"; } } public class Assasinator : CustomCard { protected override string GetTitle() { return "Assasinator"; } protected override string GetDescription() { return "Target Aquire"; } protected override Rarity GetRarity() { return (Rarity)0; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)0; } protected override GameObject GetCardArt() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Animebirds_Boomboom_cards.Resources.Assinatorart.png"); if (stream == null) { return new GameObject("Assinatorart_missing"); } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ImageConversion.LoadImage(val, array); Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 1f); GameObject val2 = new GameObject("Assinatorart"); Image obj = val2.AddComponent<Image>(); obj.sprite = sprite; obj.preserveAspect = true; val2.GetComponent<RectTransform>().sizeDelta = new Vector2((float)((Texture)val).width * 2.5f, (float)((Texture)val).height * 2.5f); ((Object)val2).hideFlags = (HideFlags)61; return val2; } 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 //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[3] { new CardInfoStat { positive = true, stat = "Damage", amount = "+20%", simepleAmount = (SimpleAmount)6 }, new CardInfoStat { positive = true, stat = "Movement speed", amount = "+10%", simepleAmount = (SimpleAmount)6 }, new CardInfoStat { positive = true, stat = "Jump height", amount = "+20%", simepleAmount = (SimpleAmount)6 } }; } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers stats, Block block) { gun.damage *= 1.2f; stats.movementSpeed *= 1.1f; stats.jump *= 1.2f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers stats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers stats) { } public override string GetModName() { return "Animebirds Boomboom Cards"; } } public class AtomicBomb : CustomCard { private static GameObject _attachPrefab; protected override string GetTitle() { return "Atomic Bomb"; } protected override string GetDescription() { return "Death comes for all."; } protected override Rarity GetRarity() { return (Rarity)2; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)0; } protected override GameObject GetCardArt() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Animebirds_Boomboom_cards.Resources.AtomicBombart.png"); if (stream == null) { return new GameObject("AtomicBombart_missing"); } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ImageConversion.LoadImage(val, array); Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 1f); GameObject val2 = new GameObject("AtomicBombart"); Image obj = val2.AddComponent<Image>(); obj.sprite = sprite; obj.preserveAspect = true; val2.GetComponent<RectTransform>().sizeDelta = new Vector2((float)((Texture)val).width * 1.75f, (float)((Texture)val).height * 1.75f); ((Object)val2).hideFlags = (HideFlags)61; return val2; } 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 //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_00ae: 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_00b6: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[4] { new CardInfoStat { positive = true, stat = "Damage", amount = "+300%", simepleAmount = (SimpleAmount)3 }, new CardInfoStat { positive = false, stat = "Reload time", amount = "+3s", simepleAmount = (SimpleAmount)3 }, new CardInfoStat { positive = false, stat = "Projectile speed", amount = "-20%", simepleAmount = (SimpleAmount)6 }, new CardInfoStat { positive = false, stat = "Max ammo", amount = "1", simepleAmount = (SimpleAmount)6 } }; } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers stats, Block block) { if (Object.op_Implicit((Object)(object)gun)) { gun.damage *= 4f; gun.projectielSimulatonSpeed *= 0.8f; } } public override void OnAddCard(Player player, Gun gun, GunAmmo ammo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers stats) { //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_00a8: Expected O, but got Unknown if ((Object)(object)ammo != (Object)null) { ammo.reloadTimeAdd += 3f; } AB_AtomicRuntime aB_AtomicRuntime = ((Component)player).gameObject.GetComponent<AB_AtomicRuntime>(); if (!Object.op_Implicit((Object)(object)aB_AtomicRuntime)) { aB_AtomicRuntime = ((Component)player).gameObject.AddComponent<AB_AtomicRuntime>(); } aB_AtomicRuntime.AddStack(player); EnsureAttachPrefab(); if (Object.op_Implicit((Object)(object)gun)) { List<ObjectsToSpawn> list = gun.objectsToSpawn?.ToList() ?? new List<ObjectsToSpawn>(); if (!list.Any((ObjectsToSpawn o) => Object.op_Implicit((Object)(object)o.AddToProjectile) && Object.op_Implicit((Object)(object)o.AddToProjectile.GetComponent<SkullTrailPSAttach>()))) { list.Add(new ObjectsToSpawn { AddToProjectile = _attachPrefab }); gun.objectsToSpawn = list.ToArray(); } } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo ammo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers stats) { AB_AtomicRuntime aB_AtomicRuntime = (Object.op_Implicit((Object)(object)player) ? ((Component)player).gameObject.GetComponent<AB_AtomicRuntime>() : null); if (Object.op_Implicit((Object)(object)aB_AtomicRuntime)) { aB_AtomicRuntime.RemoveStack(); } } private static void EnsureAttachPrefab() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)_attachPrefab)) { _attachPrefab = new GameObject("AB_Atomic_SkullTrailPS_Attach"); _attachPrefab.AddComponent<SkullTrailPSAttach>(); } } public override string GetModName() { return "Animebirds Boomboom Cards"; } } [DisallowMultipleComponent] public class AB_AtomicRuntime : MonoBehaviour { [CompilerGenerated] private sealed class <EnsureGunCoroutine>d__14 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public AB_AtomicRuntime <>4__this; private WaitForSeconds <wait>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <EnsureGunCoroutine>d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <wait>5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown int num = <>1__state; AB_AtomicRuntime aB_AtomicRuntime = <>4__this; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; } else { <>1__state = -1; <wait>5__2 = new WaitForSeconds(0.25f); } aB_AtomicRuntime.ResolveGunAndApply(); <>2__current = <wait>5__2; <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Player owner; private CharacterData data; private HealthHandler health; private Gun gun; private GunAmmo ammo; private AB_AtomicOnGun onGun; private int stacks; private Coroutine ensureLoop; private const float EnsureInterval = 0.25f; public void AddStack(Player p) { owner = p ?? owner; data = (Object.op_Implicit((Object)(object)owner) ? owner.data : data); health = (Object.op_Implicit((Object)(object)data) ? data.healthHandler : health); stacks++; if ((Object)(object)health != (Object)null) { HealthHandler obj = health; obj.reviveAction = (Action)Delegate.Remove(obj.reviveAction, new Action(OnRevive)); HealthHandler obj2 = health; obj2.reviveAction = (Action)Delegate.Combine(obj2.reviveAction, new Action(OnRevive)); } SceneManager.sceneLoaded -= OnSceneLoaded; SceneManager.sceneLoaded += OnSceneLoaded; if (ensureLoop == null) { ensureLoop = ((MonoBehaviour)this).StartCoroutine(EnsureGunCoroutine()); } ResolveGunAndApply(); } public void RemoveStack() { if (stacks <= 0) { return; } stacks--; if (Object.op_Implicit((Object)(object)onGun)) { onGun.SetActive(stacks > 0); } if (stacks == 0) { if (Object.op_Implicit((Object)(object)onGun)) { onGun.SetActive(state: false); } Detach(); if ((Object)(object)health != (Object)null) { HealthHandler obj = health; obj.reviveAction = (Action)Delegate.Remove(obj.reviveAction, new Action(OnRevive)); } SceneManager.sceneLoaded -= OnSceneLoaded; if (ensureLoop != null) { ((MonoBehaviour)this).StopCoroutine(ensureLoop); ensureLoop = null; } Object.Destroy((Object)(object)this); } } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (Object.op_Implicit((Object)(object)onGun)) { onGun.ForceRevert(); } Detach(); if (ensureLoop != null) { ((MonoBehaviour)this).StopCoroutine(ensureLoop); ensureLoop = null; } Object.Destroy((Object)(object)this); } private void OnDestroy() { if ((Object)(object)health != (Object)null) { HealthHandler obj = health; obj.reviveAction = (Action)Delegate.Remove(obj.reviveAction, new Action(OnRevive)); } SceneManager.sceneLoaded -= OnSceneLoaded; if (ensureLoop != null) { ((MonoBehaviour)this).StopCoroutine(ensureLoop); ensureLoop = null; } if (Object.op_Implicit((Object)(object)onGun)) { onGun.SetActive(state: false); } Detach(); } private void OnRevive() { ResolveGunAndApply(); } [IteratorStateMachine(typeof(<EnsureGunCoroutine>d__14))] private IEnumerator EnsureGunCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <EnsureGunCoroutine>d__14(0) { <>4__this = this }; } private void ResolveGunAndApply() { if ((Object)(object)owner == (Object)null) { return; } Gun val = null; GunAmmo val2 = null; Holding component = ((Component)owner).GetComponent<Holding>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.holdable)) { val = ((Component)component.holdable).GetComponent<Gun>(); if (Object.op_Implicit((Object)(object)val)) { val2 = ((Component)val).GetComponentInChildren<GunAmmo>(); } } if (!Object.op_Implicit((Object)(object)val)) { val = ((Component)owner).GetComponentInChildren<Gun>(true); if (Object.op_Implicit((Object)(object)val)) { val2 = ((Component)val).GetComponentInChildren<GunAmmo>(); } } if ((Object)(object)val != (Object)(object)gun || (Object)(object)val2 != (Object)(object)ammo) { Detach(); gun = val; ammo = val2; if (Object.op_Implicit((Object)(object)gun) && Object.op_Implicit((Object)(object)ammo)) { onGun = ((Component)gun).gameObject.GetComponent<AB_AtomicOnGun>(); if (!Object.op_Implicit((Object)(object)onGun)) { onGun = ((Component)gun).gameObject.AddComponent<AB_AtomicOnGun>(); } onGun.Bind(gun, ammo); onGun.SetActive(stacks > 0); } } else if (Object.op_Implicit((Object)(object)onGun)) { onGun.SetActive(stacks > 0); } } private void Detach() { gun = null; ammo = null; onGun = null; } } [DisallowMultipleComponent] public class AB_AtomicOnGun : MonoBehaviour { private Gun gun; private GunAmmo ammo; private FieldInfo gunAmmoField; private PropertyInfo gunAmmoProp; private bool bound; private bool active; private void Awake() { SceneManager.sceneLoaded += OnSceneLoaded; } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { Object.Destroy((Object)(object)this); } public void Bind(Gun g, GunAmmo a) { gun = g; ammo = a; if (Object.op_Implicit((Object)(object)gun) && Object.op_Implicit((Object)(object)ammo)) { gunAmmoField = typeof(Gun).GetField("ammo", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); gunAmmoProp = typeof(Gun).GetProperty("ammo", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); bound = true; } else { bound = false; } } public void SetActive(bool state) { if (!bound) { active = false; return; } active = state; if (active) { EnforceAtomicStats(); } } public void ForceRevert() { active = false; bound = false; } private void LateUpdate() { if (active && bound) { EnforceAtomicStats(); } } private void EnforceAtomicStats() { if (Object.op_Implicit((Object)(object)gun) && Object.op_Implicit((Object)(object)ammo)) { if (ammo.maxAmmo != 1) { ammo.maxAmmo = 1; } TryClampCurrentToOne(); TrySetGunAmmo(1); } } private void OnDisable() { active = false; } private void OnDestroy() { SceneManager.sceneLoaded -= OnSceneLoaded; active = false; } private void TryClampCurrentToOne() { try { FieldInfo field = ((object)ammo).GetType().GetField("currentAmmo", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null && (int)field.GetValue(ammo) > 1) { field.SetValue(ammo, 1); } } catch { } } private void TrySetGunAmmo(int value) { try { if (gunAmmoField != null && gunAmmoField.FieldType == typeof(int)) { gunAmmoField.SetValue(gun, value); } else if (gunAmmoProp != null && gunAmmoProp.CanWrite && gunAmmoProp.PropertyType == typeof(int)) { gunAmmoProp.SetValue(gun, value, null); } } catch { } } } internal class SkullTrailPSAttach : MonoBehaviour { public float lifetime = 0.6f; public float startSize = 1f; public float sizeJitter = 0.2f; public float ratePerUnit = 1f; public float spinMin = -180f; public float spinMax = 180f; public int sortingOrderOffset = 6; private Transform root; private ParticleSystem ps; private ParticleSystemRenderer psr; private SpriteRenderer projSR; private Texture2D skullTex; private Material mat; private bool initialized; private void OnEnable() { Setup(); if ((Object)(object)ps != (Object)null) { ps.Clear(true); ps.Play(true); } } private void OnDisable() { if ((Object)(object)ps != (Object)null) { ps.Stop(true, (ParticleSystemStopBehavior)0); } } private void Setup() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00c7: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Expected O, but got Unknown //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Expected O, but got Unknown if (!initialized) { root = ((Component)this).transform.root; ps = ((Component)this).gameObject.AddComponent<ParticleSystem>(); psr = ((Component)this).GetComponent<ParticleSystemRenderer>(); MainModule main = ps.main; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(lifetime); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).startSize = new MinMaxCurve(startSize * (1f - sizeJitter), startSize * (1f + sizeJitter)); ((MainModule)(ref main)).maxParticles = 2000; EmissionModule emission = ps.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f); ((EmissionModule)(ref emission)).rateOverDistance = MinMaxCurve.op_Implicit(ratePerUnit); RotationOverLifetimeModule rotationOverLifetime = ps.rotationOverLifetime; ((RotationOverLifetimeModule)(ref rotationOverLifetime)).enabled = true; ((RotationOverLifetimeModule)(ref rotationOverLifetime)).z = new MinMaxCurve(spinMin * ((float)Math.PI / 180f), spinMax * ((float)Math.PI / 180f)); ColorOverLifetimeModule colorOverLifetime = ps.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val = new Gradient(); val.SetKeys((GradientColorKey[])(object)new GradientColorKey[3] { new GradientColorKey(new Color(1f, 0.95f, 0.25f), 0f), new GradientColorKey(new Color(0.9f, 0.7f, 0.15f), 0.4f), new GradientColorKey(new Color(0.35f, 0.2f, 0.05f), 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(0.95f, 0f), new GradientAlphaKey(0.85f, 0.5f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val); if ((Object)(object)psr != (Object)null) { psr.renderMode = (ParticleSystemRenderMode)0; psr.alignment = (ParticleSystemRenderSpace)0; mat = new Material(Shader.Find("Sprites/Default")); skullTex = GenerateYellowSkull64(); mat.mainTexture = (Texture)(object)skullTex; ((Renderer)psr).material = mat; } projSR = (Object.op_Implicit((Object)(object)root) ? ((Component)root).GetComponentInChildren<SpriteRenderer>() : null); ApplySorting(); initialized = true; } } private void LateUpdate() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)root) && Object.op_Implicit((Object)(object)psr)) { ((Component)this).transform.position = root.position; if (!Object.op_Implicit((Object)(object)projSR)) { projSR = ((Component)root).GetComponentInChildren<SpriteRenderer>(); } ApplySorting(); } } private void ApplySorting() { if (Object.op_Implicit((Object)(object)psr)) { if (Object.op_Implicit((Object)(object)projSR)) { ((Renderer)psr).sortingLayerID = ((Renderer)projSR).sortingLayerID; ((Renderer)psr).sortingOrder = ((Renderer)projSR).sortingOrder + sortingOrderOffset; } else { ((Renderer)psr).sortingOrder = 1000 + sortingOrderOffset; } } } private static Texture2D GenerateYellowSkull64() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0053: 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_00b1: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(64, 64, (TextureFormat)4, false) { wrapMode = (TextureWrapMode)1, filterMode = (FilterMode)1 }; Color[] px = (Color[])(object)new Color[4096]; Color val2 = default(Color); ((Color)(ref val2))..ctor(0f, 0f, 0f, 0f); for (int i = 0; i < px.Length; i++) { px[i] = val2; } Color val3 = default(Color); ((Color)(ref val3))..ctor(1f, 0.95f, 0.2f, 1f); Vector2 val4 = default(Vector2); ((Vector2)(ref val4))..ctor(32f, 37.12f); float num = 17.92f; for (int j = 0; j < 64; j++) { for (int k = 0; k < 64; k++) { float num2 = (float)k + 0.5f - val4.x; float num3 = (float)j + 0.5f - val4.y; if (num2 * num2 + num3 * num3 <= num * num) { px[j * 64 + k] = val3; } } } for (int l = 19; l < 28; l++) { for (int m = 19; m < 44; m++) { px[l * 64 + m] = val3; } } Dot(26, 38, 4); Dot(37, 38, 4); val.SetPixels(px); val.Apply(false, true); return val; void Dot(int cx, int cy, int rad) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) for (int n = cy - rad; n <= cy + rad; n++) { for (int num4 = cx - rad; num4 <= cx + rad; num4++) { if (num4 >= 0 && n >= 0 && num4 < 64 && n < 64 && (num4 - cx) * (num4 - cx) + (n - cy) * (n - cy) <= rad * rad) { px[n * 64 + num4] = new Color(0.1f, 0.1f, 0.1f, 1f); } } } } } } public class AutoBlock : CustomCard { protected override string GetTitle() { return "Auto Block"; } protected override string GetDescription() { return "Your Block got your back"; } protected override Rarity GetRarity() { return (Rarity)2; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)2; } 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 = "Auto Block", amount = "Enabled", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Block cooldown", amount = "-20%", simepleAmount = (SimpleAmount)6 } }; } protected override GameObject GetCardArt() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown res