Decompiled source of ChaosPoppycarsCardsCore v1.0.0
ChaosPoppycarsCardsCore.dll
Decompiled 3 months 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.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using CPCCardInfostuffs; using CPCCore.Extensions; using CPCCore.MonoBehaviours; using CPCCore.Patches; using CPCCore.Utilities; using CPCTabInfoSTATS; using CardChoiceSpawnUniqueCardPatch.CustomCategories; using CardThemeLib; using HarmonyLib; using Jotunn.Utils; using MapEmbiggener.Patches; using Microsoft.CodeAnalysis; using ModdingUtils.Extensions; using ModdingUtils.MonoBehaviours; using ModdingUtils.Utils; using Photon.Pun; using PlayerActionsHelper.Extensions; using RarityLib.Utils; using SimulationChamber; using TMPro; using TabInfo.Utils; using UnboundLib; using UnboundLib.Cards; using UnboundLib.GameModes; using UnboundLib.Networking; using UnboundLib.Utils; using UnityEngine; using UnityEngine.Diagnostics; using WillsWackyManagers.Utils; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class CardHolder : MonoBehaviour { public List<GameObject> Cards; public List<GameObject> HiddenCards; public void RegisterCards() { foreach (GameObject card in Cards) { if ((Object)(object)card.gameObject.GetComponent<CPCCardInfo>() == (Object)null) { CustomCard.RegisterUnityCard(card, "CPC", card.GetComponent<CardInfo>().cardName, true, (Action<CardInfo>)null); } else { CustomCard.RegisterUnityCard(card, card.gameObject.GetComponent<CPCCardInfo>().Tag, card.GetComponent<CardInfo>().cardName, true, (Action<CardInfo>)null); } } foreach (GameObject hiddenCard in HiddenCards) { } } } namespace CPCTabInfoSTATS { public class TabinfoInterface { public static void Setup() { StatCategory val = TabInfoManager.RegisterCategory("Other Stats", 0); TabInfoManager.RegisterStat(val, "Max Dashes", (Func<Player, bool>)((Player p) => p.data.stats.GetAdditionalData().dashes != 0), (Func<Player, string>)((Player p) => $"{p.data.stats.GetAdditionalData().dashes:F0}")); TabInfoManager.RegisterStat(val, "Blocks are", (Func<Player, bool>)((Player p) => p.data.stats.GetAdditionalData().blockMover && !p.data.stats.GetAdditionalData().blockPush), (Func<Player, string>)((Player p) => "pulling")); TabInfoManager.RegisterStat(val, "Blocks <b>are</b>", (Func<Player, bool>)((Player p) => p.data.stats.GetAdditionalData().blockMover && p.data.stats.GetAdditionalData().blockPush), (Func<Player, string>)((Player p) => "pushing")); StatCategory val2 = TabInfoManager.RegisterCategory("Minecraft Stats", 1); TabInfoManager.RegisterStat(val2, "Totems", (Func<Player, bool>)((Player p) => p.data.stats.GetAdditionalData().totems != 0), (Func<Player, string>)((Player p) => $"{p.data.stats.GetAdditionalData().totems:F0}")); TabInfoManager.RegisterStat(val2, "Remaining Totems", (Func<Player, bool>)((Player p) => p.data.stats.GetAdditionalData().remainingTotems != 0), (Func<Player, string>)((Player p) => $"{p.data.stats.GetAdditionalData().remainingTotems:F0}")); TabInfoManager.RegisterStat(val2, "Glowstone", (Func<Player, bool>)((Player p) => p.data.stats.GetAdditionalData().Glowstone > 0), (Func<Player, string>)((Player p) => $"{p.data.stats.GetAdditionalData().Glowstone:F0}")); TabInfoManager.RegisterStat(val2, "Redstone", (Func<Player, bool>)((Player p) => p.data.stats.GetAdditionalData().Redstone > 0), (Func<Player, string>)((Player p) => $"{p.data.stats.GetAdditionalData().Redstone:F0}")); StatCategory val3 = TabInfoManager.RegisterCategory("Critical Hit Stats", 5); TabInfoManager.RegisterStat(val3, "Crit Damage", (Func<Player, bool>)((Player p) => p.data.weaponHandler.gun.GetAdditionalData().criticalHitDamage1 != 1f), (Func<Player, string>)((Player p) => $"{(p.data.weaponHandler.gun.GetAdditionalData().criticalHitDamage1 - 1f) * 100f:F0}%")); TabInfoManager.RegisterStat(val3, "Crit Chance", (Func<Player, bool>)((Player p) => p.data.weaponHandler.gun.GetAdditionalData().criticalHitChance1 != 0f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.GetAdditionalData().criticalHitChance1 * 100f:F0}%")); TabInfoManager.RegisterStat(val3, "Crit Slow", (Func<Player, bool>)((Player p) => p.data.weaponHandler.gun.GetAdditionalData().CritSlow > 0f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.GetAdditionalData().CritSlow * 100f:F0}%")); TabInfoManager.RegisterStat(val3, "Crit Bounces", (Func<Player, bool>)((Player p) => p.data.weaponHandler.gun.GetAdditionalData().criticalHitBounces != 0), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.GetAdditionalData().criticalHitBounces:F0}")); TabInfoManager.RegisterStat(val3, "Damage on Bounce when you Crit", (Func<Player, bool>)((Player p) => p.data.weaponHandler.gun.GetAdditionalData().criticalHitDamageOnBounce > 0f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.GetAdditionalData().criticalHitDamageOnBounce * 100f:F0}%")); TabInfoManager.RegisterStat(val3, "Guranteed Crits", (Func<Player, bool>)((Player p) => p.data.weaponHandler.gun.GetAdditionalData().guranteedCrits), (Func<Player, string>)((Player p) => "True")); TabInfoManager.RegisterStat(val3, "Crit Bullet Speed", (Func<Player, bool>)((Player p) => p.data.weaponHandler.gun.GetAdditionalData().criticalBulletSpeed > 1f), (Func<Player, string>)((Player p) => $"{(p.data.weaponHandler.gun.GetAdditionalData().criticalBulletSpeed - 1f) * 100f:F0}%")); TabInfoManager.RegisterStat(val3, "Crit Simulation Speed", (Func<Player, bool>)((Player p) => p.data.weaponHandler.gun.GetAdditionalData().criticalSimulationSpeed > 1f), (Func<Player, string>)((Player p) => $"{(p.data.weaponHandler.gun.GetAdditionalData().criticalSimulationSpeed - 1f) * 100f:F0}%")); TabInfoManager.RegisterStat(val3, "Unblockable Crits", (Func<Player, bool>)((Player p) => p.data.weaponHandler.gun.GetAdditionalData().unblockableCrits), (Func<Player, string>)((Player p) => "True")); TabInfoManager.RegisterStat(val3, "Blocking Crits", (Func<Player, bool>)((Player p) => p.data.weaponHandler.gun.GetAdditionalData().BlockingCrits), (Func<Player, string>)((Player p) => "True")); TabInfoManager.RegisterStat(val3, "Crit Heal", (Func<Player, bool>)((Player p) => p.data.weaponHandler.gun.GetAdditionalData().criticalHeal > 0f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.GetAdditionalData().criticalHeal:F0}")); TabInfoManager.RegisterStat(val3, "Crit CD Reduction", (Func<Player, bool>)((Player p) => p.data.weaponHandler.gun.GetAdditionalData().criticalBlockCDReduction > 0f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.GetAdditionalData().criticalBlockCDReduction:F0}%")); } } } namespace CPCCardInfostuffs { public class CPCCardInfo : MonoBehaviour { [Header("CPC Settings")] public string Tag = "CPC"; public CardInfo alternateSource; public void Setup() { ((Component)this).GetComponent<CardInfo>().sourceCard = alternateSource ?? ((Component)this).GetComponent<CardInfo>(); } public void Start() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_00a3: 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_00d4: Unknown result type (might be due to invalid IL or missing references) RectTransform[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren<RectTransform>(); GameObject val = new GameObject("ModIDText"); RectTransform val2 = ((IEnumerable<RectTransform>)componentsInChildren).FirstOrDefault((Func<RectTransform, bool>)((RectTransform obj) => ((Object)((Component)obj).gameObject).name == "EdgePart (2)")); if ((Object)(object)val2 != (Object)null) { GameObject gameObject = ((Component)val2).gameObject; val.gameObject.transform.SetParent(gameObject.transform); } TextMeshProUGUI val3 = val.gameObject.AddComponent<TextMeshProUGUI>(); ((TMP_Text)val3).text = Tag; ((TMP_Text)val3).autoSizeTextContainer = true; val.transform.localEulerAngles = new Vector3(0f, 0f, 135f); val.transform.localScale = Vector3.one; val.transform.localPosition = new Vector3(-75f, -75f, 0f); ((TMP_Text)val3).alignment = (TextAlignmentOptions)1026; ((TMP_Text)val3).alpha = 0.1f; ((TMP_Text)val3).fontSize = 54f; if ((Object)(object)alternateSource != (Object)null) { ((Component)this).GetComponent<CardInfo>().sourceCard = alternateSource; } } } public class CPCCardInfoForExtraStats : MonoBehaviour { [Header("CPC Settings")] public float GunCritDamage2 = 0f; public float GunCritChance2 = 0f; public int GunCritBounces = 0; public float GunCritDamageOnBounce = 0f; public bool GunConsecutiveCrits = false; public float GunConsecutiveCritsDamage = 0f; public bool GunGuranteedCrits = false; public float GunCritSlow = 0f; public Color GunCritColor = Color.red; public Color GunDoubleCritColor = Color.cyan; public float GunCritBulletSpeed = 0f; public float GunCritSimulationSpeed = 0f; public bool GunUnblockableCrits = false; public float GunCritHeal = 0f; public float GunCritBlockCDReduction = 0f; public bool GunBlockingCrits = false; } } namespace CPCCore { public static class Config { public const bool isDebugBuild = false; } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Poppycars.CPCCore.Id", "ChaosPoppycarsCardsCore", "1.0.0")] [BepInProcess("Rounds.exe")] public class ChaosPoppycarsCardsCore : BaseUnityPlugin { public static class CPCCoreCardCategories { public static CardCategory PoppysChaosCategory = CustomCardCategories.instance.CardCategory("PoppysChaosCards"); } [CompilerGenerated] private sealed class <>c__DisplayClass16_0 { public Player player; internal bool <ExtraPicks>b__0(int i) { return PlayerManager.instance.players[i].playerID == player.playerID; } } [CompilerGenerated] private sealed class <ExtraPicks>d__16 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ChaosPoppycarsCardsCore <>4__this; private Player[] <>s__1; private int <>s__2; private <>c__DisplayClass16_0 <>8__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ExtraPicks>d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__1 = null; <>8__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Expected O, but got Unknown //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>s__1 = PlayerManager.instance.players.ToArray(); <>s__2 = 0; goto IL_01ed; case 1: <>1__state = -1; CardChoiceVisuals.instance.Show((from i in Enumerable.Range(0, PlayerManager.instance.players.Count) where PlayerManager.instance.players[i].playerID == <>8__3.player.playerID select i).First(), true); <>2__current = CardChoice.instance.DoPick(1, <>8__3.player.playerID, (PickerType)1); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = (object)new WaitForSecondsRealtime(0.1f); <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = GameModeManager.TriggerHook("PlayerPickEnd"); <>1__state = 4; return true; case 4: <>1__state = -1; <>2__current = (object)new WaitForSecondsRealtime(0.1f); <>1__state = 5; return true; case 5: { <>1__state = -1; goto IL_01ae; } IL_01ed: if (<>s__2 < <>s__1.Length) { <>8__3 = new <>c__DisplayClass16_0(); <>8__3.player = <>s__1[<>s__2]; goto IL_01ae; } <>s__1 = null; return false; IL_01ae: if (<>8__3.player.data.stats.GetAdditionalData().shuffles > 0) { <>8__3.player.data.stats.GetAdditionalData().shuffles--; <>2__current = GameModeManager.TriggerHook("PlayerPickStart"); <>1__state = 1; return true; } <>8__3 = null; <>s__2++; goto IL_01ed; } } 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 <GameStart>d__17 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public ChaosPoppycarsCardsCore <>4__this; private List<Player>.Enumerator <>s__1; private Player <player>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GameStart>d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <player>5__2 = null; <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>s__1 = PlayerManager.instance.players.GetEnumerator(); try { while (<>s__1.MoveNext()) { <player>5__2 = <>s__1.Current; <player>5__2 = null; } } finally { ((IDisposable)<>s__1).Dispose(); } 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 <PointEnd>d__15 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public ChaosPoppycarsCardsCore <>4__this; private List<Player>.Enumerator <>s__1; private Player <player>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <PointEnd>d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <player>5__2 = null; <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>s__1 = PlayerManager.instance.players.GetEnumerator(); try { while (<>s__1.MoveNext()) { <player>5__2 = <>s__1.Current; <player>5__2.data.stats.GetAdditionalData().firstHit = true; <player>5__2.data.stats.GetAdditionalData().firstDamage = true; <player>5__2 = null; } } finally { ((IDisposable)<>s__1).Dispose(); } 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 const string ModId = "com.Poppycars.CPCCore.Id"; private const string ModName = "ChaosPoppycarsCardsCore"; public const string Version = "1.0.0"; public const string ModInitials = "CPCCore"; public static Harmony harmony; internal static List<BaseUnityPlugin> plugins; public static AssetBundle Bundle; internal static AssetBundle ArtAssets; public static ChaosPoppycarsCardsCore Instance { get; private set; } private void Awake() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_0062: 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_0077: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_00da: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Expected O, but got Unknown //IL_00f4: 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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0133: 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 //IL_013d: 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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Expected O, but got Unknown //IL_0189: 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_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Expected O, but got Unknown //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Expected O, but got Unknown Bundle = AssetUtils.LoadAssetBundleFromResources("cpccore", typeof(ChaosPoppycarsCardsCore).Assembly); CardThemeLib.instance.CreateOrGetType("Evergreen", new CardThemeColor { bgColor = new Color(0.09f, 0.23f, 0.11f), targetColor = new Color(0.28f, 0.8f, 0.32f) }); CardThemeLib.instance.CreateOrGetType("Whynot Block Red", new CardThemeColor { bgColor = new Color(0.3f, 0f, 0f), targetColor = new Color(0.28f, 0f, 0f) }); CardThemeLib.instance.CreateOrGetType("Minecraft Soil", new CardThemeColor { bgColor = new Color(0.3019608f, 8f / 51f, 0f), targetColor = new Color(0.1f, 0.85f, 0.1f) }); CardThemeLib.instance.CreateOrGetType("Critical Cerise", new CardThemeColor { bgColor = new Color(0.2175f, 0.0475f, 0.095f), targetColor = new Color(0.87f, 0.19f, 0.38f) }); CardThemeLib.instance.CreateOrGetType("Ancient Pumpkin Orange", new CardThemeColor { bgColor = Color32.op_Implicit(new Color32((byte)114, (byte)63, (byte)0, (byte)200)), targetColor = Color32.op_Implicit(new Color32((byte)171, (byte)95, (byte)0, (byte)200)) }); CardThemeLib.instance.CreateOrGetType("Geese Gray", new CardThemeColor { bgColor = new Color(0.24f, 0.21f, 0.19f), targetColor = new Color(0.24f, 0.21f, 0.19f) }); harmony = new Harmony("com.Poppycars.CPCCore.Id"); harmony.PatchAll(); } public static void RegisterCards(Assembly asemble, AssetBundle Bundle) { GameObject[] source = Bundle.LoadAllAssets<GameObject>(); List<Type> list = (from type in asemble.GetTypes() where type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(CustomCard)) select type).ToList(); foreach (Type type2 in list) { try { IEnumerable<GameObject> enumerable = source.Where((GameObject a) => a != null && (Object)(object)a.GetComponent<CustomCard>() != (Object)null && ((object)a.GetComponent<CustomCard>()).GetType() == type2); foreach (GameObject item in enumerable) { if (!DateTools.WeekOf(new DateTime(DateTime.UtcNow.Year, 4, 1)) && ((Object)item).name == "Tree") { continue; } try { type2.GetField("Card", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null); item.GetComponent<CustomCard>().BuildUnityCard((Action<CardInfo>)delegate(CardInfo cardInfo) { type2.GetField("Card", BindingFlags.Static | BindingFlags.NonPublic).SetValue(null, cardInfo); }); } catch { item.GetComponent<CustomCard>().BuildUnityCard((Action<CardInfo>)null); } if ((Object)(object)item.GetComponent<Curse>() != (Object)null) { CurseManager.instance.RegisterCurse(item.GetComponent<CardInfo>()); } item.GetComponent<CPCCardInfo>()?.Setup(); if (!item.GetComponent<CustomCard>().GetEnabled()) { Cards.instance.AddHiddenCard(item.GetComponent<CardInfo>()); } } } catch (Exception ex) { Debug.LogException(ex); } } } private void Start() { plugins = (List<BaseUnityPlugin>)typeof(Chainloader).GetField("_plugins", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null); Instance = this; GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)GameStart); if (plugins.Exists((BaseUnityPlugin plugin) => plugin.Info.Metadata.GUID == "com.willuwontu.rounds.tabinfo")) { TabinfoInterface.Setup(); } if (plugins.Exists((BaseUnityPlugin plugin) => plugin.Info.Metadata.GUID == "pykess.rounds.plugins.mapembiggener")) { CameraZoomHandlerPatchPatch.Patch(); } RegisterCards(typeof(ChaosPoppycarsCardsCore).Assembly, Bundle); GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)PointEnd); GameModeManager.AddHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => ExtraPicks())); ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)this, 10, (Action)delegate { }); ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)this, 60, (Action)delegate { CardManager.cards.Values.ToList().ForEach(delegate(Card card) { AddMod(card); }); }); } private void AddMod(Card card) { string text = "__Rarity-" + ((object)(Rarity)(ref card.cardInfo.rarity)).ToString(); CardCategory val = CustomCardCategories.instance.CardCategory(text); CardCategory[] categories = CollectionExtensions.AddToArray<CardCategory>(card.cardInfo.categories, val); card.cardInfo.categories = categories; } [IteratorStateMachine(typeof(<PointEnd>d__15))] private IEnumerator PointEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <PointEnd>d__15(0) { <>4__this = this, gm = gm }; } [IteratorStateMachine(typeof(<ExtraPicks>d__16))] private IEnumerator ExtraPicks() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ExtraPicks>d__16(0) { <>4__this = this }; } [IteratorStateMachine(typeof(<GameStart>d__17))] private IEnumerator GameStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <GameStart>d__17(0) { <>4__this = this, gm = gm }; } } public class Curse : MonoBehaviour { } } namespace CPCCore.Utilities { public class CPCDebug { public static void Log(object message) { bool flag = false; } } internal static class DateTools { public static bool DayOf(DateTime holiday) { double num = DateTime.UtcNow.ToOADate(); double num2 = holiday.AddHours(-12.0).ToOADate(); double num3 = holiday.AddHours(36.0).ToOADate(); return num > num2 && num < num3; } public static bool DayOf(DateTime[] holidays) { for (int i = 0; i < holidays.Length; i++) { if (DayOf(holidays[i])) { return true; } } return false; } public static bool WeekOf(DateTime holiday) { double num = DateTime.UtcNow.ToOADate(); double num2 = holiday.AddDays(-6.0).AddHours(-12.0).ToOADate(); double num3 = holiday.AddDays(6.0).AddHours(36.0).ToOADate(); return num > num2 && num < num3; } public static bool WeekOf(DateTime[] holidays) { for (int i = 0; i < holidays.Length; i++) { if (WeekOf(holidays[i])) { return true; } } return false; } public static void DateTest(DateTime testDate) { if (DayOf(testDate)) { Debug.Log((object)$"It's {testDate.Month}/{testDate.Day} somewhere"); } else if (WeekOf(testDate)) { Debug.Log((object)$"It's the week of {testDate.Month}/{testDate.Day} somewhere"); } else { Debug.Log((object)$"It's not {testDate.Month}/{testDate.Day} anywhere"); } } } internal class Miscs { public static bool debugFlag = true; public static void Log(object message) { if (debugFlag) { Debug.Log(message); } } public static void LogWarn(object message) { if (debugFlag) { Debug.LogWarning(message); } } public static void LogError(object message) { if (debugFlag) { Debug.LogError(message); } } public static List<string> StringSplit(string input, char splitAt) { List<string> list = new List<string>(); string text = ""; for (int i = 0; i < input.Length; i++) { if (input[i] != splitAt) { text += input[i]; continue; } list.Add(text); text = ""; } if (text != "") { list.Add(text); } return list; } public static int ValidateStringQuery(string targetString, string query) { int num = 15; int num2 = 0; int num3 = 0; bool flag = true; for (int i = 0; i < targetString.Length; i++) { if (targetString[i] == query[num2]) { num3 += num; num2++; } else { flag = false; num--; num2++; } if (num2 == query.Length) { if (flag) { num3 += num * 10; } break; } } return num3; } } public class CardUtils { public class PlayerCardData { public CardInfo cardInfo; public Player owner; public int index; public PlayerCardData(CardInfo cardInfo, Player owner, int index) { this.cardInfo = cardInfo; this.owner = owner; this.index = index; } } public static bool PlayerHasCard(Player player, string cardName) { List<PlayerCardData> playerCardsWithName = GetPlayerCardsWithName(player, cardName); return playerCardsWithName.Count > 0; } public static bool PlayerHasCardCategory(Player player, CardCategory cardCategory) { List<PlayerCardData> playerCardsWithCategory = GetPlayerCardsWithCategory(player, cardCategory); return playerCardsWithCategory.Count > 0; } public static List<PlayerCardData> GetPlayerCardsWithName(Player player, string targetCardName) { targetCardName = targetCardName.ToUpper(); List<PlayerCardData> list = new List<PlayerCardData>(); List<CardInfo> currentCards = player.data.currentCards; for (int i = 0; i < currentCards.Count; i++) { string text = currentCards[i].cardName.ToUpper(); if (text.Equals(targetCardName)) { list.Add(new PlayerCardData(currentCards[i], player, i)); } } return list; } public static List<PlayerCardData> GetPlayerCardsWithCategory(Player player, CardCategory targetCategory) { List<PlayerCardData> list = new List<PlayerCardData>(); List<CardInfo> currentCards = player.data.currentCards; for (int i = 0; i < currentCards.Count; i++) { bool flag = false; CardCategory[] categoriesFromCard = CustomCardCategories.instance.GetCategoriesFromCard(currentCards[i]); CardCategory[] array = categoriesFromCard; foreach (CardCategory val in array) { if ((Object)(object)targetCategory == (Object)(object)val) { flag = true; break; } } if (flag) { list.Add(new PlayerCardData(currentCards[i], player, i)); } } return list; } public static CardInfo GetCardInfo(string modInitial, string cardNameExact) { string value = "__" + modInitial + "__" + cardNameExact; List<CardInfo> list = CardManager.cards.Values.Select((Card c) => c.cardInfo).ToList(); CardInfo result = null; foreach (CardInfo item in list) { if (((Object)((Component)item).gameObject).name.Contains(value)) { result = item; break; } } return result; } public static CardInfo GetCardInfo(string query, bool searchVanillaOnly = false) { if (query.Contains("@")) { List<string> list = Miscs.StringSplit(query, '@'); if (list.Count == 2) { if (list[0] == "") { return GetCardInfo(list[1]); } if (list[0] == "Vanilla") { return GetCardInfo(list[1], searchVanillaOnly: true); } return GetCardInfo(list[0], list[1]); } Miscs.LogWarn(">> query splitting failed"); query = list[0]; } query = CardNameSanitize(query, removeWhitespaces: true); List<CardInfo> list2 = CardManager.cards.Values.Select((Card c) => c.cardInfo).ToList(); CardInfo result = null; int num = 0; foreach (CardInfo item in list2) { string text = CardNameSanitize(((Object)((Component)item).gameObject).name, removeWhitespaces: true); if (searchVanillaOnly && text.Contains("__")) { continue; } text = CardNameSanitize(item.cardName, removeWhitespaces: true); if (text.Equals(query)) { result = item; num = 9999; break; } if (text.Contains(query)) { int num2 = Miscs.ValidateStringQuery(text, query); if (num2 > num) { num = num2; result = item; } } } return result; } public static List<PlayerCardData> GetPlayerCardsWithCardInfo(Player player, CardInfo cardInfo) { string value = ((Object)((Component)cardInfo).gameObject).name.ToUpper(); List<PlayerCardData> list = new List<PlayerCardData>(); List<CardInfo> currentCards = player.data.currentCards; for (int i = 0; i < currentCards.Count; i++) { string text = ((Object)((Component)currentCards[i]).gameObject).name.ToUpper(); if (text.Equals(value)) { list.Add(new PlayerCardData(currentCards[i], player, i)); } } return list; } public static List<PlayerCardData> GetPlayerCardsWithStringList(Player player, List<string> checkList) { List<PlayerCardData> list = new List<PlayerCardData>(); List<CardInfo> currentCards = player.data.currentCards; foreach (string check in checkList) { CardInfo cardInfo = GetCardInfo(check); if (!((Object)(object)cardInfo == (Object)null)) { list = list.Concat(GetPlayerCardsWithCardInfo(player, cardInfo)).ToList(); } } return list; } public static string CardNameSanitize(string name, bool removeWhitespaces = false) { string text = name.ToLower(); if (removeWhitespaces) { text = text.Replace(" ", ""); } return text; } public static void MakeExclusive(string cardA, string cardB) { CardInfo cardInfo = GetCardInfo(cardA); CardInfo cardInfo2 = GetCardInfo(cardB); if ((Object)(object)cardInfo != (Object)null && (Object)(object)cardInfo2 != (Object)null) { CustomCardCategories.instance.MakeCardsExclusive(cardInfo, cardInfo2); Miscs.Log("[CPC] MakeExclusive: card [" + cardA + "] and card [" + cardB + "] made exclusive"); } else { if ((Object)(object)cardInfo == (Object)null) { Miscs.LogWarn("[CPC] MakeExclusive: card [" + cardA + "] not found"); } if ((Object)(object)cardInfo2 == (Object)null) { Miscs.LogWarn("[CPC] MakeExclusive: card [" + cardB + "] not found"); } } } } } namespace CPCCore.Patches { public class CameraZoomHandlerPatchPatch { public static void Patch() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown ChaosPoppycarsCardsCore.harmony.Patch((MethodBase)typeof(CameraZoomHandler_Patch_Update).GetMethod("Postfix", BindingFlags.Static | BindingFlags.NonPublic), (HarmonyMethod)null, new HarmonyMethod(typeof(CameraZoomHandlerPatchPatch).GetMethod("Postfix", BindingFlags.Static | BindingFlags.Public)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } public static void Postfix(object[] __args) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_007c: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) Camera[] array = (Camera[])__args[0]; if ((Object)(object)PlayerManager.instance != (Object)null && PlayerManager.instance.players.Any((Player player) => player.data.stats.GetAdditionalData().cameraLock && (player.data.view.IsMine || PhotonNetwork.OfflineMode))) { for (int i = 0; i < array.Length; i++) { Transform transform = ((Component)array[i]).transform; Quaternion rotation = ((Component)array[i]).transform.rotation; float x = ((Quaternion)(ref rotation)).eulerAngles.x; rotation = ((Component)array[i]).transform.rotation; transform.eulerAngles = new Vector3(x, ((Quaternion)(ref rotation)).eulerAngles.y, 180f); } } } } [HarmonyPatch(typeof(DeathEffect))] internal class DeathEffect_Patch { [HarmonyPostfix] [HarmonyPatch("PlayDeath")] private static void AdjustedRespawnTime(DeathEffect __instance, Color color, PlayerVelocity playerRig, Vector2 vel, int playerIDToRevive) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) if (playerIDToRevive == -1) { return; } Player player = ((CharacterData)ExtensionMethods.GetFieldValue((object)playerRig, "data")).player; if (player.data.stats.GetAdditionalData().useNewRespawnTime) { float newRespawnTime = player.data.stats.GetAdditionalData().newRespawnTime; ExtensionMethods.SetFieldValue((object)__instance, "respawnTime", (object)newRespawnTime); ParticleSystem[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<ParticleSystem>(); ParticleSystem[] array = componentsInChildren; foreach (ParticleSystem val in array) { val.playbackSpeed = 2.53f / newRespawnTime; MainModule main = val.main; ((MainModule)(ref main)).simulationSpeed = 2.53f / newRespawnTime; } ((Component)__instance).gameObject.GetComponent<RemoveAfterSeconds>().seconds = 2f * newRespawnTime; } } } [Serializable] [HarmonyPatch(typeof(GeneralInput), "Update")] [HarmonyPriority(800)] internal class GeneralInputUpdatePatch { private static void Postfix(GeneralInput __instance) { //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) if (((Component)__instance).GetComponent<Player>().data.stats.GetAdditionalData().forcedMoveEnabled || (((Component)__instance).GetComponent<Player>().data.stats.GetAdditionalData().whynackAd && !((Component)__instance).GetComponent<Player>().data.stats.GetAdditionalData().whynackHarmony)) { if (Mathf.Abs(__instance.direction.x) < 0.5f) { __instance.direction = new Vector3(((Component)__instance).GetComponent<Player>().data.stats.GetAdditionalData().forcedMove, __instance.direction.y); } else { ((Component)__instance).GetComponent<Player>().data.stats.GetAdditionalData().forcedMove = __instance.direction.x; } } } } [Serializable] [HarmonyPatch(typeof(PlayerVelocity), "AddForce", new Type[] { typeof(Vector2), typeof(ForceMode2D) })] internal class ForcePatch { private static void Prefix(PlayerVelocity __instance, ref Vector2 force, ForceMode2D forceMode) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (__instance.data.stats.GetAdditionalData().rotatedForce) { float y = force.y; float x = force.x; force = new Vector2(y, x); } } } [Serializable] [HarmonyPatch(typeof(PlayerVelocity), "FixedUpdate")] internal class ForcePatch2 { private static bool Prefix(PlayerVelocity __instance) { //IL_0048: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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_00fa: 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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) if (__instance.data.stats.GetAdditionalData().cursorFear != 0f) { if (__instance.data.isPlaying) { if (__instance.isKinematic) { __instance.velocity *= 0f; } if (__instance.simulated && !__instance.isKinematic) { __instance.velocity += Vector2.op_Implicit(__instance.data.aimDirection) * TimeHandler.fixedDeltaTime * TimeHandler.timeScale * 20f * (__instance.data.stats.GetAdditionalData().cursorFear * -1f); Transform transform = ((Component)__instance.data).gameObject.transform; transform.position += TimeHandler.fixedDeltaTime * TimeHandler.timeScale * Vector2.op_Implicit(__instance.velocity); ((Component)__instance.data).gameObject.transform.position = new Vector3(((Component)__instance.data).gameObject.transform.position.x, ((Component)__instance.data).gameObject.transform.position.y, 0f); } } return false; } return true; } } [Serializable] [HarmonyPatch(typeof(GunAmmo), "Shoot")] internal class GunUSEAMMOPatch { private static void Postfix(GunAmmo __instance, GameObject projectile) { if (!__instance.gun.player.data.stats.GetAdditionalData().useAmmo) { __instance.gun.isReloading = false; __instance.currentAmmo = __instance.maxAmmo; __instance.SetActiveBullets(false); } } } [Serializable] [HarmonyPatch(typeof(HealthHandler), "DoDamage")] [HarmonyPriority(300)] internal class HealtHandlerPatchDoDamage { private static bool Prefix(HealthHandler __instance, ref Vector2 damage, Vector2 position, Color blinkColor, GameObject damagingWeapon, Player damagingPlayer, bool healthRemoval, ref bool lethal, bool ignoreBlock) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) CharacterData val = (CharacterData)Traverse.Create((object)__instance).Field("data").GetValue(); Player player = val.player; if (!val.isPlaying) { return false; } if (val.dead) { return false; } if (__instance.isRespawning) { return false; } if ((Object)(object)damagingPlayer != (Object)null && damagingPlayer.data.stats.GetAdditionalData().firstDamage) { damagingPlayer.data.stats.GetAdditionalData().damageMult = damagingPlayer.data.stats.GetAdditionalData().damageMultMax; damagingPlayer.data.stats.GetAdditionalData().firstDamage = false; } if ((Object)(object)damagingPlayer != (Object)null && damagingPlayer.data.stats.GetAdditionalData().reducingDmg) { damage *= damagingPlayer.data.stats.GetAdditionalData().damageMult; if (damagingPlayer.data.stats.GetAdditionalData().damageMult > 0.05f) { damagingPlayer.data.stats.GetAdditionalData().damageMult -= damagingPlayer.data.stats.GetAdditionalData().reducingDmgAmt; } if (damagingPlayer.data.stats.GetAdditionalData().damageMult < 0.05f) { damagingPlayer.data.stats.GetAdditionalData().damageMult = 0.05f; } } if (player.data.stats.GetAdditionalData().firstHit) { player.data.stats.GetAdditionalData().firstHit = false; if (player.data.stats.GetAdditionalData().firstHitdmgReduction > 0f) { damage /= player.data.stats.GetAdditionalData().firstHitdmgReduction; } } return true; } } [Serializable] [HarmonyPatch(typeof(Block), "blocked")] internal class BlockPiercePatch { private static bool Prefix(Block __instance, GameObject projectile, Vector3 forward, Vector3 hitPos) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //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_0096: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) bool flag = false; ProjectileHit component = projectile.GetComponent<ProjectileHit>(); HealthHandler val = (HealthHandler)Traverse.Create((object)__instance).Field("health").GetValue(); if (projectile.GetComponent<ProjectileHit>().ownPlayer.data.stats.GetAdditionalData().blockPierce > 0f) { Vector2 val2 = Vector2.op_Implicit((component.bulletCanDealDeamage ? component.damage : 1f) * projectile.GetComponent<ProjectileHit>().ownPlayer.data.stats.GetAdditionalData().blockPierce * ((Vector3)(ref forward)).normalized); ((Damagable)val).TakeDamage(val2, Vector2.op_Implicit(hitPos), component.projectileColor, component.ownWeapon, component.ownPlayer, true, true); flag = true; } if (flag) { Object.Destroy((Object)(object)projectile); return false; } return true; } } [Serializable] [HarmonyPatch(typeof(ProjectileHit), "RPCA_DoHit")] internal class UpwardsKnockbackPatch { private static void Prefix(ProjectileHit __instance, Vector2 hitPoint, Vector2 hitNormal, Vector2 vel, int viewID, int colliderID, bool wasBlocked) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) HitInfo val = new HitInfo(); val.point = hitPoint; val.normal = hitNormal; val.collider = null; if (viewID != -1) { PhotonView photonView = PhotonNetwork.GetPhotonView(viewID); val.collider = ((Component)photonView).GetComponentInChildren<Collider2D>(); val.transform = ((Component)photonView).transform; } else if (colliderID != -1) { val.collider = ((Component)MapManager.instance.currentMap.Map).GetComponentsInChildren<Collider2D>()[colliderID]; val.transform = ((Component)val.collider).transform; } HealthHandler val2 = null; if (Object.op_Implicit((Object)(object)val.transform)) { val2 = ((Component)val.transform).GetComponent<HealthHandler>(); } PlayerVelocity val3 = null; if (Object.op_Implicit((Object)(object)val.transform)) { val3 = ((Component)val.transform).GetComponentInParent<PlayerVelocity>(); } if (Object.op_Implicit((Object)(object)val3)) { float num = 1f; float num2 = Mathf.Clamp(val3.mass / 100f * num, 0f, 1f) * num; if (Object.op_Implicit((Object)(object)val2) && __instance.hasControl && (Object)(object)__instance.spawnedAttack.spawner != (Object)null && __instance.spawnedAttack.spawner.data.stats.GetAdditionalData().upwardsKnockback != 0f) { val2.CallTakeForce(Vector2.up * num2 * __instance.spawnedAttack.spawner.data.stats.GetAdditionalData().upwardsKnockback * Mathf.Pow(__instance.damage / 55f, 2f) * 5000f, (ForceMode2D)1, true, false, 0f); } } if (Object.op_Implicit((Object)(object)val.transform)) { NetworkPhysicsObject component = ((Component)val.transform).GetComponent<NetworkPhysicsObject>(); if (Object.op_Implicit((Object)(object)component) && __instance.canPushBox && (Object)(object)__instance.spawnedAttack.spawner != (Object)null && __instance.spawnedAttack.spawner.data.stats.GetAdditionalData().upwardsKnockback != 0f) { component.BulletPush(Vector2.up * ((__instance.spawnedAttack.spawner.data.stats.GetAdditionalData().upwardsKnockback + 5f) * Mathf.Pow(__instance.damage / 55f, 2f)) * 5000f, Vector2.op_Implicit(val.transform.InverseTransformPoint(((Component)component).transform.position)), __instance.spawnedAttack.spawner.data); } } } } [Serializable] [HarmonyPatch(typeof(ProjectileHit), "Hit")] internal class ProjectileHitPatchHit { private static void Postfix(ProjectileHit __instance, ref HitInfo hit, ref Player ___ownPlayer, ref float ___damage, bool forceCall = false) { if (!((Object)(object)((Component)hit.collider).GetComponent<HealthHandler>() != (Object)null)) { return; } if ((Object)(object)___ownPlayer != (Object)null && ___ownPlayer.data.stats.GetAdditionalData().firstDamage) { ___ownPlayer.data.stats.GetAdditionalData().damageMult = ___ownPlayer.data.stats.GetAdditionalData().damageMultMax; ___ownPlayer.data.stats.GetAdditionalData().firstDamage = false; } if ((Object)(object)___ownPlayer != (Object)null && ___ownPlayer.data.stats.GetAdditionalData().reducingDmg) { ___damage *= ___ownPlayer.data.stats.GetAdditionalData().damageMult; if (___ownPlayer.data.stats.GetAdditionalData().damageMult > 0.05f) { ___ownPlayer.data.stats.GetAdditionalData().damageMult -= ___ownPlayer.data.stats.GetAdditionalData().reducingDmgAmt; } if (___ownPlayer.data.stats.GetAdditionalData().damageMult < 0.05f) { ___ownPlayer.data.stats.GetAdditionalData().damageMult = 0.05f; } } } } [Serializable] [HarmonyPatch(typeof(ProjectileHit), "RPCA_DoHit")] internal class ProjectileHitPatchRPCA_DoHit { private static void Postfix(ProjectileHit __instance, Vector2 hitPoint, Vector2 hitNormal, Vector2 vel, ref Player ___ownPlayer, ref float ___damage, int viewID = -1, int colliderID = -1, bool wasBlocked = false) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) HitInfo val = new HitInfo(); val.point = hitPoint; val.normal = hitNormal; val.collider = null; if (viewID != -1) { PhotonView photonView = PhotonNetwork.GetPhotonView(viewID); val.collider = ((Component)photonView).GetComponentInChildren<Collider2D>(); val.transform = ((Component)photonView).transform; } else if (colliderID != -1) { val.collider = ((Component)MapManager.instance.currentMap.Map).GetComponentsInChildren<Collider2D>()[colliderID]; val.transform = ((Component)val.collider).transform; } if (!((Object)(object)((Component)val.collider).GetComponent<HealthHandler>() == (Object)null) || !((Object)(object)___ownPlayer != (Object)null) || !((Object)(object)val.transform != (Object)null) || !((Object)(object)((Component)___ownPlayer).GetComponent<CooldownBlock>() != (Object)null) || !(((Component)___ownPlayer).GetComponent<CooldownBlock>().duration <= 0f)) { return; } Vector3 val2; if (___ownPlayer.data.stats.GetAdditionalData().blockMover && !___ownPlayer.data.stats.GetAdditionalData().blockPush) { if (___ownPlayer.data.view.IsMine && !PhotonNetwork.OfflineMode) { NetworkingManager.RPC(typeof(ProjectileHitPatchRPCA_DoHit), "BugFix", new object[6] { viewID, colliderID, hitPoint, hitNormal, true, ___ownPlayer.playerID }); } else if (PhotonNetwork.OfflineMode) { Smooth orAddComponent = ExtensionMethods.GetOrAddComponent<Smooth>(((Component)val.transform).gameObject, false); orAddComponent.currentPos = val.transform.position; Vector3 position = val.transform.position; val2 = ((Component)___ownPlayer).transform.position - val.transform.position; orAddComponent.targetPos = position + ((Vector3)(ref val2)).normalized * ___ownPlayer.data.stats.GetAdditionalData().blockMoveStrength * 3f; orAddComponent.targetPos *= Mathf.Log(___ownPlayer.data.weaponHandler.gun.damage * ___ownPlayer.data.weaponHandler.gun.bulletDamageMultiplier, ___ownPlayer.data.weaponHandler.gun.projectiles[0].objectToSpawn.GetComponent<ProjectileHit>().damage) + 1f; orAddComponent.speed = 2f; } ((Component)___ownPlayer).GetComponent<CooldownBlock>().duration = 3f; } else if (___ownPlayer.data.stats.GetAdditionalData().blockMover) { if (___ownPlayer.data.view.IsMine && !PhotonNetwork.OfflineMode) { NetworkingManager.RPC(typeof(ProjectileHitPatchRPCA_DoHit), "BugFix", new object[6] { viewID, colliderID, hitPoint, hitNormal, false, ___ownPlayer.playerID }); } else if (PhotonNetwork.OfflineMode) { Smooth orAddComponent2 = ExtensionMethods.GetOrAddComponent<Smooth>(((Component)val.transform).gameObject, false); orAddComponent2.currentPos = val.transform.position; Vector3 position2 = val.transform.position; val2 = val.transform.position - ((Component)___ownPlayer).transform.position; orAddComponent2.targetPos = position2 + ((Vector3)(ref val2)).normalized * ___ownPlayer.data.stats.GetAdditionalData().blockMoveStrength * 3f; orAddComponent2.targetPos *= Mathf.Log(___ownPlayer.data.weaponHandler.gun.damage * ___ownPlayer.data.weaponHandler.gun.bulletDamageMultiplier, ___ownPlayer.data.weaponHandler.gun.projectiles[0].objectToSpawn.GetComponent<ProjectileHit>().damage) + 1f; orAddComponent2.speed = 2f; } ((Component)___ownPlayer).GetComponent<CooldownBlock>().duration = 3f; } } [UnboundRPC] private static void BugFix(int viewID, int colliderID, Vector2 hitPoint, Vector2 hitNormal, bool pull, int playerID) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: 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_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) HitInfo val = new HitInfo(); val.point = hitPoint; val.normal = hitNormal; val.collider = null; Player playerWithID = PlayerManager.instance.GetPlayerWithID(playerID); if (viewID != -1) { PhotonView photonView = PhotonNetwork.GetPhotonView(viewID); val.collider = ((Component)photonView).GetComponentInChildren<Collider2D>(); val.transform = ((Component)photonView).transform; } else if (colliderID != -1) { val.collider = ((Component)MapManager.instance.currentMap.Map).GetComponentsInChildren<Collider2D>()[colliderID]; val.transform = ((Component)val.collider).transform; } Vector3 val2; if (pull) { Smooth orAddComponent = ExtensionMethods.GetOrAddComponent<Smooth>(((Component)val.transform).gameObject, false); orAddComponent.currentPos = val.transform.position; Vector3 position = val.transform.position; val2 = ((Component)playerWithID).transform.position - val.transform.position; orAddComponent.targetPos = position + ((Vector3)(ref val2)).normalized * playerWithID.data.stats.GetAdditionalData().blockMoveStrength * (Mathf.Log(playerWithID.data.weaponHandler.gun.damage * playerWithID.data.weaponHandler.gun.bulletDamageMultiplier, playerWithID.data.weaponHandler.gun.projectiles[0].objectToSpawn.GetComponent<ProjectileHit>().damage) + 1f); orAddComponent.speed = 2f; } else { Smooth orAddComponent2 = ExtensionMethods.GetOrAddComponent<Smooth>(((Component)val.transform).gameObject, false); orAddComponent2.currentPos = val.transform.position; Vector3 position2 = val.transform.position; val2 = val.transform.position - ((Component)playerWithID).transform.position; orAddComponent2.targetPos = position2 + ((Vector3)(ref val2)).normalized * playerWithID.data.stats.GetAdditionalData().blockMoveStrength * (Mathf.Log(playerWithID.data.weaponHandler.gun.damage * playerWithID.data.weaponHandler.gun.bulletDamageMultiplier, playerWithID.data.weaponHandler.gun.projectiles[0].objectToSpawn.GetComponent<ProjectileHit>().damage) + 1f); orAddComponent2.speed = 2f; } } } [Serializable] [HarmonyPatch(typeof(HealthHandler), "Revive")] internal class HealtHandlerPatchRevive { private static void Prefix(HealthHandler __instance, bool isFullRevive = true) { //IL_001c: 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) if (isFullRevive) { ((CharacterData)Traverse.Create((object)__instance).Field("data").GetValue()).stats.GetAdditionalData().remainingTotems = ((CharacterData)Traverse.Create((object)__instance).Field("data").GetValue()).stats.GetAdditionalData().totems; } } } [Serializable] [HarmonyPatch(typeof(HealthHandler), "RPCA_SendTakeDamage")] internal class HealtHandlerPatchRPCASendTakeDamage { internal static Player GetPlayerWithID(int playerID) { for (int i = 0; i < PlayerManager.instance.players.Count; i++) { if (PlayerManager.instance.players[i].playerID == playerID) { return PlayerManager.instance.players[i]; } } return null; } private static void SimGun(Player player, Vector2 damage) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) SimulatedGun[] array = (SimulatedGun[])(object)new SimulatedGun[1]; if ((Object)(object)array[0] == (Object)null) { array[0] = new GameObject("DamageGun").AddComponent<SimulatedGun>(); } SimulatedGun val = array[0]; Gun gun = player.data.weaponHandler.gun; val.CopyGunStatsExceptActions(gun); val.CopyAttackAction(gun); val.CopyShootProjectileAction(gun); ((Gun)val).objectsToSpawn = ((Gun)val).objectsToSpawn.Concat(StopRecursionMono.StopRecursionSpawn).ToArray(); ((Gun)val).bursts = 0; ((Gun)val).numberOfProjectiles = 1; ((Gun)val).damage = Mathf.Clamp(((Vector2)(ref damage)).magnitude / 55f, 0f, player.data.maxHealth / 55f); if (player.data.view.IsMine || PhotonNetwork.OfflineMode) { Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(player.data.input.aimDirection.x, player.data.input.aimDirection.y, 0f); Debug.Log((object)("X " + val2.x + " Y " + val2.y + " Damage " + ((Vector2)(ref damage)).magnitude)); val.SimulatedAttack(player.playerID, Vector2.op_Implicit(new Vector2(((Component)player).transform.position.x + 1.5f, ((Component)player).transform.position.y)), new Vector3(1f, 0f, 0f), 1f, 1f, (Transform)null, false); val.SimulatedAttack(player.playerID, Vector2.op_Implicit(new Vector2(((Component)player).transform.position.x - 1.5f, ((Component)player).transform.position.y)), new Vector3(-1f, 0f, 0f), 1f, 1f, (Transform)null, false); val.SimulatedAttack(player.playerID, Vector2.op_Implicit(new Vector2(((Component)player).transform.position.x + 1.5f, ((Component)player).transform.position.y + 0.5f)), new Vector3(0.5f, 1f, 0f), 1f, 1f, (Transform)null, false); val.SimulatedAttack(player.playerID, Vector2.op_Implicit(new Vector2(((Component)player).transform.position.x - 1.5f, ((Component)player).transform.position.y + 0.5f)), new Vector3(-0.5f, 1f, 0f), 1f, 1f, (Transform)null, false); } } private static void Prefix(HealthHandler __instance, ref Vector2 damage, Vector2 position, bool lethal, int playerID) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) CharacterData val = (CharacterData)Traverse.Create((object)__instance).Field("data").GetValue(); Player player = val.player; Player playerWithID = GetPlayerWithID(playerID); if (player.data.stats.GetAdditionalData().damagingBullet && ExtensionMethods.GetOrAddComponent<FleshFragmentsCD>(((Component)player).gameObject, false).duration <= 0f) { SimGun(player, damage); ExtensionMethods.GetOrAddComponent<FleshFragmentsCD>(((Component)player).gameObject, false).duration = 2f; } } } } namespace CPCCore.MonoBehaviours { public class CooldownBlock : MonoBehaviour { public float duration = 0f; private Player player; private PlayerActions playerActions; public void Awake() { player = ((Component)this).GetComponentInParent<Player>(); playerActions = player.data.playerActions; } public void Update() { //IL_00cb: 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 (playerActions != null && PlayerActionsExtension.ActionWasPressed(playerActions, "BlockMoveSwitch")) { player.data.stats.GetAdditionalData().blockPush = !player.data.stats.GetAdditionalData().blockPush; if (player.data.stats.GetAdditionalData().blockPush) { ColorEffect orAddComponent = ExtensionMethods.GetOrAddComponent<ColorEffect>(((Component)player).gameObject, false); orAddComponent.SetColor(Color.red); ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)ChaosPoppycarsCardsCore.Instance, 0.5f, (Action)delegate { Object.Destroy((Object)(object)ExtensionMethods.GetOrAddComponent<ColorEffect>(((Component)this).gameObject, false)); }); } else { ColorEffect orAddComponent2 = ExtensionMethods.GetOrAddComponent<ColorEffect>(((Component)player).gameObject, false); orAddComponent2.SetColor(Color.blue); ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)ChaosPoppycarsCardsCore.Instance, 0.5f, (Action)delegate { Object.Destroy((Object)(object)ExtensionMethods.GetOrAddComponent<ColorEffect>(((Component)this).gameObject, false)); }); } } if (!(duration <= 0f)) { duration -= TimeHandler.deltaTime; } } } public class FleshFragmentsCD : MonoBehaviour { public float duration = 0f; public void Update() { if (!(duration <= 0f)) { duration -= TimeHandler.deltaTime; } } } public class Smooth : MonoBehaviour { public Vector3 currentPos; public Vector3 targetPos; public float speed; private float sinTime; private void Start() { sinTime = 0f; } private void Update() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) if (currentPos != targetPos) { sinTime += TimeHandler.deltaTime * speed; sinTime = Mathf.Clamp(sinTime, 0f, (float)Math.PI); ((Component)this).transform.position = Vector3.Lerp(currentPos, targetPos, 0.5f * Mathf.Sin(sinTime - (float)Math.PI / 2f) + 0.5f); Object.Destroy((Object)(object)this, speed + 0.1f); } else { Object.Destroy((Object)(object)this); } } } public class StopRecursionMono : MonoBehaviour { public static GameObject _stopRecursionObj; public static GameObject StopRecursionObj { get { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown if ((Object)(object)_stopRecursionObj == (Object)null) { _stopRecursionObj = new GameObject("A_StopRecursion", new Type[1] { typeof(StopRecursion) }); Object.DontDestroyOnLoad((Object)(object)_stopRecursionObj); } return _stopRecursionObj; } } public static ObjectsToSpawn[] StopRecursionSpawn => (ObjectsToSpawn[])(object)new ObjectsToSpawn[1] { new ObjectsToSpawn { AddToProjectile = StopRecursionObj } }; } } namespace CPCCore.Extensions { [Serializable] public class CharacterStatModifiersAdditionalData { public float RainbowLeafHealth; public float HealthBouncesBounced; public bool useNewRespawnTime; public float newRespawnTime; public int shuffles; public int GeeseSwarms; public int StunningStares; public int NanoMachines; public int remainingTotems; public int totems; public int Redstone; public int Glowstone; public bool InvisPot; public bool healthCase; public bool blockCase; public bool everyOther; public bool firstHit; public float damageMult; public float damageMultMax; public bool firstDamage; public bool reducingDmg; public float reducingDmgAmt; public float firstHitdmgReduction; public bool damagingBullet; public int dashes; public bool blockMover; public bool blockPush; public float blockMoveStrength; public float forcedMove; public bool forcedMoveEnabled; public bool speedyHands; public bool triggerFinger; public bool acceleratedRejuvenation; public bool boostedBlock; public int maxWarps; public int shroomsAmt; public bool hasTrident; public bool whynackBlockForce; public bool whynackAd; public bool whynackHarmony; public bool whynackMeditating; public bool rotatedForce; public bool cameraLock; public bool whynackUpper; public float rage; public float blockPierce; public float upwardsKnockback; public float cursorFear; public bool useAmmo; public CharacterStatModifiersAdditionalData() { HealthBouncesBounced = 0f; useNewRespawnTime = false; newRespawnTime = 0f; shuffles = 0; GeeseSwarms = 0; StunningStares = 0; NanoMachines = 0; remainingTotems = 0; totems = 0; Redstone = 0; Glowstone = 0; InvisPot = false; healthCase = false; blockCase = false; everyOther = true; firstHit = true; firstHitdmgReduction = 1f; firstDamage = true; reducingDmg = false; damageMult = 1f; damageMultMax = 1f; reducingDmgAmt = 0f; damagingBullet = false; dashes = 0; blockMover = false; blockPush = false; blockMoveStrength = 0f; forcedMove = 0f; forcedMoveEnabled = false; speedyHands = false; triggerFinger = false; acceleratedRejuvenation = false; boostedBlock = false; maxWarps = 0; shroomsAmt = 0; hasTrident = false; whynackBlockForce = false; whynackAd = false; whynackHarmony = false; whynackMeditating = false; rotatedForce = false; cameraLock = false; whynackUpper = false; rage = 0f; blockPierce = 0f; upwardsKnockback = 0f; cursorFear = 0f; useAmmo = true; } } public static class CharacterStatModifiersExtension { public static readonly ConditionalWeakTable<CharacterStatModifiers, CharacterStatModifiersAdditionalData> data = new ConditionalWeakTable<CharacterStatModifiers, CharacterStatModifiersAdditionalData>(); public static CharacterStatModifiersAdditionalData GetAdditionalData(this CharacterStatModifiers statModifiers) { return data.GetOrCreateValue(statModifiers); } public static void AddData(this CharacterStatModifiers statModifiers, CharacterStatModifiersAdditionalData value) { try { data.Add(statModifiers, value); } catch (Exception) { } } } [HarmonyPatch(typeof(CharacterStatModifiers), "ResetStats")] internal class CharacterStatModifiersPatchResetStats { private static void Prefix(CharacterStatModifiers __instance) { __instance.GetAdditionalData().HealthBouncesBounced = 0f; __instance.GetAdditionalData().useNewRespawnTime = false; __instance.GetAdditionalData().newRespawnTime = 0f; __instance.GetAdditionalData().shuffles = 0; __instance.GetAdditionalData().GeeseSwarms = 0; __instance.GetAdditionalData().StunningStares = 0; __instance.GetAdditionalData().NanoMachines = 0; __instance.GetAdditionalData().remainingTotems = 0; __instance.GetAdditionalData().totems = 0; __instance.GetAdditionalData().Redstone = 0; __instance.GetAdditionalData().Glowstone = 0; __instance.GetAdditionalData().InvisPot = false; __instance.GetAdditionalData().healthCase = false; __instance.GetAdditionalData().blockCase = false; __instance.GetAdditionalData().everyOther = true; __instance.GetAdditionalData().firstHit = true; __instance.GetAdditionalData().firstHitdmgReduction = 1f; __instance.GetAdditionalData().firstDamage = true; __instance.GetAdditionalData().reducingDmg = false; __instance.GetAdditionalData().damageMult = 1f; __instance.GetAdditionalData().damageMultMax = 1f; __instance.GetAdditionalData().reducingDmgAmt = 0f; __instance.GetAdditionalData().damagingBullet = false; __instance.GetAdditionalData().dashes = 0; __instance.GetAdditionalData().blockMover = false; __instance.GetAdditionalData().blockPush = false; __instance.GetAdditionalData().blockMoveStrength = 0f; __instance.GetAdditionalData().forcedMove = 0f; __instance.GetAdditionalData().forcedMoveEnabled = false; __instance.GetAdditionalData().speedyHands = false; __instance.GetAdditionalData().triggerFinger = false; __instance.GetAdditionalData().acceleratedRejuvenation = false; __instance.GetAdditionalData().boostedBlock = false; __instance.GetAdditionalData().maxWarps = 0; __instance.GetAdditionalData().shroomsAmt = 0; __instance.GetAdditionalData().hasTrident = false; __instance.GetAdditionalData().whynackBlockForce = false; __instance.GetAdditionalData().whynackAd = false; __instance.GetAdditionalData().whynackHarmony = false; __instance.GetAdditionalData().whynackMeditating = false; __instance.GetAdditionalData().rotatedForce = false; __instance.GetAdditionalData().cameraLock = false; __instance.GetAdditionalData().whynackUpper = false; __instance.GetAdditionalData().rage = 0f; __instance.GetAdditionalData().blockPierce = 0f; __instance.GetAdditionalData().upwardsKnockback = 0f; __instance.GetAdditionalData().cursorFear = 0f; __instance.GetAdditionalData().useAmmo = true; } } [Serializable] public class GunAdditionalData { public float criticalHitChance1 = 0f; public float criticalHitDamage1 = 1f; public int criticalHitBounces = 0; public float criticalHitDamageOnBounce = 0f; public bool consecutiveCrits = false; public bool guranteedCrits = false; public float consecutiveCritsDamage = 0f; public float CritSlow = 0f; public Color CritColor = Color.red; public Color DoubleCritColor = Color.cyan; public float criticalBulletSpeed = 1f; public float criticalSimulationSpeed = 1f; public bool unblockableCrits = false; public float criticalHeal = 0f; public float criticalBlockCDReduction = 0f; public bool BlockingCrits = false; public GunAdditionalData() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) criticalHitChance1 = 0f; criticalHitDamage1 = 1f; criticalHitBounces = 0; criticalHitDamageOnBounce = 0f; consecutiveCrits = false; guranteedCrits = false; consecutiveCritsDamage = 0f; CritSlow = 0f; CritColor = Color.red; DoubleCritColor = Color.cyan; criticalBulletSpeed = 1f; criticalSimulationSpeed = 1f; unblockableCrits = false; criticalHeal = 0f; criticalBlockCDReduction = 0f; BlockingCrits = false; } } public static class GunExtension { public static readonly ConditionalWeakTable<Gun, GunAdditionalData> data = new ConditionalWeakTable<Gun, GunAdditionalData>(); public static GunAdditionalData GetAdditionalData(this Gun gun) { return data.GetOrCreateValue(gun); } public static void AddData(this Gun gun, GunAdditionalData value) { try { data.Add(gun, value); } catch (Exception) { } } } [HarmonyPatch(typeof(Gun), "ResetStats")] internal class GunPatchResetStats { private static void Prefix(Gun __instance) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) __instance.GetAdditionalData().criticalHitChance1 = 0f; __instance.GetAdditionalData().criticalHitDamage1 = 1f; __instance.GetAdditionalData().criticalHitBounces = 0; __instance.GetAdditionalData().criticalHitDamageOnBounce = 0f; __instance.GetAdditionalData().consecutiveCrits = false; __instance.GetAdditionalData().consecutiveCritsDamage = 0f; __instance.GetAdditionalData().guranteedCrits = false; __instance.GetAdditionalData().CritSlow = 0f; __instance.GetAdditionalData().CritColor = Color.red; __instance.GetAdditionalData().DoubleCritColor = Color.cyan; __instance.GetAdditionalData().criticalBulletSpeed = 1f; __instance.GetAdditionalData().criticalSimulationSpeed = 1f; __instance.GetAdditionalData().unblockableCrits = false; __instance.GetAdditionalData().criticalHeal = 0f; __instance.GetAdditionalData().criticalBlockCDReduction = 0f; __instance.GetAdditionalData().BlockingCrits = false; } } [HarmonyPatch(typeof(ApplyCardStats), "ApplyStats")] internal class ApplyCardStatsPatch { private static void Postfix(ApplyCardStats __instance, Player ___playerToUpgrade) { //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: 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_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) CPCCardInfoForExtraStats component = ((Component)__instance).GetComponent<CPCCardInfoForExtraStats>(); if ((Object)(object)component != (Object)null && (Object)(object)___playerToUpgrade.data.weaponHandler.gun != (Object)null) { ___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().criticalHitDamage1 += component.GunCritDamage2; ___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().criticalHitChance1 += component.GunCritChance2; ___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().criticalHitBounces += component.GunCritBounces; ___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().criticalHitDamageOnBounce += component.GunCritDamageOnBounce; if (!___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().consecutiveCrits) { ___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().consecutiveCrits = component.GunConsecutiveCrits; } ___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().consecutiveCritsDamage += component.GunConsecutiveCritsDamage; if (!___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().guranteedCrits) { ___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().guranteedCrits = component.GunGuranteedCrits; } ___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().CritSlow += component.GunCritSlow; if ((component.GunCritColor != Color.red) & (___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().CritColor != Color.clear)) { ___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().CritColor = component.GunCritColor; } if ((component.GunDoubleCritColor != Color.cyan) & (___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().CritColor != Color.clear)) { ___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().DoubleCritColor = component.GunDoubleCritColor; } ___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().criticalBulletSpeed += component.GunCritBulletSpeed; ___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().criticalSimulationSpeed += component.GunCritSimulationSpeed; if (!___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().unblockableCrits) { ___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().unblockableCrits = component.GunUnblockableCrits; } ___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().criticalHeal += component.GunCritHeal; ___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().criticalBlockCDReduction += component.GunCritBlockCDReduction; if (!___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().BlockingCrits) { ___playerToUpgrade.data.weaponHandler.gun.GetAdditionalData().BlockingCrits = component.GunBlockingCrits; } } } } internal static class PlayerManagerExtensions { public static Player GetPlayerWithID(this PlayerManager instance, int playerID) { return ((IEnumerable<Player>)instance.players).FirstOrDefault((Func<Player, bool>)((Player p) => p.playerID == playerID)); } public static void ForEachPlayer(this PlayerManager instance, Action<Player> action) { foreach (Player player in instance.players) { action(player); } } } } namespace CPCCore.Cards { internal class PoppysChaos : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false; cardInfo.categories = (CardCategory[])(object)new CardCategory[2] { CustomCardCategories.instance.CardCategory("CardManipulation"), RerollManager.instance.NoFlip }; CPCDebug.Log("[CPCCore][Card] " + ((CustomCard)this).GetTitle() + " has been setup."); } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)ChaosPoppycarsCardsCore.Instance, 10, (Action)delegate { CardInfo val = Cards.instance.DrawRandomCardWithCondition(Cards.instance.HiddenCards.ToArray(), player, gun, gunAmmo, data, health, gravity, block, characterStats, (Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool>)ScarceCondition, 1000); Cards.instance.AddCardToPlayer(player, val, false, "", 2f, 2f, true); CardBarUtils.instance.ShowImmediate(player, val, (float?)3f); }); CPCDebug.Log(string.Format("[{0}][Card] {1} has been added to player {2}.", "CPCCore", ((CustomCard)this).GetTitle(), player.playerID)); } private bool ScarceCondition(CardInfo card, Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { return card.categories.Intersect((IEnumerable<CardCategory>)(object)new CardCategory[1] { ChaosPoppycarsCardsCore.CPCCoreCardCategories.PoppysChaosCategory }).Any(); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "Poppys Chaos"; } protected override string GetDescription() { return "The C H A O S, its now true"; } protected override GameObject GetCardArt() { return ChaosPoppycarsCardsCore.Bundle.LoadAsset<GameObject>("C_PoppysChaos"); } protected override Rarity GetRarity() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (Rarity)1; } protected override CardInfoStat[] GetStats() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_002c: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { stat = "", amount = "<#FFFF00>+???</color>", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { stat = "", amount = "<#FFFF00>-???</color>", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (CardThemeColorType)7; } public override string GetModName() { return "CPC"; } } internal class Tree : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { CPCDebug.Log("[CPCCore][Card] " + ((CustomCard)this).GetTitle() + " has been setup."); } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { Utils.ForceCrash((ForcedCrashCategory)2); CPCDebug.Log(string.Format("[{0}][Card] {1} has been added to player {2}.", "CPCCore", ((CustomCard)this).GetTitle(), player.playerID)); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "The Sacred Rubber Sappling"; } protected override string GetDescription() { return "The progenator of the sacred tree. Plant at your own risk"; } protected override GameObject GetCardArt() { return ChaosPoppycarsCardsCore.Bundle.LoadAsset<GameObject>("C_Tree"); } protected override Rarity GetRarity() { //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_000e: Unknown result type (might be due to invalid IL or missing references) return RarityUtils.GetRarity("Trinket"); } protected override CardInfoStat[] GetStats() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_002c: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { stat = "", amount = "+Tree", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (CardThemeColorType)7; } public override string GetModName() { return "CPC"; } } internal class AmmolessOutcomePC : CustomCard { public override bool GetEnabled() { return false; } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { ChaosPoppycarsCardsCore.CPCCoreCardCategories.PoppysChaosCategory }; gun.reloadTimeAdd = 0.75f; gun.ammoReg = -0.5f; CPCDebug.Log("[CPCCore][Card] " + ((CustomCard)this).GetTitle() + " has been setup."); } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { gunAmmo.maxAmmo = 1; CPCDebug.Log(string.Format("[{0}][Card] {1} has been added to player {2}.", "CPCCore", ((CustomCard)this).GetTitle(), player.playerID)); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "1 Ammo"; } protected override string GetDescription() { return "You get set to 1 ammo"; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (Rarity)2; } protected override CardInfoStat[] GetStats() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_005f: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[3] { new CardInfoStat { positive = false, stat = "Ammo", amount = "1", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Ammo Regen", amount = "-50%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Reload Time", amount = "+0.75s", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (CardThemeColorType)7; } public override string GetModName() { return "CPC"; } } internal class BadDamageOutcomePC : CustomCard { public override bool GetEnabled() { return false; } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { ChaosPoppycarsCardsCore.CPCCoreCardCategories.PoppysChaosCategory }; gun.damage = 0.5f; CPCDebug.Log("[CPCCore][Card] " + ((CustomCard)this).GetTitle() + " has been setup."); } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { CPCDebug.Log(string.Format("[{0}][Card] {1} has been added to player {2}.", "CPCCore", ((CustomCard)this).GetTitle(), player.playerID)); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "Damageless"; } protected override string GetDescription() { return "You lose some damage"; } protected override GameObject GetCardArt()