using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using CardChoiceSpawnUniqueCardPatch.CustomCategories; using CardThemeLib; using CooldownUILib; using HarmonyLib; using Jotunn.Utils; using Microsoft.CodeAnalysis; using ModdingUtils.Extensions; using ModdingUtils.MonoBehaviours; using ModdingUtils.RoundsEffects; using ModdingUtils.Utils; using MrFuntikMod.Cards; using MrFuntikMod.Effects; using MrFuntikMod.Extensions; using MrFuntikMod.MonoBehaviors; using MrFuntikMod.MonoBehaviours; using MrFuntikMod.Patches; using Photon.Pun; using RarityLib.Utils; using Sonigon; using SoundImplementation; using UnboundLib; using UnboundLib.Cards; using UnboundLib.GameModes; using UnboundLib.Networking; using UnboundLib.Utils; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("bellusfennec-BFRM")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+def7396df6e6147e28c53670609c669ceb87da79")] [assembly: AssemblyProduct("bellusfennec-BFRM")] [assembly: AssemblyTitle("bellusfennec-BFRM")] [assembly: AssemblyVersion("1.0.0.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace MrFuntikMod { internal class Assets { private const string BUNDLE_IS = "isbundle"; private const string BUNDLE_IS_V2 = "isbundlev2"; private const string BUNDLE_DRON = "dron-asset-2"; private static AssetBundle _bundle; private static AssetBundle _bundle2; private static AssetBundle _bundleDron; private static bool _loadAttempted; private static readonly Dictionary _assetCache; private static readonly Dictionary _spriteCache; public static GameObject StepBackArt => SafeLoadAsset(_bundle, "isbundle", "C_StepBack"); public static GameObject BlackPillArt => SafeLoadAsset(_bundle, "isbundle", "C_BlackPill"); public static GameObject GymBossArt => SafeLoadAsset(_bundle, "isbundle", "C_GymBoss"); public static GameObject TakeAimArt => SafeLoadAsset(_bundle2, "isbundlev2", "C_TakeAim"); public static GameObject AllCardArt => SafeLoadAsset(_bundle2, "isbundlev2", "C_AllCard"); public static GameObject NothingArt => SafeLoadAsset(_bundle2, "isbundlev2", "C_Nothing"); public static GameObject SomethingArt => SafeLoadAsset(_bundle2, "isbundlev2", "C_Something"); public static GameObject ItBecomesAllArt => SafeLoadAsset(_bundle2, "isbundlev2", "C_ItBecomesAll"); public static GameObject FragileStrengthArt => SafeLoadAsset(_bundle2, "isbundlev2", "C_FragileStrength"); public static GameObject KamikazeArt => SafeLoadAsset(_bundleDron, "dron-asset-2", "C_Kamikaze"); public static GameObject SpeedDemonArt => SafeLoadAsset(_bundleDron, "dron-asset-2", "С_Speed_Demon"); public static GameObject QuickReloadArt => SafeLoadAsset(_bundleDron, "dron-asset-2", "C_QuickReload"); public static GameObject MinigunArt => SafeLoadAsset(_bundleDron, "dron-asset-2", "C_Minigun"); public static GameObject PhoenixArt => SafeLoadAsset(_bundleDron, "dron-asset-2", "C_Phoenix"); public static GameObject TankArt => SafeLoadAsset(_bundleDron, "dron-asset-2", "C_Tank"); public static GameObject SprayArt => SafeLoadAsset(_bundleDron, "dron-asset-2", "C_Spray"); public static GameObject FriendlyBounceArt => SafeLoadAsset(_bundleDron, "dron-asset-2", "C_FriendlyBounce"); public static GameObject JumperArt => SafeLoadAsset(_bundleDron, "dron-asset-2", "C_Jumper"); public static GameObject HealMeArt => SafeLoadAsset(_bundleDron, "dron-asset-2", "C_HealMe"); public static GameObject ThornShieldArt => SafeLoadAsset(_bundleDron, "dron-asset-2", "C_ThornShield"); public static GameObject SmallButToughArt => SafeLoadAsset(_bundleDron, "dron-asset-2", "C_SmallButTough"); public static GameObject BulletTeleporterArt => SafeLoadAsset(_bundleDron, "dron-asset-2", "C_BulletTeleporter"); public static GameObject ComeToMeArt => SafeLoadAsset(_bundleDron, "dron-asset-2", "C_ComeToMe"); public static GameObject AntiradarArt => SafeLoadAsset(_bundleDron, "dron-asset-2", "C_Antiradar"); public static GameObject RandomTeleportArt => SafeLoadAsset(_bundleDron, "dron-asset-2", "С_RandomTeleport"); public static GameObject DestroyerArt => SafeLoadAsset(_bundleDron, "dron-asset-2", "C_Destroyer"); public static Sprite GunAsset => SafeLoadSprite(_bundleDron, "dron-asset-2", "Minigun-Gun"); public static Sprite RedSquare => SafeLoadSprite(_bundleDron, "dron-asset-2", "RedSquare"); public static GameObject MyBulletPrefab => SafeLoadAsset(_bundleDron, "dron-asset-2", "MyBullet"); static Assets() { _loadAttempted = false; _assetCache = new Dictionary(); _spriteCache = new Dictionary(); } private static void LoadBundles() { if (_loadAttempted) { return; } _loadAttempted = true; IEnumerable allLoadedAssetBundles = AssetBundle.GetAllLoadedAssetBundles(); foreach (AssetBundle item in allLoadedAssetBundles) { if (((Object)item).name == "isbundle") { _bundle = item; MrFuntikMod.Log("[MFM][Assets] isbundle already loaded, reusing"); } if (((Object)item).name == "isbundlev2") { _bundle2 = item; MrFuntikMod.Log("[MFM][Assets] isbundlev2 already loaded, reusing"); } if (((Object)item).name == "dron-asset-2") { _bundleDron = item; MrFuntikMod.Log("[MFM][Assets] dron-asset-2 already loaded, reusing"); } } if ((Object)(object)_bundle == (Object)null) { try { _bundle = AssetUtils.LoadAssetBundleFromResources("isbundle", typeof(MrFuntikMod).Assembly); } catch (Exception ex) { MrFuntikMod.LogError("[MFM][Assets] FAILED to load isbundle: " + ex.Message); } } if ((Object)(object)_bundle2 == (Object)null) { try { _bundle2 = AssetUtils.LoadAssetBundleFromResources("isbundlev2", typeof(MrFuntikMod).Assembly); } catch (Exception ex2) { MrFuntikMod.LogError("[MFM][Assets] FAILED to load isbundlev2: " + ex2.Message); } } if (!((Object)(object)_bundleDron == (Object)null)) { return; } try { _bundleDron = AssetUtils.LoadAssetBundleFromResources("dron-asset-2", typeof(MrFuntikMod).Assembly); } catch (Exception ex3) { MrFuntikMod.LogError("[MFM][Assets] FAILED to load dron-asset-2: " + ex3.Message); } } private static GameObject SafeLoadAsset(AssetBundle bundle, string bundleName, string assetName) { LoadBundles(); string key = bundleName + ":" + assetName; if (_assetCache.TryGetValue(key, out GameObject value)) { if ((Object)(object)value != (Object)null) { return value; } _assetCache.Remove(key); } if ((Object)(object)bundle == (Object)null) { return null; } try { GameObject val = bundle.LoadAsset(assetName); if ((Object)(object)val == (Object)null) { MrFuntikMod.LogWarning("[MFM][Assets] Asset '" + assetName + "' not found in '" + bundleName + "'"); } else { _assetCache[key] = val; } return val; } catch (Exception ex) { MrFuntikMod.LogError("[MFM][Assets] Exception loading '" + assetName + "': " + ex.Message); return null; } } private static Sprite SafeLoadSprite(AssetBundle bundle, string bundleName, string assetName) { LoadBundles(); string key = bundleName + ":" + assetName; if (_spriteCache.TryGetValue(key, out Sprite value)) { if ((Object)(object)value != (Object)null) { return value; } _spriteCache.Remove(key); } if ((Object)(object)bundle == (Object)null) { return null; } try { Sprite val = bundle.LoadAsset(assetName); if ((Object)(object)val == (Object)null) { MrFuntikMod.LogWarning("[MFM][Assets] Sprite '" + assetName + "' not found in '" + bundleName + "'"); } else { _spriteCache[key] = val; } return val; } catch (Exception ex) { MrFuntikMod.LogError("[MFM][Assets] Exception loading sprite '" + assetName + "': " + ex.Message); return null; } } } [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.bellusfennec.rounds.mod", "BFRM", "1.28.1")] [BepInProcess("Rounds.exe")] public class MrFuntikMod : BaseUnityPlugin { [CompilerGenerated] private sealed class d__30 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public MrFuntikMod <>4__this; private List.Enumerator <>s__1; private Player 5__2; private GravitySurgeMono 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__30(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__1 = default(List.Enumerator); 5__2 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; ImmunityAntiRadarCard.ClearCache(); DeathDefyMono.ClearStaticData(); ExecutionerMono.ClearPendingExecutions(); BurnEffectManager.ClearAll(); NothingTimerManager.ClearAll(); OneCutManager.Reset(); OneCutManager.Reset(); <>s__1 = PlayerManager.instance.players.GetEnumerator(); try { while (<>s__1.MoveNext()) { 5__2 = <>s__1.Current; 5__3 = ((Component)5__2).GetComponent(); if ((Object)(object)5__3 != (Object)null) { 5__3.ResetState(); } if (!CharacterStatModifiersExtension.GetAdditionalData(5__2.data.stats).blacklistedCategories.Contains(ImmunityCards)) { CharacterStatModifiersExtension.GetAdditionalData(5__2.data.stats).blacklistedCategories.Add(ImmunityCards); } if (!CharacterStatModifiersExtension.GetAdditionalData(5__2.data.stats).blacklistedCategories.Contains(ImmunityMasterCategory)) { CharacterStatModifiersExtension.GetAdditionalData(5__2.data.stats).blacklistedCategories.Add(ImmunityMasterCategory); } if (!CharacterStatModifiersExtension.GetAdditionalData(5__2.data.stats).blacklistedCategories.Contains(ArcFieldCategory)) { CharacterStatModifiersExtension.GetAdditionalData(5__2.data.stats).blacklistedCategories.Add(ArcFieldCategory); } if (!CharacterStatModifiersExtension.GetAdditionalData(5__2.data.stats).blacklistedCategories.Contains(GravitySurgeCategory)) { CharacterStatModifiersExtension.GetAdditionalData(5__2.data.stats).blacklistedCategories.Add(GravitySurgeCategory); } if (!CharacterStatModifiersExtension.GetAdditionalData(5__2.data.stats).blacklistedCategories.Contains(AuraCards)) { CharacterStatModifiersExtension.GetAdditionalData(5__2.data.stats).blacklistedCategories.Add(AuraCards); } if (!CharacterStatModifiersExtension.GetAdditionalData(5__2.data.stats).blacklistedCategories.Contains(AuraMasterCategory)) { CharacterStatModifiersExtension.GetAdditionalData(5__2.data.stats).blacklistedCategories.Add(AuraMasterCategory); } if (!CharacterStatModifiersExtension.GetAdditionalData(5__2.data.stats).blacklistedCategories.Contains(RollbackCategory)) { CharacterStatModifiersExtension.GetAdditionalData(5__2.data.stats).blacklistedCategories.Add(RollbackCategory); } if (!CharacterStatModifiersExtension.GetAdditionalData(5__2.data.stats).blacklistedCategories.Contains(ScorchCategory)) { CharacterStatModifiersExtension.GetAdditionalData(5__2.data.stats).blacklistedCategories.Add(ScorchCategory); } if (!CharacterStatModifiersExtension.GetAdditionalData(5__2.data.stats).blacklistedCategories.Contains(PhoenixSurgeCategory)) { CharacterStatModifiersExtension.GetAdditionalData(5__2.data.stats).blacklistedCategories.Add(PhoenixSurgeCategory); } 5__3 = null; 5__2 = null; } } finally { ((IDisposable)<>s__1).Dispose(); } <>s__1 = default(List.Enumerator); 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 d__28 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public MrFuntikMod <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__28(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; NothingTimerManager.ClearAll(); <>4__this.DestroyAll(); 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.bellusfennec.rounds.mod"; private const string ModName = "BFRM"; public const string Version = "1.28.1"; public const string ModInitials = "BFRM"; public const bool DebugLogs = false; internal static ManualLogSource ModLogger; internal static CardCategory NonImmunityCards; internal static CardCategory ImmunityCards; internal static CardCategory ImmunityMasterCategory; internal static CardCategory AuraMasterCategory; internal static CardCategory ArcFieldCategory; internal static CardCategory GravitySurgeCategory; internal static CardCategory NonAuraCards; internal static CardCategory AuraCards; internal static CardCategory RollbackCategory; internal static CardCategory ScorchCategory; internal static CardCategory PhoenixSurgeCategory; public static List hiddenCards = new List(); private Harmony harmony; public static MrFuntikMod instance { get; private set; } public static void Log(string msg) { bool flag = false; } public static void LogWarning(string msg) { bool flag = false; } public static void LogError(string msg) { bool flag = false; } private void Awake() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown ModLogger = ((BaseUnityPlugin)this).Logger; RarityUtils.AddRarity("Hidden", 1f, new Color(0.85f, 0.5f, 0.35f), new Color(0.45f, 0.25f, 0.15f)); CardThemeLib.instance.CreateOrGetType("Hidden", new CardThemeColor { bgColor = new Color(0.15f, 0.1f, 0.08f), targetColor = new Color(0.85f, 0.5f, 0.35f) }); harmony = new Harmony("com.bellusfennec.rounds.mod"); harmony.PatchAll(); } private void Start() { Log("Starting mod..."); AntiSlowExternalModsPatch.ApplyPatches(harmony); NonImmunityCards = CustomCardCategories.instance.CardCategory("NonImmunityCards"); ImmunityCards = CustomCardCategories.instance.CardCategory("ImmunityCards"); ImmunityMasterCategory = CustomCardCategories.instance.CardCategory("ImmunityMasterCategory"); AuraMasterCategory = CustomCardCategories.instance.CardCategory("AuraMasterCategory"); ArcFieldCategory = CustomCardCategories.instance.CardCategory("ArcFieldCategory"); GravitySurgeCategory = CustomCardCategories.instance.CardCategory("GravitySurgeCategory"); NonAuraCards = CustomCardCategories.instance.CardCategory("NonAuraCards"); AuraCards = CustomCardCategories.instance.CardCategory("AuraCards"); RollbackCategory = CustomCardCategories.instance.CardCategory("RollbackCategory"); ScorchCategory = CustomCardCategories.instance.CardCategory("ScorchCategory"); PhoenixSurgeCategory = CustomCardCategories.instance.CardCategory("PhoenixSurgeCategory"); instance = this; DeathDefyHandler.RegisterHooks(); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { ArcFieldCard.cardInfoSelf = cardInfo; }); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { GravitySurgeCard.cardInfoSelf = cardInfo; }); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { BacktrackCard.cardInfoSelf = cardInfo; }); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard((Action)delegate(CardInfo cardInfo) { Cards.instance.AddHiddenCard(cardInfo); hiddenCards.Add(cardInfo); }); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); GameModeManager.AddHook("PlayerPickEnd", (Func)((IGameModeHandler gm) => ImmunizeCard.ExtraPicks())); GameModeManager.AddHook("PlayerPickEnd", (Func)((IGameModeHandler gm) => DominionCard.ExtraPicks())); GameModeManager.AddHook("PlayerPickEnd", (Func)((IGameModeHandler gm) => OneCutCard.ExtraPicks())); GameModeManager.AddHook("GameStart", (Func)GameStart); GameModeManager.AddHook("GameEnd", (Func)ResetEffects); GameModeManager.AddHook("GameStart", (Func)ResetEffects); ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)instance, 1f, (Action)delegate { foreach (Card value in CardManager.cards.Values) { if (!value.cardInfo.categories.Contains(ImmunityCards)) { value.cardInfo.categories = CollectionExtensions.AddToArray(value.cardInfo.categories, NonImmunityCards); } if (!value.cardInfo.categories.Contains(AuraCards)) { value.cardInfo.categories = CollectionExtensions.AddToArray(value.cardInfo.categories, NonAuraCards); } } }); } [IteratorStateMachine(typeof(d__28))] private IEnumerator ResetEffects(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__28(0) { <>4__this = this, gm = gm }; } private void DestroyAll() where T : Object { T[] array = Object.FindObjectsOfType(); for (int num = array.Length - 1; num >= 0; num--) { Object.Destroy((Object)(object)array[num]); } } [IteratorStateMachine(typeof(d__30))] private IEnumerator GameStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__30(0) { <>4__this = this, gm = gm }; } } internal class CardCheck : MonoBehaviour { public static readonly string[] AllowedModInitials = new string[4] { "BFRM", "MFM", "IS", "DRON" }; public static int Amount(Player player, string cardName) { if ((Object)(object)player == (Object)null || (Object)(object)player.data == (Object)null || player.data.currentCards == null) { return 0; } List currentCards = player.data.currentCards; int num = 0; for (int num2 = currentCards.Count - 1; num2 >= 0; num2--) { if ((Object)(object)currentCards[num2] != (Object)null && currentCards[num2].cardName == cardName) { num++; } } return num; } public static int AmountFromAllowedMods(Player player, string cardName) { if ((Object)(object)player == (Object)null || (Object)(object)player.data == (Object)null || player.data.currentCards == null) { return 0; } List currentCards = player.data.currentCards; int num = 0; for (int num2 = currentCards.Count - 1; num2 >= 0; num2--) { CardInfo val = currentCards[num2]; if ((Object)(object)val != (Object)null && val.cardName == cardName && IsFromAllowedMod(val)) { num++; } } return num; } public static bool HasCardFromAllowedMods(Player player, string cardName) { return AmountFromAllowedMods(player, cardName) > 0; } public static bool IsFromAllowedMod(CardInfo card) { if ((Object)(object)card == (Object)null) { return false; } string cardModName = GetCardModName(card); if (string.IsNullOrEmpty(cardModName)) { return false; } for (int i = 0; i < AllowedModInitials.Length; i++) { if (cardModName == AllowedModInitials[i]) { return true; } } return false; } private static string GetCardModName(CardInfo card) { if ((Object)(object)card == (Object)null) { return null; } string cardName = card.cardName; if ((Object)(object)card.sourceCard != (Object)null) { cardName = card.sourceCard.cardName; } try { foreach (KeyValuePair card2 in CardManager.cards) { if ((Object)(object)card2.Value.cardInfo != (Object)null && card2.Value.cardInfo.cardName == cardName) { return card2.Value.category; } } } catch { } return null; } } public static class MapUtils { private static Scene mapScene; private static List mapObjects; public static void DestroyMapObject(GameObject gameObject) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)gameObject == (Object)null) { return; } try { if (UpdateMapObjectsList()) { string name = ((Scene)(ref mapScene)).name; Scene scene = gameObject.scene; if (name.Equals(((Scene)(ref scene)).name) && IsValidMapObject(gameObject)) { Object.Destroy((Object)(object)gameObject); } } } catch (Exception ex) { MrFuntikMod.LogError("[MrFuntikMod] DestroyMapObject error: " + ex.Message); } } private static bool UpdateMapObjectsList() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) try { if (mapObjects != null) { mapObjects.Clear(); } mapObjects = new List(); if (SceneManager.sceneCount < 2) { return false; } mapScene = SceneManager.GetSceneAt(1); if (!((Scene)(ref mapScene)).IsValid()) { return false; } GameObject[] rootGameObjects = ((Scene)(ref mapScene)).GetRootGameObjects(); if (rootGameObjects.Length == 0) { return false; } GameObject val = rootGameObjects[0]; if ((Object)(object)val == (Object)null) { return false; } Transform[] componentsInChildren = val.GetComponentsInChildren(); Transform[] array = componentsInChildren; foreach (Transform val2 in array) { if (IsValidMapObject(((Component)val2).gameObject)) { mapObjects.Add(((Component)val2).gameObject); } } return true; } catch (Exception ex) { MrFuntikMod.LogError("[MrFuntikMod] UpdateMapObjectsList error: " + ex.Message); return false; } } private static bool IsValidMapObject(GameObject obj) { if ((Object)(object)obj == (Object)null || !obj.activeInHierarchy) { return false; } Collider2D component = obj.GetComponent(); if ((Object)(object)component == (Object)null) { return false; } SpriteRenderer component2 = obj.GetComponent(); if ((Object)(object)component2 == (Object)null) { return false; } SFPolygon component3 = obj.GetComponent(); if ((Object)(object)component3 != (Object)null && !((Behaviour)component3).isActiveAndEnabled) { return false; } return true; } } public static class PhoenixSurgeHelper { public static bool HasKamikaze(Player player) { if ((Object)(object)player == (Object)null) { return false; } return (Object)(object)((Component)player).gameObject.GetComponent() != (Object)null; } public static void CheckUnlockPhoenixSurge(Player player) { if (!((Object)(object)player == (Object)null)) { List blacklistedCategories = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; if (HasKamikaze(player) && blacklistedCategories.Contains(MrFuntikMod.PhoenixSurgeCategory)) { blacklistedCategories.Remove(MrFuntikMod.PhoenixSurgeCategory); } } } public static void CheckLockPhoenixSurge(Player player) { if (!((Object)(object)player == (Object)null)) { List blacklistedCategories = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; if (!blacklistedCategories.Contains(MrFuntikMod.PhoenixSurgeCategory)) { blacklistedCategories.Add(MrFuntikMod.PhoenixSurgeCategory); } } } } public static class VengefulSparkConfig { public const float DAMAGE_REFLECT_PERCENT = 0.3f; public const float MIN_DAMAGE_THRESHOLD = 3f; public const float COOLDOWN = 0.5f; } public static class ArcFieldHelper { public static bool HasThunderCore(Player player) { if ((Object)(object)player == (Object)null) { return false; } MonoBehaviour[] components = ((Component)player).gameObject.GetComponents(); MonoBehaviour[] array = components; foreach (MonoBehaviour val in array) { if ((Object)(object)val != (Object)null && ((object)val).GetType().Name == "ElectricBulletEffect") { return true; } } return CardCheck.HasCardFromAllowedMods(player, "Thunder Core"); } public static bool HasPlanet(Player player) { if ((Object)(object)player == (Object)null) { return false; } MonoBehaviour[] components = ((Component)player).gameObject.GetComponents(); MonoBehaviour[] array = components; foreach (MonoBehaviour val in array) { if ((Object)(object)val != (Object)null && ((object)val).GetType().Name == "GravityFieldMono") { return true; } } return CardCheck.HasCardFromAllowedMods(player, "Planet"); } public static void CheckUnlockArcField(Player player) { if (!((Object)(object)player == (Object)null)) { List blacklistedCategories = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; bool flag = HasThunderCore(player); bool flag2 = HasPlanet(player); if (flag && flag2 && blacklistedCategories.Contains(MrFuntikMod.ArcFieldCategory)) { blacklistedCategories.Remove(MrFuntikMod.ArcFieldCategory); } } } public static void CheckLockArcField(Player player, string removingComponent) { if ((Object)(object)player == (Object)null) { return; } List blacklistedCategories = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; bool flag = HasThunderCore(player); bool flag2 = HasPlanet(player); if (removingComponent == "ThunderCore") { int num = CardCheck.AmountFromAllowedMods(player, "Thunder Core"); if (num <= 1) { flag = false; } } if (removingComponent == "Planet") { int num2 = CardCheck.AmountFromAllowedMods(player, "Planet"); if (num2 <= 1) { flag2 = false; } } if ((!flag || !flag2) && !blacklistedCategories.Contains(MrFuntikMod.ArcFieldCategory)) { blacklistedCategories.Add(MrFuntikMod.ArcFieldCategory); } } } public static class GravitySurgeHelper { public static bool HasPlanet(Player player) { if ((Object)(object)player == (Object)null) { return false; } MonoBehaviour[] components = ((Component)player).gameObject.GetComponents(); MonoBehaviour[] array = components; foreach (MonoBehaviour val in array) { if ((Object)(object)val != (Object)null && ((object)val).GetType().Name == "GravityFieldMono") { return true; } } return CardCheck.HasCardFromAllowedMods(player, "Planet"); } public static void CheckUnlockGravitySurge(Player player) { if (!((Object)(object)player == (Object)null)) { List blacklistedCategories = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; if (HasPlanet(player) && blacklistedCategories.Contains(MrFuntikMod.GravitySurgeCategory)) { blacklistedCategories.Remove(MrFuntikMod.GravitySurgeCategory); } } } public static void CheckLockGravitySurge(Player player) { if (!((Object)(object)player == (Object)null)) { List blacklistedCategories = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; if (!blacklistedCategories.Contains(MrFuntikMod.GravitySurgeCategory)) { blacklistedCategories.Add(MrFuntikMod.GravitySurgeCategory); } } } public static void CheckLockGravitySurgeOnStackRemove(Player player, bool isLastStack) { if ((Object)(object)player == (Object)null) { return; } int num = CardCheck.AmountFromAllowedMods(player, "Planet"); if (num <= 1) { List blacklistedCategories = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; if (!blacklistedCategories.Contains(MrFuntikMod.GravitySurgeCategory)) { blacklistedCategories.Add(MrFuntikMod.GravitySurgeCategory); } } } } public static class ImmunityHelper { private static CardCategory _immunityCategory; private static CardCategory ImmunityCategory { get { if ((Object)(object)_immunityCategory == (Object)null) { _immunityCategory = CustomCardCategories.instance.CardCategory("ImmunityCards"); } return _immunityCategory; } } public static int CountImmunityCards(Player player) { if ((Object)(object)player == (Object)null || (Object)(object)player.data == (Object)null || player.data.currentCards == null) { return 0; } int num = 0; foreach (CardInfo currentCard in player.data.currentCards) { if (!((Object)(object)currentCard == (Object)null) && currentCard.categories != null && currentCard.categories.Contains(ImmunityCategory) && CardCheck.IsFromAllowedMod(currentCard)) { num++; } } return num; } public static void CheckUnlockImmunityMaster(Player player) { if (!((Object)(object)player == (Object)null)) { List blacklistedCategories = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; int num = CountImmunityCards(player) + 1; if (num >= 2 && blacklistedCategories.Contains(MrFuntikMod.ImmunityMasterCategory)) { blacklistedCategories.Remove(MrFuntikMod.ImmunityMasterCategory); } } } public static void CheckLockImmunityMaster(Player player) { if (!((Object)(object)player == (Object)null)) { List blacklistedCategories = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; int num = CountImmunityCards(player) - 1; if (num < 2 && !blacklistedCategories.Contains(MrFuntikMod.ImmunityMasterCategory)) { blacklistedCategories.Add(MrFuntikMod.ImmunityMasterCategory); } } } } public static class RollbackHelper { public static bool HasBacktrack(Player player) { if ((Object)(object)player == (Object)null) { return false; } return (Object)(object)((Component)player).gameObject.GetComponent() != (Object)null; } public static void CheckUnlockRollback(Player player) { if (!((Object)(object)player == (Object)null)) { List blacklistedCategories = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; if (HasBacktrack(player) && blacklistedCategories.Contains(MrFuntikMod.RollbackCategory)) { blacklistedCategories.Remove(MrFuntikMod.RollbackCategory); } } } public static void CheckLockRollback(Player player) { if (!((Object)(object)player == (Object)null)) { List blacklistedCategories = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; BacktrackMono component = ((Component)player).gameObject.GetComponent(); bool flag = false; if (!blacklistedCategories.Contains(MrFuntikMod.RollbackCategory)) { blacklistedCategories.Add(MrFuntikMod.RollbackCategory); } } } public static void CheckLockRollbackOnStackRemove(Player player, bool isLastStack) { if (!((Object)(object)player == (Object)null) && isLastStack) { List blacklistedCategories = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; if (!blacklistedCategories.Contains(MrFuntikMod.RollbackCategory)) { blacklistedCategories.Add(MrFuntikMod.RollbackCategory); } } } } public static class ScorchHelper { public static bool HasBlazingTrail(Player player) { if ((Object)(object)player == (Object)null) { return false; } MonoBehaviour[] components = ((Component)player).gameObject.GetComponents(); MonoBehaviour[] array = components; foreach (MonoBehaviour val in array) { if ((Object)(object)val != (Object)null && ((object)val).GetType().Name == "BlazingTrailEffect") { return true; } } return CardCheck.HasCardFromAllowedMods(player, "Blazing Trail"); } public static void CheckUnlockScorch(Player player) { if (!((Object)(object)player == (Object)null)) { List blacklistedCategories = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; if (HasBlazingTrail(player) && blacklistedCategories.Contains(MrFuntikMod.ScorchCategory)) { blacklistedCategories.Remove(MrFuntikMod.ScorchCategory); } } } public static void CheckLockScorch(Player player) { if (!((Object)(object)player == (Object)null)) { List blacklistedCategories = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; if (!blacklistedCategories.Contains(MrFuntikMod.ScorchCategory)) { blacklistedCategories.Add(MrFuntikMod.ScorchCategory); } } } public static void CheckLockScorchOnStackRemove(Player player, bool isLastStack) { if ((Object)(object)player == (Object)null) { return; } int num = CardCheck.AmountFromAllowedMods(player, "Blazing Trail"); if (num <= 1) { List blacklistedCategories = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; if (!blacklistedCategories.Contains(MrFuntikMod.ScorchCategory)) { blacklistedCategories.Add(MrFuntikMod.ScorchCategory); } } } } } namespace MrFuntikMod.Extensions { [Serializable] public class BlockAdditionalData { public float discombobulateRange; public float discombobulateDuration; public float timeOfLastSuccessfulBlock; public BlockAdditionalData() { discombobulateRange = 0f; discombobulateDuration = 0f; timeOfLastSuccessfulBlock = -100f; } } public static class BlockExtension { public static readonly ConditionalWeakTable data = new ConditionalWeakTable(); public static BlockAdditionalData GetAdditionalData(this Block block) { return data.GetOrCreateValue(block); } public static void AddData(this Block block, BlockAdditionalData value) { try { data.Add(block, value); } catch (Exception) { } } } [Serializable] public class CardInfoAdditionalData { public bool isRandom; public bool isClassBlacklistCard; public CardInfoAdditionalData() { isRandom = false; isClassBlacklistCard = false; } } public static class CardInfoExtension { public static readonly ConditionalWeakTable data = new ConditionalWeakTable(); public static CardInfoAdditionalData GetAdditionalData(this CardInfo cardInfo) { return data.GetOrCreateValue(cardInfo); } public static void AddData(this CardInfo cardInfo, CardInfoAdditionalData value) { try { data.Add(cardInfo, value); } catch (Exception) { } } } [Serializable] public class CharacterStatModifiersAdditionalData { public float piercingDamage; public int shuffles; public int oneCutPending; public CharacterStatModifiersAdditionalData() { piercingDamage = 0f; shuffles = 0; oneCutPending = 0; } } public static class CharacterStatModifiersExtension { public static readonly ConditionalWeakTable data = new ConditionalWeakTable(); public static CharacterStatModifiersAdditionalData GetAdditionalData(this CharacterStatModifiers characterstats) { return data.GetOrCreateValue(characterstats); } public static void AddData(this CharacterStatModifiers characterstats, CharacterStatModifiersAdditionalData value) { try { data.Add(characterstats, value); } catch (Exception) { } } } [HarmonyPatch(typeof(CharacterStatModifiers), "ResetStats")] internal class CharacterStatModifiersPatchResetStats { private static void Prefix(CharacterStatModifiers __instance) { __instance.GetAdditionalData().piercingDamage = 0f; __instance.GetAdditionalData().shuffles = 0; __instance.GetAdditionalData().oneCutPending = 0; } } } namespace MrFuntikMod.RoundsEffects { public class FriendlyFireEffect : DealtDamageEffect { public float multiplier = 1f; public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer = null) { //IL_000e: 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) Player damagedPlayer2 = damagedPlayer; if (!selfDamage && (!((Object)(object)damagedPlayer2 != (Object)null) || damagedPlayer2.teamID != ((Component)this).gameObject.GetComponent().teamID)) { return; } if (damagedPlayer2.data.health - ((Vector2)(ref damage)).magnitude <= 0f) { damagedPlayer2.data.healthHandler.Heal(((Vector2)(ref damage)).magnitude * (1f - multiplier)); return; } ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)Unbound.Instance, 2, (Action)delegate { damagedPlayer2.data.healthHandler.Heal(((Vector2)(ref damage)).magnitude * (1f - multiplier)); }); } } } namespace MrFuntikMod.MonoBehaviours { public class RandomTeleportMono : MonoBehaviour { [CompilerGenerated] private sealed class d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public RandomTeleportMono <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ResetState(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Player player; private Block block; private CharacterData data; private const float TELEPORT_COOLDOWN = 4f; private float cooldownRemaining = 0f; private bool isReady = true; private readonly int maxAttempts = 30; private Action blockAction; private CooldownUI cooldownUI; public void Initialize(Player player, Block block) { //IL_0098: Unknown result type (might be due to invalid IL or missing references) this.player = player; this.block = block; data = player.data; blockAction = OnBlock; this.block.BlockAction = (Action)Delegate.Combine(this.block.BlockAction, blockAction); if (data.view.IsMine) { cooldownUI = CooldownUI.Create(((Component)this).transform, 1f); cooldownUI.SetIcon("T", (Color?)new Color(1f, 0.4f, 0.8f)); } GameModeManager.AddHook("PointStart", (Func)OnPointStart); if ((Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive)); } } private void OnRevive() { ResetState(); } [IteratorStateMachine(typeof(d__11))] private IEnumerator OnPointStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0) { <>4__this = this, gm = gm }; } private void ResetState() { cooldownRemaining = 0f; isReady = true; CooldownUI obj = cooldownUI; if (obj != null) { obj.Hide(); } } public void Cleanup() { if ((Object)(object)block != (Object)null && blockAction != null) { block.BlockAction = (Action)Delegate.Remove(block.BlockAction, blockAction); } GameModeManager.RemoveHook("PointStart", (Func)OnPointStart); if ((Object)(object)data != (Object)null && (Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive)); } if ((Object)(object)cooldownUI != (Object)null) { Object.Destroy((Object)(object)((Component)cooldownUI).gameObject); } } private void OnDestroy() { Cleanup(); } private void Update() { if ((Object)(object)player == (Object)null || (Object)(object)data == (Object)null) { return; } if (data.dead) { CooldownUI obj = cooldownUI; if (obj != null) { obj.Hide(); } return; } if (!isReady) { cooldownRemaining -= Time.deltaTime; if (cooldownRemaining <= 0f) { cooldownRemaining = 0f; isReady = true; } } if (data.view.IsMine) { UpdateUI(); } } private void UpdateUI() { if (!((Object)(object)cooldownUI == (Object)null)) { if (!isReady && cooldownRemaining > 0f) { cooldownUI.ShowCooldown(cooldownRemaining, 4f); } else { cooldownUI.Hide(); } } } private void OnBlock(BlockTriggerType trigger) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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) //IL_009c: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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) if ((int)trigger <= 0 && isReady && (player.data.view.IsMine || PhotonNetwork.OfflineMode)) { Vector2? val = FindSafeTeleportPoint(requireGround: true); if (!val.HasValue) { val = FindSafeTeleportPoint(requireGround: false); } if (!val.HasValue) { Vector2 val2 = Random.insideUnitCircle * 5f; val = Vector2.op_Implicit(((Component)player).transform.position) + val2; } isReady = false; cooldownRemaining = 4f; if (PhotonNetwork.OfflineMode) { RPCA_Teleport(player.playerID, val.Value.x, val.Value.y); return; } NetworkingManager.RPC(typeof(RandomTeleportMono), "RPCA_Teleport", new object[3] { player.playerID, val.Value.x, val.Value.y }); } } private Vector2? FindSafeTeleportPoint(bool requireGround) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) float num = Camera.main.orthographicSize * 0.85f; float num2 = num * Camera.main.aspect * 0.85f; Vector3 position = ((Component)Camera.main).transform.position; Vector2 val = default(Vector2); for (int i = 0; i < maxAttempts; i++) { ((Vector2)(ref val))..ctor(position.x + Random.Range(0f - num2, num2), position.y + Random.Range(0f - num, num)); if (IsPointSafe(val, requireGround)) { return val; } } return null; } private bool IsPointSafe(Vector2 point, bool requireGround) { //IL_0007: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) float num = 1.2f; Collider2D val = Physics2D.OverlapCircle(point, num, LayerMask.GetMask(new string[2] { "Default", "IgnorePlayer" })); if ((Object)(object)val != (Object)null) { return false; } if (requireGround) { RaycastHit2D val2 = Physics2D.Raycast(point, Vector2.down, 25f, LayerMask.GetMask(new string[1] { "Default" })); return (Object)(object)((RaycastHit2D)(ref val2)).collider != (Object)null; } return true; } private static Player GetPlayerWithID(int playerID) { foreach (Player player in PlayerManager.instance.players) { if (player.playerID == playerID) { return player; } } return null; } [UnboundRPC] public static void RPCA_Teleport(int playerID, float x, float y) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) Player playerWithID = GetPlayerWithID(playerID); if (!((Object)(object)playerWithID == (Object)null)) { Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(x, y); PlayerCollision component = ((Component)playerWithID).GetComponent(); if ((Object)(object)component != (Object)null) { component.IgnoreWallForFrames(2); } PlayerVelocity playerVel = playerWithID.data.playerVel; if ((Object)(object)playerVel != (Object)null) { ExtensionMethods.SetFieldValue((object)playerVel, "velocity", (object)Vector2.zero); } ((Component)playerWithID).transform.position = Vector2.op_Implicit(val); } } } public class FriendlyBulletsDealtDamageEffect : HitEffect { public float multiplier = 1f; public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer = null) { Player component = ((Component)this).GetComponent(); if ((Object)(object)component == (Object)null || (Object)(object)damagedPlayer == (Object)null || (!selfDamage && damagedPlayer.teamID != component.teamID)) { return; } float healAmount = ((Vector2)(ref damage)).magnitude * (1f - multiplier); if (damagedPlayer.data.health - ((Vector2)(ref damage)).magnitude <= 0f) { damagedPlayer.data.healthHandler.Heal(healAmount); return; } Player targetPlayer = damagedPlayer; ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)Unbound.Instance, 2, (Action)delegate { if ((Object)(object)targetPlayer != (Object)null && (Object)(object)targetPlayer.data != (Object)null && (Object)(object)targetPlayer.data.healthHandler != (Object)null) { targetPlayer.data.healthHandler.Heal(healAmount); } }); } } } namespace MrFuntikMod.MonoBehaviors { public class ComeToMeMono : MonoBehaviour { [CompilerGenerated] private sealed class d__20 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public int targetPlayerID; public ComeToMeMono <>4__this; private Player 5__1; private Vector3 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; if ((Object)(object)<>4__this.player == (Object)null || <>4__this.player.data.dead) { return false; } 5__1 = GetPlayerWithID(targetPlayerID); if ((Object)(object)5__1 == (Object)null || 5__1.data.dead) { return false; } <>2__current = (object)new WaitForSeconds(2f); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)<>4__this.player == (Object)null || <>4__this.player.data.dead) { return false; } 5__1 = GetPlayerWithID(targetPlayerID); if ((Object)(object)5__1 == (Object)null || 5__1.data.dead) { return false; } 5__2 = ((Component)<>4__this.player).transform.position; if (PhotonNetwork.OfflineMode) { RPCA_TeleportToOwner(targetPlayerID, 5__2.x, 5__2.y); } else { NetworkingManager.RPC(typeof(ComeToMeMono), "RPCA_TeleportToOwner", new object[3] { targetPlayerID, 5__2.x, 5__2.y }); } 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 d__12 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public ComeToMeMono <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ResetState(); 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 d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public ComeToMeMono <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ResetState(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Player player; private Block block; private CharacterData data; private Action blockAction; private const float TELEPORT_COOLDOWN = 4f; private const float TELEPORT_DELAY = 2f; private float cooldownRemaining = 0f; private bool isReady = true; private CooldownUI cooldownUI; public void Initialize(Player player, Block block) { //IL_008e: Unknown result type (might be due to invalid IL or missing references) this.player = player; this.block = block; data = player.data; blockAction = OnBlock; block.BlockAction = (Action)Delegate.Combine(block.BlockAction, blockAction); if (data.view.IsMine) { cooldownUI = CooldownUI.Create(((Component)this).transform, 1f); cooldownUI.SetIcon("C", (Color?)new Color(0.8f, 0.4f, 1f)); } GameModeManager.AddHook("PointStart", (Func)OnPointStart); GameModeManager.AddHook("BattleStart", (Func)OnBattleStart); if ((Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive)); } } private void OnRevive() { ResetState(); } [IteratorStateMachine(typeof(d__11))] private IEnumerator OnPointStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0) { <>4__this = this, gm = gm }; } [IteratorStateMachine(typeof(d__12))] private IEnumerator OnBattleStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0) { <>4__this = this, gm = gm }; } private void ResetState() { cooldownRemaining = 0f; isReady = true; CooldownUI obj = cooldownUI; if (obj != null) { obj.Hide(); } } public void Cleanup() { if ((Object)(object)block != (Object)null && blockAction != null) { block.BlockAction = (Action)Delegate.Remove(block.BlockAction, blockAction); } GameModeManager.RemoveHook("PointStart", (Func)OnPointStart); GameModeManager.RemoveHook("BattleStart", (Func)OnBattleStart); if ((Object)(object)data != (Object)null && (Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive)); } if ((Object)(object)cooldownUI != (Object)null) { Object.Destroy((Object)(object)((Component)cooldownUI).gameObject); } } private void OnDestroy() { Cleanup(); } private void Update() { if ((Object)(object)player == (Object)null || (Object)(object)data == (Object)null) { return; } if (data.dead) { CooldownUI obj = cooldownUI; if (obj != null) { obj.Hide(); } return; } if (!isReady) { cooldownRemaining -= Time.deltaTime; if (cooldownRemaining <= 0f) { cooldownRemaining = 0f; isReady = true; } } if (data.view.IsMine) { UpdateUI(); } } private void UpdateUI() { if (!((Object)(object)cooldownUI == (Object)null)) { if (!isReady && cooldownRemaining > 0f) { cooldownUI.ShowCooldown(cooldownRemaining, 4f); } else { cooldownUI.Hide(); } } } private void OnBlock(BlockTriggerType trigger) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 if ((int)trigger > 0 || !isReady || (!data.view.IsMine && !PhotonNetwork.OfflineMode)) { return; } Player val = FindClosestEnemy(); if (!((Object)(object)val == (Object)null) && !val.data.dead) { isReady = false; cooldownRemaining = 4f; if (PhotonNetwork.OfflineMode) { RPCA_ShowWarningEffects(player.playerID, val.playerID); } else { NetworkingManager.RPC(typeof(ComeToMeMono), "RPCA_ShowWarningEffects", new object[2] { player.playerID, val.playerID }); } ((MonoBehaviour)this).StartCoroutine(DelayedTeleport(val.playerID)); } } [UnboundRPC] public static void RPCA_ShowWarningEffects(int ownerPlayerID, int targetPlayerID) { //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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_008f: 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_00ac: Unknown result type (might be due to invalid IL or missing references) Player playerWithID = GetPlayerWithID(ownerPlayerID); Player playerWithID2 = GetPlayerWithID(targetPlayerID); if (!((Object)(object)playerWithID == (Object)null) && !playerWithID.data.dead && !((Object)(object)playerWithID2 == (Object)null) && !playerWithID2.data.dead) { Transform transform = ((Component)playerWithID2).transform; Color white = Color.white; CircleWaveEffect.CreatePulsingEffect(transform, default(Vector3), 2f, 3, 0.5f, 3.5f, 0.5f, white); Transform transform2 = ((Component)playerWithID).transform; white = Color.white; CircleWaveEffect.CreatePulsingEffect(transform2, default(Vector3), 2f, 3, 0.5f, 0.2f, 3.5f, white); } } [IteratorStateMachine(typeof(d__20))] private IEnumerator DelayedTeleport(int targetPlayerID) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__20(0) { <>4__this = this, targetPlayerID = targetPlayerID }; } private Player FindClosestEnemy() { //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) Player result = null; float num = float.MaxValue; foreach (Player player in PlayerManager.instance.players) { if (!((Object)(object)player == (Object)null) && !((Object)(object)player == (Object)(object)this.player) && !player.data.dead && player.teamID != this.player.teamID) { float num2 = Vector2.Distance(Vector2.op_Implicit(((Component)this.player).transform.position), Vector2.op_Implicit(((Component)player).transform.position)); if (num2 < num) { num = num2; result = player; } } } return result; } private static Player GetPlayerWithID(int playerID) { foreach (Player player in PlayerManager.instance.players) { if (player.playerID == playerID) { return player; } } return null; } [UnboundRPC] public static void RPCA_TeleportToOwner(int targetPlayerID, float ownerX, float ownerY) { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_0071: Unknown result type (might be due to invalid IL or missing references) Player playerWithID = GetPlayerWithID(targetPlayerID); if (!((Object)(object)playerWithID == (Object)null) && !playerWithID.data.dead) { Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(ownerX, ownerY); PlayerCollision component = ((Component)playerWithID).GetComponent(); if ((Object)(object)component != (Object)null) { component.IgnoreWallForFrames(2); } PlayerVelocity playerVel = playerWithID.data.playerVel; if ((Object)(object)playerVel != (Object)null) { ExtensionMethods.SetFieldValue((object)playerVel, "velocity", (object)Vector2.zero); } ((Component)playerWithID).transform.position = Vector2.op_Implicit(val); CircleWaveEffect.CreateEffect(Vector2.op_Implicit(val), 0.5f, 0f, 3f, Color.red); } } } public class CircleWaveEffect : MonoBehaviour { private class PulseRunner : MonoBehaviour { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Transform owner; public Vector3 worldPos; public float totalDur; public int count; public float pulseDur; public float startRad; public float endRad; public Color color; public PulseRunner <>4__this; private float 5__1; private int 5__2; private GameObject 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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_0065: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = totalDur / (float)count; 5__2 = 0; break; case 1: <>1__state = -1; 5__2++; break; } if (5__2 < count) { if ((Object)(object)owner != (Object)null) { 5__3 = new GameObject("CircleWavePulse"); 5__3.transform.SetParent(owner, true); 5__3.transform.localPosition = Vector3.zero; <>4__this.SetupEffect(5__3, pulseDur, startRad, endRad, color); 5__3 = null; } else { CreateEffect(worldPos, pulseDur, startRad, endRad, color); } <>2__current = (object)new WaitForSeconds(5__1); <>1__state = 1; return true; } Object.Destroy((Object)(object)((Component)<>4__this).gameObject); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public void StartPulsing(Transform owner, Vector3 worldPos, float totalDur, int count, float pulseDur, float startRad, float endRad, Color color) { //IL_0004: 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) ((MonoBehaviour)this).StartCoroutine(RunPulses(owner, worldPos, totalDur, count, pulseDur, startRad, endRad, color)); } [IteratorStateMachine(typeof(d__1))] private IEnumerator RunPulses(Transform owner, Vector3 worldPos, float totalDur, int count, float pulseDur, float startRad, float endRad, Color color) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_0045: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { <>4__this = this, owner = owner, worldPos = worldPos, totalDur = totalDur, count = count, pulseDur = pulseDur, startRad = startRad, endRad = endRad, color = color }; } private void SetupEffect(GameObject go, float dur, float startRad, float endRad, Color color) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) LineRenderer val = go.AddComponent(); ((Renderer)val).material = new Material(Shader.Find("Sprites/Default")); val.startColor = color; val.endColor = color; float startWidth = (val.endWidth = 0.1f); val.startWidth = startWidth; val.useWorldSpace = false; int num2 = 64; val.positionCount = num2 + 1; Vector3[] array = (Vector3[])(object)new Vector3[num2 + 1]; for (int i = 0; i <= num2; i++) { float num3 = (float)i / (float)num2 * MathF.PI * 2f; array[i] = new Vector3(Mathf.Cos(num3) * startRad, Mathf.Sin(num3) * startRad, 0f); } val.SetPositions(array); CircleWaveEffect circleWaveEffect = go.AddComponent(); circleWaveEffect.Setup(val, num2, dur, startRad, endRad, color); } } private LineRenderer lineRenderer; private int segments; private float elapsed = 0f; private float duration = 0.5f; private float startRadius = 0f; private float endRadius = 3f; private Color startColor = Color.white; public void Setup(LineRenderer lr, int segs, float dur = 0.5f, float startRad = 0f, float endRad = 3f, Color color = default(Color)) { //IL_0027: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) lineRenderer = lr; segments = segs; duration = dur; startRadius = startRad; endRadius = endRad; startColor = ((color == default(Color)) ? Color.white : color); } private void Update() { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) elapsed += Time.deltaTime; if (elapsed > duration) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } float num = startRadius + elapsed / duration * (endRadius - startRadius); Vector3[] array = (Vector3[])(object)new Vector3[segments + 1]; for (int i = 0; i <= segments; i++) { float num2 = (float)i / (float)segments * MathF.PI * 2f; float num3 = Mathf.Cos(num2) * num; float num4 = Mathf.Sin(num2) * num; array[i] = new Vector3(num3, num4, 0f); } lineRenderer.SetPositions(array); float num5 = 1f - elapsed / duration; Color endColor = default(Color); ((Color)(ref endColor))..ctor(startColor.r, startColor.g, startColor.b, num5); lineRenderer.startColor = endColor; lineRenderer.endColor = endColor; } public static GameObject CreateEffect(Vector3 position, float duration = 0.5f, float startRadius = 0f, float endRadius = 3f, Color color = default(Color)) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: 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_0035: Expected O, but got Unknown //IL_0036: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_0113: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("CircleWaveEffect"); val.transform.position = position; LineRenderer val2 = val.AddComponent(); ((Renderer)val2).material = new Material(Shader.Find("Sprites/Default")); Color color2 = (val2.endColor = (val2.startColor = ((color == default(Color)) ? Color.white : color))); val2.startWidth = 0.1f; val2.endWidth = 0.1f; val2.useWorldSpace = false; int num = 64; Vector3[] array = (Vector3[])(object)new Vector3[num + 1]; for (int i = 0; i <= num; i++) { float num2 = (float)i / (float)num * MathF.PI * 2f; float num3 = Mathf.Cos(num2) * startRadius; float num4 = Mathf.Sin(num2) * startRadius; array[i] = new Vector3(num3, num4, 0f); } val2.positionCount = num + 1; val2.SetPositions(array); CircleWaveEffect circleWaveEffect = val.AddComponent(); circleWaveEffect.Setup(val2, num, duration, startRadius, endRadius, color2); return val; } public static void CreatePulsingEffect(Transform owner = null, Vector3 position = default(Vector3), float totalDuration = 2f, int pulseCount = 3, float pulseDuration = 0.5f, float startRadius = 0.2f, float endRadius = 3.5f, Color color = default(Color)) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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) PulseRunner pulseRunner = new GameObject("CircleWavePulseRunner").AddComponent(); pulseRunner.StartPulsing(owner, position, totalDuration, pulseCount, pulseDuration, startRadius, endRadius, (color == default(Color)) ? Color.white : color); } } public class HealMeMono : MonoBehaviour { internal Player player; internal Gun gun; internal GunAmmo gunAmmo; internal Gravity gravity; internal HealthHandler healthHandler; internal CharacterData data; internal Block block; private readonly float updateDelay = 0.1f; private float startTime; public int numcheck; public bool active; private void Start() { data = ((Component)this).GetComponentInParent(); HealthHandler val = data.healthHandler; val.reviveAction = (Action)Delegate.Combine(val.reviveAction, new Action(ResetTimer)); } private void OnDestroy() { HealthHandler val = data.healthHandler; val.reviveAction = (Action)Delegate.Combine(val.reviveAction, new Action(ResetTimer)); } public void Destroy() { Object.Destroy((Object)(object)this); } public void Awake() { player = ((Component)this).gameObject.GetComponent(); gun = ((Component)((Component)player).GetComponent().holdable).GetComponent(); data = ((Component)player).GetComponent(); healthHandler = ((Component)player).GetComponent(); gravity = ((Component)player).GetComponent(); block = ((Component)player).GetComponent(); gunAmmo = ((Component)gun).GetComponentInChildren(); numcheck = 0; } private void Update() { if (!(Time.time >= startTime + updateDelay)) { return; } ResetTimer(); for (int i = 0; i <= player.data.currentCards.Count - 1; i++) { if (player.data.currentCards[i].cardName == "Heal me") { numcheck++; } } if (numcheck > 0) { ResetTimer(); if (player.data.health < player.data.maxHealth && !active) { active = true; ((Component)((Component)player).transform).gameObject.AddComponent(); } } } private void ResetTimer() { startTime = Time.time; numcheck = 0; } } public class HealMeRegenMono : ReversibleEffect { private readonly Color color = Color.blue; private ReversibleColorEffect colorEffect; private HealMeMono effect; private readonly float updateDelay = 0.1f; private float startTime; public override void OnOnEnable() { } public override void OnStart() { HealthHandler healthHandler = base.player.data.healthHandler; healthHandler.regeneration += 20f; effect = ((Component)base.player).GetComponent(); ResetTimer(); } public override void OnUpdate() { if (Time.time >= startTime + updateDelay) { ResetTimer(); if (base.player.data.health >= base.player.data.maxHealth) { ((ReversibleEffect)this).Destroy(); } if (((Component)this).GetComponent().data.dead || ((Component)this).GetComponent().data.health <= 0f || !((Component)((Component)this).GetComponent()).gameObject.activeInHierarchy) { ResetTimer(); ((ReversibleEffect)this).Destroy(); } } } public override void OnOnDisable() { } public override void OnOnDestroy() { effect.active = false; if (base.player.data.healthHandler.regeneration >= 20f) { HealthHandler healthHandler = base.player.data.healthHandler; healthHandler.regeneration -= 20f; } } private void ResetTimer() { startTime = Time.time; } } public class KamikazeMono : MonoBehaviour { private class KamikazeSpawner : MonoBehaviour { private void Start() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) ((Component)this).gameObject.transform.localScale = new Vector3(1f, 1f, 1f); ((Component)this).gameObject.AddComponent().seconds = 1f; LineEffect component = ((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent(); if ((Object)(object)component != (Object)null) { ExtensionMethods.SetFieldValue((object)component, "inited", (object)false); typeof(LineEffect).InvokeMember("Init", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, component, new object[0]); component.radius = 9f; ExtensionMethods.SetFieldValue((object)component, "startWidth", (object)7.6f); component.Play(); } } } private bool hasDied = false; private readonly float maxDistance = 18f; private readonly float updateDelay = 0.1f; private readonly float effectCooldown = 0f; public Block block; public Player player; public CharacterData data; public Gun gun; private Action basic; private static GameObject kamikazevisual; private float startTime; private float timeOfLastEffect; private bool canTrigger; private bool hasTriggered; private int numcheck; public static GameObject kamikazeVisual { get { //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)kamikazevisual != (Object)null) { return kamikazevisual; } IEnumerable first = ((ObservableCollection)typeof(CardManager).GetField("activeCards", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null)).ToList(); List second = (List)typeof(CardManager).GetField("inactiveCards", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null); CardInfo val = first.Concat(second).FirstOrDefault((Func)((CardInfo card) => card.cardName.ToLower() == "overpower")); if ((Object)(object)val == (Object)null) { MrFuntikMod.LogError("[Kamikaze] Could not find Overpower card for visual effect!"); return null; } CharacterStatModifiers component = ((Component)val).GetComponent(); object obj; if (component == null) { obj = null; } else { GameObject addObjectToPlayer = component.AddObjectToPlayer; obj = ((addObjectToPlayer != null) ? addObjectToPlayer.GetComponent() : null); } SpawnObjects val2 = (SpawnObjects)obj; if ((Object)(object)val2 == (Object)null || val2.objectToSpawn == null || val2.objectToSpawn.Length == 0) { MrFuntikMod.LogError("[Kamikaze] Could not get SpawnObjects from Overpower card!"); return null; } kamikazevisual = Object.Instantiate(val2.objectToSpawn[0], new Vector3(0f, 100000f, 0f), Quaternion.identity); ((Object)kamikazevisual).name = "E_Kamikaze"; Object.DontDestroyOnLoad((Object)(object)kamikazevisual); ParticleSystem[] componentsInChildren = kamikazevisual.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { MainModule main = componentsInChildren[i].main; ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0.5f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(15f); ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(2f); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(1f, 0.3f, 0f, 1f)); } LineEffect component2 = ((Component)kamikazevisual.transform.GetChild(1)).GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.colorOverTime.colorKeys = (GradientColorKey[])(object)new GradientColorKey[1] { new GradientColorKey(new Color(1f, 0.4f, 0f, 1f), 0.3f) }; component2.offsetMultiplier = 0f; component2.playOnAwake = true; } if (kamikazevisual.transform.childCount > 2) { Object.Destroy((Object)(object)((Component)kamikazevisual.transform.GetChild(2)).gameObject); } FollowPlayer component3 = kamikazevisual.GetComponent(); if ((Object)(object)component3 != (Object)null) { Object.Destroy((Object)(object)component3); } DelayEvent component4 = kamikazevisual.GetComponent(); if ((Object)(object)component4 != (Object)null) { Object.Destroy((Object)(object)component4); } Explosion component5 = kamikazevisual.GetComponent(); if ((Object)(object)component5 != (Object)null) { component5.hitPlayerAction = null; Object.DestroyImmediate((Object)(object)component5); } Explosion_Overpower component6 = kamikazevisual.GetComponent(); if ((Object)(object)component6 != (Object)null) { Object.DestroyImmediate((Object)(object)component6); } RemoveAfterSeconds component7 = kamikazevisual.GetComponent(); if ((Object)(object)component7 != (Object)null) { Object.Destroy((Object)(object)component7); } kamikazevisual.AddComponent(); return kamikazevisual; } } private void Start() { player = ((Component)this).GetComponent(); block = ((Component)this).GetComponent(); data = ((Component)this).GetComponent(); gun = ((Component)this).GetComponent(); ResetEffectTimer(); ResetTimer(); canTrigger = true; hasTriggered = false; basic = block.BlockAction; } public void OnDestroy() { if ((Object)(object)data != (Object)null && data.dead && !hasDied) { hasDied = true; OnPlayerDeath(); } if ((Object)(object)block != (Object)null) { block.BlockAction = basic; } } private void OnPlayerDeath() { TriggerKamikazeEffect(); } private void TriggerKamikazeEffect() { //IL_0026: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_0084: 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) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_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_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return; } Object.Instantiate(kamikazeVisual, ((Component)player).transform.position, Quaternion.identity); Vector2 val = Vector2.op_Implicit(((Component)player).transform.position); Player[] array = PlayerManager.instance.players.ToArray(); for (int i = 0; i < array.Length; i++) { if (array[i].teamID == player.teamID) { continue; } float num = Vector2.Distance(val, Vector2.op_Implicit(((Component)array[i]).transform.position)); bool canSee = PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)player).transform.position), array[i]).canSee; if (num < maxDistance && canSee) { HealthHandler component = ((Component)array[i]).GetComponent(); if ((Object)(object)component != (Object)null && canTrigger) { ((Damagable)component).TakeDamage(200f * Vector2.down, Vector2.op_Implicit(((Component)array[i]).transform.position), ((Component)player.data.weaponHandler).gameObject, player, true, false); Vector3 val2 = ((Component)array[i]).transform.position - Vector2.op_Implicit(val); component.TakeForce(Vector2.op_Implicit(((Vector3)(ref val2)).normalized * 12000f), (ForceMode2D)1, true, false, 0.8f); hasTriggered = true; } } } } public void Destroy() { Object.Destroy((Object)(object)this); } private void Update() { if (!(Time.time >= startTime + updateDelay)) { return; } numcheck = 0; for (int i = 0; i < player.data.currentCards.Count; i++) { if (player.data.currentCards[i].cardName == "Kamikaze") { numcheck++; } } if (numcheck > 0) { ResetTimer(); if (Time.time >= timeOfLastEffect + effectCooldown) { canTrigger = true; } else { canTrigger = false; } } else { Object.Destroy((Object)(object)this); } } private void ResetTimer() { startTime = Time.time; } private void ResetEffectTimer() { timeOfLastEffect = Time.time; } } public class VengefulSparkEffect : MonoBehaviour { [CompilerGenerated] private sealed class d__13 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Vector3 position; public Vector3 direction; public float damage; public int attackerPlayerID; public VengefulSparkEffect <>4__this; private Player 5__1; private PlayerManager 5__2; private Gun 5__3; private bool 5__4; private List.Enumerator <>s__5; private Player

5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; <>s__5 = default(List.Enumerator);

5__6 = null; <>1__state = -2; } private bool MoveNext() { //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = null; 5__2 = PlayerManager.instance; if ((Object)(object)5__2 != (Object)null && 5__2.players != null) { <>s__5 = 5__2.players.GetEnumerator(); try { while (<>s__5.MoveNext()) {

5__6 = <>s__5.Current; if ((Object)(object)

5__6 != (Object)null &&

5__6.playerID == attackerPlayerID) { 5__1 =

5__6; break; }

5__6 = null; } } finally { ((IDisposable)<>s__5).Dispose(); } <>s__5 = default(List.Enumerator); } if ((Object)(object)5__1 == (Object)null) { return false; } if ((Object)(object)5__1 == (Object)null) { return false; } 5__3 = 5__1.data?.weaponHandler?.gun; if ((Object)(object)5__3 == (Object)null) { return false; } 5__4 = <>4__this.SetupSparkGunFromAttacker(5__3); <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; if (!5__4 || (Object)(object)<>4__this.sparkGun == (Object)null || <>4__this.sparkGun.projectiles == null || <>4__this.sparkGun.projectiles.Length == 0) { return false; } <>4__this.ShootBullet(position, direction, damage); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Player player; private float lastShootTime = -999f; private bool hasCard = false; private GameObject sparkGunObject; private Gun sparkGun; private void Awake() { player = ((Component)this).GetComponent(); } private void OnDestroy() { CleanupSparkGun(); } public void Initialize() { hasCard = true; } private bool SetupSparkGunFromAttacker(Gun attackerGun) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown if ((Object)(object)attackerGun == (Object)null) { return false; } CleanupSparkGun(); try { Holding component = ((Component)player).GetComponent(); if ((Object)(object)component == (Object)null || (Object)(object)component.holdable == (Object)null) { return false; } Gun component2 = ((Component)component.holdable).GetComponent(); GameObject val = ((component2 != null) ? ((Component)component2).gameObject : null); if ((Object)(object)val == (Object)null) { return false; } sparkGunObject = Object.Instantiate(val, new Vector3(500f, 500f, -100f), Quaternion.identity); Object.DontDestroyOnLoad((Object)(object)sparkGunObject); foreach (Transform item in sparkGunObject.transform) { Transform val2 = item; Renderer[] componentsInChildren = ((Component)val2).GetComponentsInChildren(); Renderer[] array = componentsInChildren; foreach (Renderer val3 in array) { val3.enabled = false; } } sparkGun = sparkGunObject.GetComponent(); if ((Object)(object)sparkGun == (Object)null) { CleanupSparkGun(); return false; } CopyAllGunStats(attackerGun, sparkGun); sparkGun.player = player; sparkGun.attackID = player.playerID; sparkGun.numberOfProjectiles = 1; sparkGun.bursts = 0; sparkGun.timeBetweenBullets = 0f; sparkGun.spread = 0f; sparkGun.multiplySpread = 0f; sparkGun.evenSpread = 0f; sparkGun.recoil = 0f; sparkGun.bodyRecoil = 0f; sparkGun.shake = 0f; sparkGun.attackSpeed = 0.1f; sparkGun.attackSpeedMultiplier = 1f; sparkGun.dontAllowAutoFire = true; ((Weapon)sparkGun).sinceAttack = 10f; sparkGun.isProjectileGun = true; sparkGun.gravity = 0f; sparkGun.projectiles = attackerGun.projectiles; ObjectsToSpawn[] collection = (ObjectsToSpawn[])(((object)attackerGun.objectsToSpawn) ?? ((object)new ObjectsToSpawn[0])); List list = new List(collection); list.Add(VengefulSparkMarker.CreateObjectsToSpawn()); sparkGun.objectsToSpawn = list.ToArray(); sparkGun.ShootPojectileAction = null; return true; } catch (Exception ex) { MrFuntikMod.LogError("[VengefulSpark] Failed to setup spark gun: " + ex.Message); CleanupSparkGun(); return false; } } private void CleanupSparkGun() { if ((Object)(object)sparkGunObject != (Object)null) { Object.Destroy((Object)(object)sparkGunObject); sparkGunObject = null; sparkGun = null; } } public void OnDamageReceived(Vector2 damage, Player attacker, GameObject damagingWeapon) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_0053: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_0062: 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_006b: 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_0094: Unknown result type (might be due to invalid IL or missing references) if (CanShootSpark(damage, attacker, damagingWeapon)) { float num = ((Vector2)(ref damage)).magnitude * 0.3f; if (player.data.view.IsMine) { Vector3 position = ((Component)this).transform.position; Vector3 position2 = ((Component)attacker).transform.position; Vector3 val = position2 - position; Vector3 normalized = ((Vector3)(ref val)).normalized; player.data.view.RPC("RPC_FireSpark", (RpcTarget)0, new object[4] { position, normalized, num, attacker.playerID }); lastShootTime = Time.time; } } } private bool CanShootSpark(Vector2 damage, Player attacker, GameObject damagingWeapon) { if (!hasCard) { return false; } if ((Object)(object)player == (Object)null || (Object)(object)player.data == (Object)null) { return false; } if (!player.data.isPlaying || player.data.dead) { return false; } if (((Vector2)(ref damage)).magnitude < 3f) { return false; } if ((Object)(object)attacker == (Object)null || (Object)(object)attacker == (Object)(object)player) { return false; } if (Time.time - lastShootTime < 0.5f) { return false; } if ((Object)(object)damagingWeapon != (Object)null && VengefulSparkMarker.HasMarker(damagingWeapon)) { return false; } return true; } [PunRPC] public void RPC_FireSpark(Vector3 position, Vector3 direction, float damage, int attackerPlayerID) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) ((MonoBehaviour)this).StartCoroutine(FireSparkCoroutine(position, direction, damage, attackerPlayerID)); } [IteratorStateMachine(typeof(d__13))] private IEnumerator FireSparkCoroutine(Vector3 position, Vector3 direction, float damage, int attackerPlayerID) { //IL_000e: 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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0) { <>4__this = this, position = position, direction = direction, damage = damage, attackerPlayerID = attackerPlayerID }; } private void ShootBullet(Vector3 position, Vector3 direction, float damage) { //IL_00b9: 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_00cd: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)sparkGun == (Object)null || sparkGun.projectiles == null || sparkGun.projectiles.Length == 0) { return; } bool flag = false; try { flag = (bool)typeof(Gun).InvokeMember("CheckIsMine", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, sparkGun, new object[0]); } catch { flag = player.data.view.IsMine; } if (!flag) { return; } try { GameObject objectToSpawn = sparkGun.projectiles[0].objectToSpawn; if ((Object)(object)objectToSpawn == (Object)null) { return; } Quaternion val = Quaternion.LookRotation(direction); GameObject val2 = PhotonNetwork.Instantiate(((Object)objectToSpawn.gameObject).name, position, val, (byte)0, (object[])null); if ((Object)(object)val2 == (Object)null) { return; } float num = Random.Range(0f, 1f); int num2 = 1; float num3 = sparkGun.damage * 55f; float num4 = ((num3 > 0f) ? (damage / num3) : 0f); if (PhotonNetwork.OfflineMode) { sparkGun.BulletInit(val2, num2, num4, num, false); return; } PhotonView component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { player.data.view.RPC("RPCA_InitBullet", (RpcTarget)0, new object[4] { component.ViewID, num2, num4, num }); } } catch (Exception ex) { MrFuntikMod.LogError("[VengefulSpark] Failed to shoot bullet: " + ex.Message); } } [PunRPC] public void RPCA_InitBullet(int bulletViewID, int numProj, float damageMultiplier, float seed) { try { PhotonView val = PhotonView.Find(bulletViewID); if (!((Object)(object)val == (Object)null)) { GameObject gameObject = ((Component)val).gameObject; if (!((Object)(object)gameObject == (Object)null) && (Object)(object)sparkGun != (Object)null) { sparkGun.BulletInit(gameObject, numProj, damageMultiplier, seed, false); } } } catch (Exception ex) { MrFuntikMod.LogError("[VengefulSpark] Failed to init bullet: " + ex.Message); } } public void OnRoundStart() { lastShootTime = -999f; CleanupSparkGun(); } private static void CopyAllGunStats(Gun from, Gun to) { //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)from == (Object)null) && !((Object)(object)to == (Object)null)) { to.damage = from.damage; to.damageAfterDistanceMultiplier = from.damageAfterDistanceMultiplier; to.bulletDamageMultiplier = from.bulletDamageMultiplier; to.projectileSpeed = from.projectileSpeed; to.projectielSimulatonSpeed = from.projectielSimulatonSpeed; to.gravity = from.gravity; to.drag = from.drag; to.dragMinSpeed = from.dragMinSpeed; to.spread = from.spread; to.evenSpread = from.evenSpread; to.multiplySpread = from.multiplySpread; to.size = from.size; to.knockback = from.knockback; to.projectileSize = from.projectileSize; to.projectileColor = from.projectileColor; to.numberOfProjectiles = from.numberOfProjectiles; to.bursts = from.bursts; to.timeBetweenBullets = from.timeBetweenBullets; to.reflects = from.reflects; to.smartBounce = from.smartBounce; to.bulletPortal = from.bulletPortal; to.randomBounces = from.randomBounces; to.destroyBulletAfter = from.destroyBulletAfter; to.slow = from.slow; to.percentageDamage = from.percentageDamage; to.speedMOnBounce = from.speedMOnBounce; to.dmgMOnBounce = from.dmgMOnBounce; to.objectsToSpawn = from.objectsToSpawn; to.projectiles = from.projectiles; to.attackID = from.attackID; to.player = from.player; to.isProjectileGun = from.isProjectileGun; to.ignoreWalls = from.ignoreWalls; to.unblockable = from.unblockable; to.recoil = from.recoil; to.recoilMuiltiplier = from.recoilMuiltiplier; to.bodyRecoil = from.bodyRecoil; to.shake = from.shake; to.attackSpeed = from.attackSpeed; to.attackSpeedMultiplier = from.attackSpeedMultiplier; to.hitMovementMultiplier = from.hitMovementMultiplier; to.waveMovement = from.waveMovement; to.teleport = from.teleport; to.spawnSkelletonSquare = from.spawnSkelletonSquare; to.explodeNearEnemyRange = from.explodeNearEnemyRange; to.explodeNearEnemyDamage = from.explodeNearEnemyDamage; to.cos = from.cos; to.chargeSpeedTo = from.chargeSpeedTo; to.chargeSpreadTo = from.chargeSpreadTo; to.chargeEvenSpreadTo = from.chargeEvenSpreadTo; to.chargeNumberOfProjectilesTo = from.chargeNumberOfProjectilesTo; to.chargeRecoilTo = from.chargeRecoilTo; to.chargeDamageMultiplier = from.chargeDamageMultiplier; to.currentCharge = from.currentCharge; to.dontAllowAutoFire = from.dontAllowAutoFire; to.forceSpecificAttackSpeed = from.forceSpecificAttackSpeed; to.lockGunToDefault = from.lockGunToDefault; to.overheatMultiplier = from.overheatMultiplier; to.useCharge = from.useCharge; } } } public class VengefulSparkMarker : MonoBehaviour { private static GameObject _markerPrefab; public static ObjectsToSpawn CreateObjectsToSpawn() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown return new ObjectsToSpawn { AddToProjectile = GetMarkerPrefab() }; } public static GameObject GetMarkerPrefab() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown if ((Object)(object)_markerPrefab == (Object)null) { _markerPrefab = new GameObject("VengefulSpark_Marker"); _markerPrefab.AddComponent(); ((Object)_markerPrefab).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)_markerPrefab); } return _markerPrefab; } public static bool HasMarker(GameObject obj) { if ((Object)(object)obj == (Object)null) { return false; } if ((Object)(object)obj.GetComponent() != (Object)null) { return true; } if ((Object)(object)obj.GetComponentInChildren() != (Object)null) { return true; } if ((Object)(object)obj.GetComponentInParent() != (Object)null) { return true; } Transform root = obj.transform.root; if ((Object)(object)root != (Object)null && (Object)(object)((Component)root).GetComponentInChildren() != (Object)null) { return true; } return false; } } } namespace MrFuntikMod.Patches { [HarmonyPatch(typeof(ProjectileHit), "RPCA_DoHit")] public class AegisShieldPatch_RPCA_DoHit { public static bool Prefix(ProjectileHit __instance, Vector2 hitPoint, Vector2 hitNormal, Vector2 vel, int viewID, int colliderID, ref bool wasBlocked) { if (viewID == -1) { return true; } PhotonView photonView = PhotonNetwork.GetPhotonView(viewID); if ((Object)(object)photonView == (Object)null) { return true; } Player component = ((Component)photonView).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } if ((Object)(object)component.data == (Object)null || component.data.dead) { return true; } if ((Object)(object)component.data.healthHandler == (Object)null || component.data.healthHandler.isRespawning) { return true; } if (!AegisShieldMono.IsShieldActiveForPlayer(component)) { return true; } wasBlocked = true; return true; } } [HarmonyPatch(typeof(HealthHandler), "DoDamage")] public class AegisShieldPatch_DoDamage { public static bool Prefix(HealthHandler __instance, ref Vector2 damage, Vector2 position, Color blinkColor, GameObject damagingWeapon, Player damagingPlayer, bool healthRemoval, bool lethal, bool ignoreBlock) { if ((Object)(object)__instance == (Object)null) { return true; } Player component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } if ((Object)(object)component.data == (Object)null || component.data.dead) { return true; } if (__instance.isRespawning) { return true; } if (!AegisShieldMono.IsShieldActiveForPlayer(component)) { return true; } return false; } } [HarmonyPatch(typeof(HealthHandler), "CallTakeDamage")] public class AegisShieldPatch_CallTakeDamage { public static bool Prefix(HealthHandler __instance, Vector2 damage, Vector2 position, GameObject damagingWeapon, Player damagingPlayer, bool lethal) { //IL_000a: 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) if ((Object)(object)__instance == (Object)null || damage == Vector2.zero) { return true; } Player component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } if ((Object)(object)component.data == (Object)null || component.data.dead) { return true; } if (__instance.isRespawning) { return true; } if (!AegisShieldMono.IsShieldActiveForPlayer(component)) { return true; } return false; } } [HarmonyPatch(typeof(HealthHandler), "TakeDamage", new Type[] { typeof(Vector2), typeof(Vector2), typeof(Color), typeof(GameObject), typeof(Player), typeof(bool), typeof(bool) })] public class AegisShieldPatch_TakeDamage { public static bool Prefix(HealthHandler __instance, Vector2 damage, Vector2 position, Color dmgColor, GameObject damagingWeapon, Player damagingPlayer, bool lethal, bool ignoreBlock) { //IL_000a: 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) if ((Object)(object)__instance == (Object)null || damage == Vector2.zero) { return true; } Player component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } if ((Object)(object)component.data == (Object)null || component.data.dead) { return true; } if (__instance.isRespawning) { return true; } if (!AegisShieldMono.IsShieldActiveForPlayer(component)) { return true; } return false; } } [HarmonyPatch(typeof(HealthHandler), "RPCA_SendTakeDamage")] public class AegisShieldPatch_RPCA_SendTakeDamage { public static bool Prefix(HealthHandler __instance, ref Vector2 damage, Vector2 position, bool lethal, int playerID) { if ((Object)(object)__instance == (Object)null) { return true; } Player component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } if ((Object)(object)component.data == (Object)null || component.data.dead) { return true; } if (__instance.isRespawning) { return true; } if (!AegisShieldMono.IsShieldActiveForPlayer(component)) { return true; } return false; } } [HarmonyPatch(typeof(HealthHandler), "TakeForce")] public class AegisShieldPatch_TakeForce { public static bool Prefix(HealthHandler __instance, ref Vector2 force, ForceMode2D forceMode, bool forceIgnoreMass, bool ignoreBlock, float setFlying) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null || force == Vector2.zero) { return true; } Player component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } if ((Object)(object)component.data == (Object)null || component.data.dead) { return true; } if (__instance.isRespawning) { return true; } if (!AegisShieldMono.IsShieldActiveForPlayer(component)) { return true; } if (AntiKnockbackHelper.IsCalledFromOutOfBounds()) { return true; } return false; } } [HarmonyPatch(typeof(HealthHandler), "RPCA_SendTakeForce")] public class AegisShieldPatch_RPCA_SendTakeForce { public static bool Prefix(HealthHandler __instance, Vector2 force, int forceMode, bool forceIgnoreMass, bool ignoreBlock, float setFlying) { //IL_000a: 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) if ((Object)(object)__instance == (Object)null || force == Vector2.zero) { return true; } Player component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } if ((Object)(object)component.data == (Object)null || component.data.dead) { return true; } if (__instance.isRespawning) { return true; } if (!AegisShieldMono.IsShieldActiveForPlayer(component)) { return true; } if (AntiKnockbackHelper.IsCalledFromOutOfBounds()) { return true; } return false; } } [HarmonyPatch(typeof(HealthHandler), "Heal")] public class HealEffectPatch { [HarmonyPrefix] private static void Prefix(HealthHandler __instance, ref float healAmount) { WeakenedHealMono component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null && component.GetStacks() > 0) { float healMultiplier = component.GetHealMultiplier(); healAmount *= healMultiplier; } } } [HarmonyPatch(typeof(ProjectileHit), "RPCA_DoHit")] [HarmonyPriority(800)] public class DancerDodgePatch { public static bool Prefix(ProjectileHit __instance, Vector2 hitPoint, Vector2 hitNormal, Vector2 vel, int viewID, int colliderID, bool wasBlocked) { if (wasBlocked) { return true; } if (viewID == -1) { return true; } PhotonView photonView = PhotonNetwork.GetPhotonView(viewID); if ((Object)(object)photonView == (Object)null) { return true; } HealthHandler component = ((Component)photonView).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } if (component.isRespawning) { return true; } Player component2 = ((Component)component).GetComponent(); if ((Object)(object)component2 == (Object)null) { return true; } if ((Object)(object)component2.data == (Object)null || component2.data.dead) { return true; } Block component3 = ((Component)component).GetComponent(); if ((Object)(object)component3 != (Object)null && component3.IsBlocking()) { return true; } DancerMono component4 = ((Component)component2).GetComponent(); if ((Object)(object)component4 == (Object)null) { return true; } if (!__instance.view.IsMine) { return true; } if (component4.TryDodge()) { NetworkingManager.RPC(typeof(DancerDodgePatch), "RPC_ShowDodgeEffect", new object[1] { component2.playerID }); return false; } return true; } [UnboundRPC] public static void RPC_ShowDodgeEffect(int playerID) { Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player p) => p.playerID == playerID)); if (!((Object)(object)val == (Object)null)) { DancerMono component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { component.ShowMissText(); } } } } public class DeathDefyHandler { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; private List.Enumerator <>s__1; private Player 5__2; private CharacterData 5__3; private DeathDefyMono 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__1 = default(List.Enumerator); 5__2 = null; 5__3 = null; 5__4 = 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()) { 5__2 = <>s__1.Current; if ((Object)(object)5__2 == (Object)null) { continue; } 5__3 = ((Component)5__2).GetComponent(); if ((Object)(object)5__3 == (Object)null) { continue; } 5__4 = ((Component)5__2).GetComponent(); if (!((Object)(object)5__4 == (Object)null) && 5__3.view.IsMine) { if (5__4.TryRollReviveOnBattleStart()) { NetworkingManager.RPC(typeof(DeathDefyHandler), "RPC_AddRespawn", new object[1] { 5__2.playerID }); } 5__3 = null; 5__4 = null; 5__2 = null; } } } finally { ((IDisposable)<>s__1).Dispose(); } <>s__1 = default(List.Enumerator); 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 d__2 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; private List.Enumerator <>s__1; private Player 5__2; private DeathDefyMono 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__1 = default(List.Enumerator); 5__2 = null; 5__3 = 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()) { 5__2 = <>s__1.Current; if (!((Object)(object)5__2 == (Object)null)) { 5__3 = ((Component)5__2).GetComponent(); if (!((Object)(object)5__3 == (Object)null)) { 5__3.ClearTempRespawns(); 5__3 = null; 5__2 = null; } } } } finally { ((IDisposable)<>s__1).Dispose(); } <>s__1 = default(List.Enumerator); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static void RegisterHooks() { GameModeManager.AddHook("BattleStart", (Func)OnBattleStart); GameModeManager.AddHook("PointEnd", (Func)OnPointEnd); } [IteratorStateMachine(typeof(d__1))] private static IEnumerator OnBattleStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { gm = gm }; } [IteratorStateMachine(typeof(d__2))] private static IEnumerator OnPointEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0) { gm = gm }; } [UnboundRPC] public static void RPC_AddRespawn(int playerID) { Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player p) => p.playerID == playerID)); if (!((Object)(object)val == (Object)null)) { DeathDefyMono component = ((Component)val).GetComponent(); if (!((Object)(object)component == (Object)null)) { component.AddTempRespawn(); } } } [UnboundRPC] public static void RPC_ShowText(int playerID) { Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player p) => p.playerID == playerID)); if (!((Object)(object)val == (Object)null)) { DeathDefyMono component = ((Component)val).GetComponent(); if (!((Object)(object)component == (Object)null)) { component.ShowReviveText(); } } } } [HarmonyPatch(typeof(HealthHandler), "RPCA_Die_Phoenix")] public class DeathDefyPhoenixPatch { public static void Postfix(HealthHandler __instance) { Player component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return; } CharacterData component2 = ((Component)__instance).GetComponent(); if ((Object)(object)component2 == (Object)null) { return; } DeathDefyMono component3 = ((Component)component).GetComponent(); if (!((Object)(object)component3 == (Object)null) && component2.view.IsMine && ModRespawnTracker.WasOurRespawnConsumed(component)) { if (component3.HasDeathDefyRespawns()) { NetworkingManager.RPC(typeof(DeathDefyHandler), "RPC_ShowText", new object[1] { component.playerID }); } if (component3.TryProcessDeathDefyRespawn()) { NetworkingManager.RPC(typeof(DeathDefyHandler), "RPC_AddRespawn", new object[1] { component.playerID }); } } } } [HarmonyPatch(typeof(Gun), "BulletInit")] public class BulletInitPatch { private const float BASE_MAX_SPAWN_DISTANCE = 2f; private static void Postfix(Gun __instance, GameObject bullet) { //IL_0090: 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) if ((Object)(object)__instance.player == (Object)null || !__instance.player.data.view.IsMine) { return; } Gun gun = __instance.player.data.weaponHandler.gun; if ((Object)(object)__instance != (Object)(object)gun) { return; } if ((Object)(object)__instance.shootPosition != (Object)null) { float playerSizeMultiplier = GetPlayerSizeMultiplier(__instance.player); float num = 2f * playerSizeMultiplier; float num2 = Vector3.Distance(bullet.transform.position, __instance.shootPosition.position); if (num2 > num) { return; } } ExecutionerMono component = ((Component)__instance.player).GetComponent(); if (!((Object)(object)component == (Object)null) && component.TryExecute()) { PhotonView component2 = bullet.GetComponent(); if (!((Object)(object)component2 == (Object)null)) { int viewID = component2.ViewID; ApplyExecutionerEffect(viewID); NetworkingManager.RPC(typeof(BulletInitPatch), "RPC_SetExecutionerBullet", new object[1] { viewID }); } } } private static void ApplyExecutionerEffect(int bulletViewID) { PhotonView photonView = PhotonNetwork.GetPhotonView(bulletViewID); if (!((Object)(object)photonView == (Object)null)) { GameObject gameObject = ((Component)photonView).gameObject; ExecutionerBullet executionerBullet = gameObject.GetComponent(); if ((Object)(object)executionerBullet == (Object)null) { executionerBullet = gameObject.AddComponent(); } executionerBullet.isExecutionerShot = true; executionerBullet.ApplyBloodyVisuals(); } } [UnboundRPC] public static void RPC_SetExecutionerBullet(int bulletViewID) { ApplyExecutionerEffect(bulletViewID); } private static float GetPlayerSizeMultiplier(Player player) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null || (Object)(object)player.data == (Object)null) { return 1f; } float num = 1f; if ((Object)(object)player.data.stats != (Object)null) { num = player.data.stats.sizeMultiplier; } float num2 = Mathf.Max(((Component)player).transform.localScale.x, ((Component)player).transform.localScale.y); if (num2 > num) { num = num2; } return Mathf.Max(1f, num); } } [HarmonyPatch(typeof(ProjectileHit), "RPCA_DoHit")] [HarmonyPriority(0)] public class ExecutionerPatch { public static bool Prefix(ProjectileHit __instance, Vector2 hitPoint, Vector2 hitNormal, Vector2 vel, int viewID, int colliderID, ref bool wasBlocked) { //IL_00ec: 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) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0149: 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_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) if (wasBlocked || viewID == -1) { return true; } ExecutionerBullet component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null || !component.isExecutionerShot) { return true; } PhotonView photonView = PhotonNetwork.GetPhotonView(viewID); if ((Object)(object)photonView == (Object)null) { return true; } Player component2 = ((Component)photonView).GetComponent(); if ((Object)(object)component2 == (Object)null || component2.data.dead) { return true; } HealthHandler component3 = ((Component)component2).GetComponent(); if ((Object)(object)component3 == (Object)null || component3.isRespawning) { return true; } if ((Object)(object)__instance.ownPlayer != (Object)null && __instance.ownPlayer.data.view.IsMine) { Vector2 val = Vector2.op_Implicit(((Component)component2).transform.position - ((Component)__instance.ownPlayer).transform.position); Vector2 normalized = ((Vector2)(ref val)).normalized; if (component2.data.stats.remainingRespawns > 0) { component2.data.view.RPC("RPCA_Die_Phoenix", (RpcTarget)0, new object[1] { normalized }); } else { component2.data.view.RPC("RPCA_Die", (RpcTarget)0, new object[1] { normalized }); } NetworkingManager.RPC(typeof(ExecutionerPatch), "RPC_ShowExecuteEffect", new object[4] { __instance.ownPlayer.playerID, ((Component)component2).transform.position.x, ((Component)component2).transform.position.y, ((Component)component2).transform.position.z }); } return false; } [UnboundRPC] public static void RPC_ShowExecuteEffect(int attackerPlayerID, float posX, float posY, float posZ) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) ExecutionerMono.ShowExecuteTextStatic(attackerPlayerID, new Vector3(posX, posY, posZ)); } } [HarmonyPatch(typeof(HealthHandler), "RPCA_Die")] public class ExecutionerDeathPatch { public static void Postfix(HealthHandler __instance, Vector2 deathDirection) { Player component = ((Component)__instance).GetComponent(); if (!((Object)(object)component == (Object)null)) { ExecutionerMono.OnPlayerDied(component.playerID); } } } [HarmonyPatch(typeof(HealthHandler), "RPCA_Die_Phoenix")] public class ExecutionerDeathPhoenixPatch { public static void Postfix(HealthHandler __instance, Vector2 deathDirection) { Player component = ((Component)__instance).GetComponent(); if (!((Object)(object)component == (Object)null)) { ExecutionerMono.OnPlayerDied(component.playerID); } } } [HarmonyPatch(typeof(Block), "RPCA_DoBlock")] public class ExtendedGuardSyncPatch { private static int patchCallCount; public static void Prefix(Block __instance, bool firstBlock, bool dontSetCD, BlockTriggerType triggerType, Vector3 useBlockPos, bool onlyBlockEffects) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 patchCallCount++; if ((int)triggerType > 0 || !firstBlock) { return; } Player component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return; } ExtendedGuardMono component2 = ((Component)component).GetComponent(); if ((Object)(object)component2 == (Object)null) { return; } CharacterData component3 = ((Component)component).GetComponent(); if (!((Object)(object)component3 == (Object)null) && component3.view.IsMine) { float value = Random.value; float critChance = component2.GetCritChance(); if (value < critChance) { NetworkingManager.RPC(typeof(ExtendedGuardSyncPatch), "RPC_ActivateCritBlock", new object[1] { component.playerID }); } } } [UnboundRPC] public static void RPC_ActivateCritBlock(int playerID) { Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player p) => p.playerID == playerID)); if (!((Object)(object)val == (Object)null)) { ExtendedGuardMono component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { component.ActivateCritBlockFromRPC(); } } } } internal static class AntiRadarEffectHelper { private static float lastEffectTime; private const float EFFECT_COOLDOWN = 1.5f; public static void PlayRadarEvadeEffect(Player player) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null) && !(Time.time - lastEffectTime < 1.5f)) { lastEffectTime = Time.time; Color color = default(Color); ((Color)(ref color))..ctor(0.4f, 0.8f, 1f, 0.8f); ShieldEffect.PlayShieldEffect(player, color, 0.6f, 0.6f); } } } [HarmonyPatch(typeof(PlayerManager), "GetClosestPlayer")] [HarmonyPatch(new Type[] { typeof(Vector2), typeof(bool) })] public class GetClosestPlayerPatch { [HarmonyPostfix] public static void Postfix(ref Player __result, Vector2 refPos, bool needVision) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)__result == (Object)null) && ImmunityAntiRadarCard.HasImmunity(__result)) { Player val = __result; __result = FindClosestPlayerWithoutImmunity(refPos, val, needVision); AntiRadarEffectHelper.PlayRadarEvadeEffect(val); } } private static Player FindClosestPlayerWithoutImmunity(Vector2 pos, Player excluded, bool needVision) { //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) if (PlayerManager.instance?.players == null) { return null; } Player result = null; float num = float.MaxValue; foreach (Player player in PlayerManager.instance.players) { if (!((Object)(object)player == (Object)null) && !((Object)(object)player == (Object)(object)excluded) && !((Object)(object)player.data == (Object)null) && !player.data.dead && ((Component)player).gameObject.activeInHierarchy && !ImmunityAntiRadarCard.HasImmunity(player) && (!needVision || PlayerManager.instance.CanSeePlayer(pos, player).canSee)) { float num2 = Vector2.Distance(pos, player.data.playerVel.position); if (num2 < num) { num = num2; result = player; } } } return result; } } [HarmonyPatch(typeof(PlayerManager), "GetClosestPlayer")] [HarmonyPatch(new Type[] { typeof(Vector2), typeof(Vector2) })] public class GetClosestPlayerForwardPatch { [HarmonyPostfix] public static void Postfix(ref Player __result, Vector2 refPos, Vector2 forward) { //IL_0023: 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) if (!((Object)(object)__result == (Object)null) && ImmunityAntiRadarCard.HasImmunity(__result)) { Player val = __result; __result = FindClosestPlayerWithoutImmunity(refPos, forward, val); AntiRadarEffectHelper.PlayRadarEvadeEffect(val); } } private static Player FindClosestPlayerWithoutImmunity(Vector2 refPos, Vector2 forward, Player excluded) { //IL_00bd: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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) if (PlayerManager.instance?.players == null) { return null; } Player result = null; float num = float.MaxValue; foreach (Player player in PlayerManager.instance.players) { if (!((Object)(object)player == (Object)null) && !((Object)(object)player == (Object)(object)excluded) && !((Object)(object)player.data == (Object)null) && !player.data.dead && ((Component)player).gameObject.activeInHierarchy && !ImmunityAntiRadarCard.HasImmunity(player) && PlayerManager.instance.CanSeePlayer(refPos, player).canSee) { float num2 = Vector2.Distance(refPos, player.data.playerVel.position); float num3 = Vector2.Angle(forward, player.data.playerVel.position - refPos); float num4 = num2 + num3; if (num4 < num) { num = num4; result = player; } } } return result; } } [HarmonyPatch(typeof(BounceEffectRetarget), "FindTarget")] public class TargetBouncePatch { [HarmonyPostfix] public static void Postfix(BounceEffectRetarget __instance, ref Player __result, HitInfo hit) { //IL_0028: 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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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) if (!((Object)(object)__result == (Object)null) && ImmunityAntiRadarCard.HasImmunity(__result)) { Player val = __result; Vector3 pos = ((Component)__instance).transform.position + Vector2.op_Implicit(hit.normal * 0.1f); __result = FindVisiblePlayerWithoutImmunity(pos, val); AntiRadarEffectHelper.PlayRadarEvadeEffect(val); } } private static Player FindVisiblePlayerWithoutImmunity(Vector3 pos, Player exclude) { //IL_00ba: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) if (PlayerManager.instance?.players == null) { return null; } Player result = null; float num = float.MaxValue; foreach (Player player in PlayerManager.instance.players) { if (!((Object)(object)player == (Object)null) && !((Object)(object)player == (Object)(object)exclude) && !((Object)(object)player.data == (Object)null) && !player.data.dead && ((Component)player).gameObject.activeInHierarchy && !ImmunityAntiRadarCard.HasImmunity(player) && PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(pos), player).canSee) { float num2 = Vector3.Distance(pos, ((Component)player).transform.position); if (num2 < num) { num = num2; result = player; } } } return result; } } [HarmonyPatch(typeof(CharacterStatModifiers), "AddSlowAddative")] public class AntiSlowPatch_AddSlowAddative { public static bool Prefix(CharacterStatModifiers __instance, float slowToAdd, float maxValue, bool isFastSlow) { Player component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((Component)component).gameObject.GetComponent() != (Object)null) { PlayResistEffects(component); return false; } return true; } public static void PlayResistEffects(Player player) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Color color = default(Color); ((Color)(ref color))..ctor(0.2f, 1f, 0.6f, 1f); ShieldEffect.PlayShieldEffect(player, color); } } [HarmonyPatch(typeof(CharacterStatModifiers), "RPCA_AddSlow")] public class AntiSlowPatch_RPCA_AddSlow { public static bool Prefix(CharacterStatModifiers __instance, float slowToAdd, bool isFastSlow) { Player component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((Component)component).gameObject.GetComponent() != (Object)null) { AntiSlowPatch_AddSlowAddative.PlayResistEffects(component); return false; } return true; } } [HarmonyPatch(typeof(CharacterStatModifiers), "DoSlowDown")] [HarmonyPatch(new Type[] { typeof(float) })] public class AntiSlowPatch_DoSlowDown { public static bool Prefix(CharacterStatModifiers __instance, float newSlow) { Player component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((Component)component).gameObject.GetComponent() != (Object)null) { return false; } return true; } } public static class ReversibleEffectUniversalPatch { private static bool initialized = false; private static Type reversibleEffectType = null; private static FieldInfo playerField = null; private static FieldInfo characterStatModifiersModifierField = null; private static FieldInfo movementSpeedMultField = null; private static FieldInfo jumpMultField = null; private static float lastEffectTime = -1f; private const float EFFECT_COOLDOWN = 0.5f; public static void ApplyPatch(Harmony harmony) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown try { FindReversibleEffectType(); if (reversibleEffectType == null) { MrFuntikMod.LogWarning("[MFM] ReversibleEffect type not found - ModdingUtils not loaded?"); return; } MethodInfo method = reversibleEffectType.GetMethod("ApplyModifiers", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (method == null) { MrFuntikMod.LogWarning("[MFM] ApplyModifiers method not found in ReversibleEffect"); return; } CacheFields(); MethodInfo method2 = typeof(ReversibleEffectUniversalPatch).GetMethod("ApplyModifiers_Prefix", BindingFlags.Static | BindingFlags.Public); harmony.Patch((MethodBase)method, new HarmonyMethod(method2) { priority = 800 }, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); initialized = true; } catch (Exception ex) { MrFuntikMod.LogError("[MFM] Failed to apply ReversibleEffect patch: " + ex.Message); } } private static void FindReversibleEffectType() { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { try { if (assembly.FullName.Contains("ModdingUtils")) { Type type = assembly.GetType("ModdingUtils.MonoBehaviours.ReversibleEffect"); if (type != null) { reversibleEffectType = type; return; } } } catch (Exception) { } } Assembly[] assemblies2 = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly2 in assemblies2) { try { Type[] types; try { types = assembly2.GetTypes(); } catch (ReflectionTypeLoadException ex2) { types = ex2.Types; } if (types == null) { continue; } Type[] array = types; foreach (Type type2 in array) { if (type2 != null && type2.FullName == "ModdingUtils.MonoBehaviours.ReversibleEffect") { reversibleEffectType = type2; return; } } } catch (Exception) { } } } private static void CacheFields() { if (!(reversibleEffectType == null)) { playerField = reversibleEffectType.GetField("player", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); characterStatModifiersModifierField = reversibleEffectType.GetField("characterStatModifiersModifier", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (characterStatModifiersModifierField != null) { Type fieldType = characterStatModifiersModifierField.FieldType; movementSpeedMultField = fieldType.GetField("movementSpeed_mult", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); jumpMultField = fieldType.GetField("jump_mult", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } } } public static void ApplyModifiers_Prefix(object __instance) { try { if (playerField == null || characterStatModifiersModifierField == null) { return; } object? value = playerField.GetValue(__instance); Player val = (Player)((value is Player) ? value : null); if ((Object)(object)val == (Object)null) { return; } AntiSlowMono component = ((Component)val).GetComponent(); if ((Object)(object)component == (Object)null) { return; } object value2 = characterStatModifiersModifierField.GetValue(__instance); if (value2 == null) { return; } bool flag = false; if (movementSpeedMultField != null) { float num = (float)movementSpeedMultField.GetValue(value2); if (num < 1f) { movementSpeedMultField.SetValue(value2, 1f); flag = true; } } if (jumpMultField != null) { float num2 = (float)jumpMultField.GetValue(value2); if (num2 < 1f) { jumpMultField.SetValue(value2, 1f); flag = true; } } if (flag && Time.time - lastEffectTime >= 0.5f) { lastEffectTime = Time.time; AntiSlowPatch_AddSlowAddative.PlayResistEffects(val); } } catch (Exception ex) { MrFuntikMod.LogWarning("[MFM] ReversibleEffect patch error: " + ex.Message); } } } public static class AntiSlowExternalModsPatch { public static void ApplyPatches(Harmony harmony) { ReversibleEffectUniversalPatch.ApplyPatch(harmony); TryPatchMethod(harmony, "GoldHealthMono", "OnStart", "GoldHealth OnStart", "GoldHealthOnStartPrefix"); TryPatchMethod(harmony, "GoldenGlazeMono", "DoHitEffect", "Golden Glaze DoHitEffect", "GenericDoHitEffectPrefix"); } private static void TryPatchMethod(Harmony harmony, string className, string methodName, string displayName, string prefixMethodName) { //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Expected O, but got Unknown try { Type type = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { try { Type[] types; try { types = assembly.GetTypes(); } catch (ReflectionTypeLoadException ex) { types = ex.Types; } if (types == null) { continue; } Type[] array = types; foreach (Type type2 in array) { if (type2 != null && type2.Name == className) { type = type2; break; } } if (!(type != null)) { continue; } break; } catch (Exception) { } } if (type == null) { return; } MethodInfo method = type.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (!(method == null)) { MethodInfo method2 = typeof(AntiSlowExternalModsPatch).GetMethod(prefixMethodName, BindingFlags.Static | BindingFlags.Public); if (!(method2 == null)) { HarmonyMethod val = new HarmonyMethod(method2) { priority = 800 }; harmony.Patch((MethodBase)method, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } } catch (Exception ex3) { MrFuntikMod.LogWarning("[MFM] Failed to patch " + displayName + ": " + ex3.Message); } } public static bool GoldHealthOnStartPrefix(object __instance) { try { MonoBehaviour val = (MonoBehaviour)((__instance is MonoBehaviour) ? __instance : null); if ((Object)(object)val == (Object)null) { return true; } Player component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((Component)component).gameObject.GetComponent() != (Object)null) { AntiSlowPatch_AddSlowAddative.PlayResistEffects(component); Object.Destroy((Object)(object)val); return false; } } catch (Exception ex) { MrFuntikMod.LogWarning("[MFM] Error in GoldHealthOnStartPrefix: " + ex.Message); } return true; } public static bool GenericDoHitEffectPrefix(object __instance, object hit) { try { Type type = hit.GetType(); FieldInfo field = type.GetField("transform", BindingFlags.Instance | BindingFlags.Public); Transform val = null; if (field != null) { object? value = field.GetValue(hit); val = (Transform)((value is Transform) ? value : null); } if ((Object)(object)val == (Object)null) { return true; } Player component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((Component)component).gameObject.GetComponent() != (Object)null) { AntiSlowPatch_AddSlowAddative.PlayResistEffects(component); return false; } } catch (Exception ex) { MrFuntikMod.LogWarning("[MFM] Error in GenericDoHitEffectPrefix: " + ex.Message); } return true; } } internal static class AntiKnockbackHelper { private static float lastEffectTime; private const float EFFECT_COOLDOWN = 0.15f; private static readonly Color SHIELD_COLOR = new Color(0.9f, 0.5f, 0.2f, 1f); public static bool IsCalledFromOutOfBounds() { StackTrace stackTrace = new StackTrace(); StackFrame[] frames = stackTrace.GetFrames(); if (frames == null) { return false; } StackFrame[] array = frames; foreach (StackFrame stackFrame in array) { if (stackFrame.GetMethod()?.DeclaringType?.Name == "OutOfBoundsHandler") { return true; } } return false; } public static void PlayResistEffects(Player player) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (!(Time.time - lastEffectTime < 0.15f)) { lastEffectTime = Time.time; ShieldEffect.PlayShieldEffect(player, SHIELD_COLOR, 0.8f); } } public static bool ShouldBlockKnockback(Player player) { if ((Object)(object)player == (Object)null) { return false; } if ((Object)(object)((Component)player).gameObject.GetComponent() == (Object)null) { return false; } if (IsCalledFromOutOfBounds()) { return false; } return true; } } [HarmonyPatch(typeof(HealthHandler), "TakeForce")] public class AntiKnockbackPatch_TakeForce { public static bool Prefix(HealthHandler __instance, ref Vector2 force) { Player component = ((Component)__instance).GetComponent(); if (!AntiKnockbackHelper.ShouldBlockKnockback(component)) { return true; } AntiKnockbackHelper.PlayResistEffects(component); return false; } } [HarmonyPatch(typeof(HealthHandler), "RPCA_SendTakeForce")] public class AntiKnockbackPatch_RPCA { public static bool Prefix(HealthHandler __instance, Vector2 force) { Player component = ((Component)__instance).GetComponent(); if (!AntiKnockbackHelper.ShouldBlockKnockback(component)) { return true; } AntiKnockbackHelper.PlayResistEffects(component); return false; } } [HarmonyPatch(typeof(SilenceHandler), "RPCA_AddSilence")] public class AntiSilencePatch { private static float lastEffectTime; private const float EFFECT_COOLDOWN = 0.15f; public static bool Prefix(SilenceHandler __instance, float __0) { Player component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((Component)component).GetComponent() != (Object)null) { PlayResistEffect(component); return false; } return true; } private static void PlayResistEffect(Player player) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (!(Time.time - lastEffectTime < 0.15f)) { lastEffectTime = Time.time; Color color = default(Color); ((Color)(ref color))..ctor(0.6f, 0.6f, 1f, 1f); ShieldEffect.PlayShieldEffect(player, color); } } } [HarmonyPatch(typeof(HealthHandler), "RPCA_Die")] public class DeathPatchNormal { [HarmonyPostfix] public static void Postfix(HealthHandler __instance) { KamikazeHelper.ProcessKamikaze(__instance); } } [HarmonyPatch(typeof(HealthHandler), "RPCA_Die_Phoenix")] public class DeathPatchPhoenix { [HarmonyPostfix] public static void Postfix(HealthHandler __instance) { KamikazeHelper.ProcessKamikaze(__instance); } } public static class KamikazeHelper { public static void ProcessKamikaze(HealthHandler healthHandler) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) Player component = ((Component)healthHandler).GetComponent(); if (!((Object)(object)component == (Object)null) && component.data.currentCards.Any((CardInfo card) => card.cardName == "Kamikaze")) { GameObject val = new GameObject("KamikazeOnDeath"); val.transform.position = ((Component)component).transform.position; KamikazeOnDeathComponent kamikazeOnDeathComponent = val.AddComponent(); kamikazeOnDeathComponent.SourcePlayer = component; kamikazeOnDeathComponent.MaxDistance = 18f; } } } public class KamikazeOnDeathComponent : MonoBehaviour { public Player SourcePlayer; public float MaxDistance = 18f; private void Start() { ExecuteKamikazeEffectOnDeath(); } private void ExecuteKamikazeEffectOnDeath() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00d2: 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_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_016a: 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_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) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)SourcePlayer == (Object)null) { MrFuntikMod.LogError("[Kamikaze] SourcePlayer is null!"); Object.Destroy((Object)(object)((Component)this).gameObject); return; } GameObject kamikazeVisual = KamikazeMono.kamikazeVisual; if ((Object)(object)kamikazeVisual != (Object)null) { Object.Instantiate(kamikazeVisual, ((Component)this).transform.position, Quaternion.identity); } Vector2 val = Vector2.op_Implicit(((Component)this).transform.position); Player[] array = PlayerManager.instance.players.ToArray(); Player[] array2 = array; foreach (Player val2 in array2) { if (val2.teamID == SourcePlayer.teamID) { continue; } float num = Vector2.Distance(val, Vector2.op_Implicit(((Component)val2).transform.position)); bool canSee = PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)this).transform.position), val2).canSee; if (num < MaxDistance && canSee) { HealthHandler component = ((Component)val2).GetComponent(); if ((Object)(object)component != (Object)null) { ((Damagable)component).TakeDamage(200f * Vector2.down, Vector2.op_Implicit(((Component)val2).transform.position), ((Component)SourcePlayer.data.weaponHandler).gameObject, SourcePlayer, true, false); Vector3 val3 = ((Component)val2).transform.position - Vector2.op_Implicit(val); component.TakeForce(Vector2.op_Implicit(((Vector3)(ref val3)).normalized * 12000f), (ForceMode2D)1, true, false, 0.8f); } } } Object.Destroy((Object)(object)((Component)this).gameObject, 0.1f); } } public static class ModRespawnTracker { public static int GetOurRemainingRespawns(Player player) { int num = 0; PhoenixSurgeMono component = ((Component)player).GetComponent(); if ((Object)(object)component != (Object)null) { num += component.OurRemainingCount; } DeathDefyMono component2 = ((Component)player).GetComponent(); if ((Object)(object)component2 != (Object)null) { num += component2.OurRemainingCount; } return num; } public static bool WasOurRespawnConsumed(Player player) { if ((Object)(object)player == (Object)null || (Object)(object)player.data == (Object)null || (Object)(object)player.data.stats == (Object)null) { return false; } int remainingRespawns = player.data.stats.remainingRespawns; int ourRemainingRespawns = GetOurRemainingRespawns(player); return remainingRespawns < ourRemainingRespawns; } } public static class PhoenixSurgeHandler { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; private List.Enumerator <>s__1; private Player 5__2; private CharacterData 5__3; private PhoenixSurgeMono 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__1 = default(List.Enumerator); 5__2 = null; 5__3 = null; 5__4 = 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()) { 5__2 = <>s__1.Current; if ((Object)(object)5__2 == (Object)null) { continue; } 5__3 = ((Component)5__2).GetComponent(); if (!((Object)(object)5__3 == (Object)null)) { 5__4 = ((Component)5__2).GetComponent(); if (!((Object)(object)5__4 == (Object)null) && 5__3.view.IsMine) { NetworkingManager.RPC(typeof(PhoenixSurgeHandler), "RPC_AddRespawn", new object[1] { 5__2.playerID }); 5__3 = null; 5__4 = null; 5__2 = null; } } } } finally { ((IDisposable)<>s__1).Dispose(); } <>s__1 = default(List.Enumerator); 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 d__2 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; private List.Enumerator <>s__1; private Player 5__2; private PhoenixSurgeMono 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__1 = default(List.Enumerator); 5__2 = null; 5__3 = 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()) { 5__2 = <>s__1.Current; if (!((Object)(object)5__2 == (Object)null)) { 5__3 = ((Component)5__2).GetComponent(); if (!((Object)(object)5__3 == (Object)null)) { 5__3.ClearTempRespawn(); 5__3 = null; 5__2 = null; } } } } finally { ((IDisposable)<>s__1).Dispose(); } <>s__1 = default(List.Enumerator); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static void RegisterHooks() { GameModeManager.AddHook("BattleStart", (Func)OnBattleStart); GameModeManager.AddHook("PointEnd", (Func)OnPointEnd); } [IteratorStateMachine(typeof(d__1))] private static IEnumerator OnBattleStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { gm = gm }; } [IteratorStateMachine(typeof(d__2))] private static IEnumerator OnPointEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0) { gm = gm }; } [UnboundRPC] public static void RPC_AddRespawn(int playerID) { Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player p) => p.playerID == playerID)); if (!((Object)(object)val == (Object)null)) { PhoenixSurgeMono component = ((Component)val).GetComponent(); if (!((Object)(object)component == (Object)null)) { component.AddTempRespawn(); } } } [UnboundRPC] public static void RPC_MarkPendingExplosion(int playerID) { Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player p) => p.playerID == playerID)); if (!((Object)(object)val == (Object)null)) { PhoenixSurgeMono component = ((Component)val).GetComponent(); if (!((Object)(object)component == (Object)null)) { component.MarkPendingExplosion(); } } } [UnboundRPC] public static void RPC_ShowText(int playerID) { Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player p) => p.playerID == playerID)); if (!((Object)(object)val == (Object)null)) { PhoenixSurgeMono component = ((Component)val).GetComponent(); if (!((Object)(object)component == (Object)null)) { component.ShowSurgeText(); } } } } [HarmonyPatch(typeof(HealthHandler), "RPCA_Die_Phoenix")] [HarmonyPriority(800)] public class PhoenixSurgePhoenixPatch { public static void Postfix(HealthHandler __instance) { Player component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return; } CharacterData component2 = ((Component)__instance).GetComponent(); if (!((Object)(object)component2 == (Object)null)) { PhoenixSurgeMono component3 = ((Component)component).GetComponent(); if (!((Object)(object)component3 == (Object)null) && component2.view.IsMine && component3.HasActiveRespawn() && ModRespawnTracker.WasOurRespawnConsumed(component) && component3.TryConsumeRespawn()) { NetworkingManager.RPC(typeof(PhoenixSurgeHandler), "RPC_ShowText", new object[1] { component.playerID }); NetworkingManager.RPC(typeof(PhoenixSurgeHandler), "RPC_MarkPendingExplosion", new object[1] { component.playerID }); } } } } [HarmonyPatch(typeof(ProjectileHit), "RPCA_DoHit")] [HarmonyPriority(800)] public class SoulPiercerPatch { public static bool Prefix(ProjectileHit __instance, Vector2 hitPoint, Vector2 hitNormal, Vector2 vel, int viewID, int colliderID, bool wasBlocked) { //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Expected O, but got Unknown //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Expected O, but got Unknown //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: 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_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance.ownPlayer == (Object)null) { return true; } SoulPiercerMono component = ((Component)__instance.ownPlayer).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } if (wasBlocked) { return true; } if (viewID == -1) { return true; } PhotonView photonView = PhotonNetwork.GetPhotonView(viewID); if ((Object)(object)photonView == (Object)null) { return true; } HealthHandler component2 = ((Component)photonView).GetComponent(); if ((Object)(object)component2 == (Object)null) { return true; } Player component3 = ((Component)component2).GetComponent(); if ((Object)(object)component3 == (Object)null) { return true; } if ((Object)(object)component3.data == (Object)null || component3.data.dead) { return true; } if (component2.isRespawning) { return true; } Block component4 = ((Component)component2).GetComponent(); if ((Object)(object)component4 != (Object)null && component4.IsBlocking()) { return true; } HitInfo val = new HitInfo { point = hitPoint, normal = hitNormal, collider = ((Component)photonView).GetComponentInChildren(), transform = ((Component)photonView).transform, rigidbody = ((Component)photonView).GetComponent() }; Damagable val2 = (Damagable)(object)component2; float num = __instance.damage; if (__instance.percentageDamage != 0f) { num += component3.data.maxHealth * __instance.percentageDamage; } if ((bool)AccessTools.Field(typeof(ProjectileHit), "hasControl").GetValue(__instance)) { float num2 = (__instance.bulletCanDealDeamage ? num : 1f) * __instance.dealDamageMultiplierr; Vector2 val3 = Vector2.op_Implicit(((Component)__instance).transform.forward) * num2; val2.CallTakeDamage(val3, hitPoint, __instance.ownWeapon, __instance.ownPlayer, true); if (__instance.movementSlow != 0f) { CharacterStatModifiers component5 = ((Component)component2).GetComponent(); if ((Object)(object)component5 != (Object)null) { component5.RPCA_AddSlow(__instance.movementSlow, false); } } if (__instance.force != 0f) { PlayerVelocity component6 = ((Component)component3).GetComponent(); if ((Object)(object)component6 != (Object)null) { float num3 = (float)Traverse.Create((object)component6).Field("mass").GetValue(); float num4 = Mathf.Clamp(num3 / 100f, 0f, 1f); component2.CallTakeForce(Vector2.op_Implicit(((Component)__instance).transform.forward) * num4 * __instance.force, (ForceMode2D)1, false, false, 0f); } } } if (__instance.isAllowedToSpawnObjects) { GamefeelManager.GameFeel(Vector2.op_Implicit(((Component)__instance).transform.forward * 3f * __instance.shake)); DynamicParticles.instance.PlayBulletHit(__instance.damage, ((Component)__instance).transform, val, __instance.projectileColor); SpawnedAttack val4 = (SpawnedAttack)AccessTools.Field(typeof(ProjectileHit), "spawnedAttack").GetValue(__instance); for (int i = 0; i < __instance.objectsToSpawn.Length; i++) { ObjectsToSpawn.SpawnObject(((Component)__instance).transform, val, __instance.objectsToSpawn[i], component2, __instance.team, __instance.damage, val4, false); } } if (__instance.effects != null && __instance.effects.Count > 0) { foreach (RayHitEffect effect in __instance.effects) { if ((Object)(object)effect != (Object)null) { HasToReturn val5 = effect.DoHitEffect(val); } } } __instance.AddPlayerToHeld(component2); return false; } } [HarmonyPatch(typeof(HealthHandler), "DoDamage")] public class ThornShieldPatch { [HarmonyPostfix] public static void Postfix(HealthHandler __instance, Vector2 damage, Player damagingPlayer) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) Player component = ((Component)__instance).GetComponent(); if (!((Object)(object)component == (Object)null)) { ThornShieldMono.TryReflectDamage(component, damage, damagingPlayer); } } } [HarmonyPatch(typeof(HealthHandler), "DoDamage")] public class VengefulSparkDamagePatch { [HarmonyPostfix] public static void Postfix(HealthHandler __instance, Vector2 damage, Vector2 position, Color blinkColor, GameObject damagingWeapon, Player damagingPlayer, bool healthRemoval, bool lethal, bool ignoreBlock) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (healthRemoval) { return; } Player component = ((Component)__instance).GetComponent(); if (!((Object)(object)component == (Object)null)) { VengefulSparkEffect component2 = ((Component)component).GetComponent(); if (!((Object)(object)component2 == (Object)null)) { component2.OnDamageReceived(damage, damagingPlayer, damagingWeapon); } } } } [HarmonyPatch(typeof(CharacterStatModifiers), "ResetStats")] public class VengefulSparkResetStatsPatch { [HarmonyPostfix] public static void Postfix(CharacterStatModifiers __instance) { VengefulSparkEffect component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null) { component.OnRoundStart(); } } } } namespace MrFuntikMod.Effects { public class AegisShieldMono : MonoBehaviour { [CompilerGenerated] private sealed class d__30 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public AegisShieldMono <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__30(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ResetState(); 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 float SHIELD_DURATION = 3f; private const float COOLDOWN = 15f; private Player player; private Block block; private CharacterData data; private bool isShieldActive = false; private float shieldTimer = 0f; private float cooldownRemaining = 0f; private bool isReady = true; private Action blockAction; private GameObject shieldVisual; private LineRenderer[] orbitRenderers = (LineRenderer[])(object)new LineRenderer[3]; private LineRenderer circleRenderer; private float[] orbitAngles = new float[3] { 0f, 120f, 240f }; private float[] orbitTilts = new float[3] { 0f, 60f, -60f }; private float[] orbitSpeeds = new float[3] { 80f, -110f, 65f }; private float[] orbitPulseFreqs = new float[3] { 3f, 4.5f, 2.5f }; private float[] orbitPulseAmplitudes = new float[3] { 0.12f, 0.08f, 0.15f }; private const int ORBIT_SEGMENTS = 48; private const float ORBIT_RADIUS_X = 1.4f; private const float ORBIT_RADIUS_Y = 0.6f; private const int CIRCLE_SEGMENTS = 48; private const float CIRCLE_BASE_RADIUS = 1.6f; private const float CIRCLE_PULSE_AMPLITUDE = 0.1f; private const float CIRCLE_PULSE_FREQ = 2f; private CooldownUI cooldownUI; private static Material sharedMaterial; public static bool IsShieldActiveForPlayer(Player player) { if ((Object)(object)player == (Object)null || (Object)(object)player.data == (Object)null || player.data.dead) { return false; } AegisShieldMono component = ((Component)player).gameObject.GetComponent(); return (Object)(object)component != (Object)null && component.isShieldActive; } private void Start() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) player = ((Component)this).GetComponent(); block = ((Component)this).GetComponent(); data = ((Component)this).GetComponent(); if ((Object)(object)sharedMaterial == (Object)null) { sharedMaterial = new Material(Shader.Find("Sprites/Default")); } blockAction = OnBlock; block.BlockAction = (Action)Delegate.Combine(block.BlockAction, blockAction); CreateShieldVisual(); if (data.view.IsMine) { cooldownUI = CooldownUI.Create(((Component)this).transform, 1f); cooldownUI.SetIcon("O", (Color?)new Color(0.2f, 0.8f, 1f)); } GameModeManager.AddHook("PointStart", (Func)OnPointStart); if ((Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive)); } } private void OnRevive() { ResetState(); } [IteratorStateMachine(typeof(d__30))] private IEnumerator OnPointStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__30(0) { <>4__this = this, gm = gm }; } private void Update() { if ((Object)(object)player == (Object)null || (Object)(object)data == (Object)null) { return; } if (data.dead) { CooldownUI obj = cooldownUI; if (obj != null) { obj.Hide(); } if ((Object)(object)shieldVisual != (Object)null && shieldVisual.activeSelf) { shieldVisual.SetActive(false); } return; } if (!isReady && cooldownRemaining > 0f) { cooldownRemaining -= Time.deltaTime; if (cooldownRemaining <= 0f) { cooldownRemaining = 0f; isReady = true; } } if (isShieldActive) { shieldTimer += TimeHandler.deltaTime; if (shieldTimer < 3f) { block.sinceBlock = 0f; UpdateShieldVisual(); } else { DeactivateShield(); } } UpdateUI(); } private void OnBlock(BlockTriggerType triggerType) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 if ((int)triggerType <= 0 && isReady && !isShieldActive && !((Object)(object)data == (Object)null) && !data.dead && data.view.IsMine) { ActivateShieldLocal(); NetworkingManager.RPC(typeof(AegisShieldMono), "RPC_ActivateShield", new object[1] { player.playerID }); } } [UnboundRPC] public static void RPC_ActivateShield(int playerID) { Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player p) => p.playerID == playerID)); if (!((Object)(object)val == (Object)null)) { ((Component)val).GetComponent()?.ActivateShieldLocal(); } } private void ActivateShieldLocal() { isShieldActive = true; shieldTimer = 0f; isReady = false; cooldownRemaining = 15f; if ((Object)(object)shieldVisual != (Object)null) { shieldVisual.SetActive(true); } } private void DeactivateShield() { isShieldActive = false; shieldTimer = 0f; if ((Object)(object)shieldVisual != (Object)null) { shieldVisual.SetActive(false); } } public float GetShieldTimeRemaining() { return isShieldActive ? Mathf.Max(0f, 3f - shieldTimer) : 0f; } private void ResetState() { isShieldActive = false; shieldTimer = 0f; cooldownRemaining = 0f; isReady = true; if ((Object)(object)shieldVisual != (Object)null) { shieldVisual.SetActive(false); } CooldownUI obj = cooldownUI; if (obj != null) { obj.Hide(); } } private void CreateShieldVisual() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0033: 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_0049: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Expected O, but got Unknown //IL_0132: Unknown result type (might be due to invalid IL or missing references) shieldVisual = new GameObject("AegisShield"); shieldVisual.transform.SetParent(((Component)this).transform); shieldVisual.transform.localPosition = Vector3.zero; GameObject val = new GameObject("OuterCircle"); val.transform.SetParent(shieldVisual.transform); val.transform.localPosition = Vector3.zero; circleRenderer = val.AddComponent(); circleRenderer.useWorldSpace = false; circleRenderer.loop = true; circleRenderer.startWidth = 0.1f; circleRenderer.endWidth = 0.1f; circleRenderer.positionCount = 48; ((Renderer)circleRenderer).material = sharedMaterial; ((Renderer)circleRenderer).sortingLayerName = "MostFront"; ((Renderer)circleRenderer).sortingOrder = 99; for (int i = 0; i < 3; i++) { GameObject val2 = new GameObject($"Orbit_{i}"); val2.transform.SetParent(shieldVisual.transform); val2.transform.localPosition = Vector3.zero; LineRenderer val3 = val2.AddComponent(); val3.useWorldSpace = false; val3.loop = true; val3.startWidth = 0.08f; val3.endWidth = 0.08f; val3.positionCount = 48; ((Renderer)val3).material = sharedMaterial; SpriteRenderer componentInChildren = ((Component)this).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { ((Renderer)val3).sortingLayerID = ((Renderer)componentInChildren).sortingLayerID; ((Renderer)val3).sortingOrder = ((Renderer)componentInChildren).sortingOrder - 5; } orbitRenderers[i] = val3; } shieldVisual.SetActive(false); } private void UpdateShieldVisual() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //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_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)shieldVisual == (Object)null) { return; } float shieldTimeRemaining = GetShieldTimeRemaining(); float num = shieldTimeRemaining / 3f; Color val = ((!(num > 0.5f)) ? Color.Lerp(new Color(1f, 1f, 0.3f, 0.8f), new Color(1f, 0.3f, 0.3f, 0.8f), (0.5f - num) * 2f) : Color.Lerp(new Color(0.2f, 0.8f, 1f, 0.8f), new Color(1f, 1f, 0.3f, 0.8f), (1f - num) * 2f)); if (shieldTimeRemaining <= 1f) { float num2 = Mathf.Sin(Time.time * 20f) * 0.5f + 0.5f; val.a *= num2; } if ((Object)(object)circleRenderer != (Object)null) { float num3 = 1f + Mathf.Sin(Time.time * 2f) * 0.1f; float num4 = 1.6f * num3; for (int i = 0; i < 48; i++) { float num5 = (float)i / 48f * MathF.PI * 2f; circleRenderer.SetPosition(i, new Vector3(Mathf.Cos(num5) * num4, Mathf.Sin(num5) * num4, 0f)); } Color val2 = val; val2.a *= 0.5f; circleRenderer.startColor = val2; circleRenderer.endColor = val2; } for (int j = 0; j < 3; j++) { if (!((Object)(object)orbitRenderers[j] == (Object)null)) { orbitAngles[j] += orbitSpeeds[j] * Time.deltaTime; if (orbitAngles[j] > 360f) { orbitAngles[j] -= 360f; } if (orbitAngles[j] < -360f) { orbitAngles[j] += 360f; } float num6 = 1f + Mathf.Sin(Time.time * orbitPulseFreqs[j]) * orbitPulseAmplitudes[j]; float num7 = 1.4f * num6; float num8 = 0.6f * num6; float num9 = orbitAngles[j] * (MathF.PI / 180f); float num10 = orbitTilts[j] * (MathF.PI / 180f); for (int k = 0; k < 48; k++) { float num11 = (float)k / 48f * MathF.PI * 2f; float num12 = Mathf.Cos(num11) * num7; float num13 = Mathf.Sin(num11) * num8; float num14 = num12; float num15 = num13 * Mathf.Cos(num10); float num16 = num14 * Mathf.Cos(num9) - num15 * Mathf.Sin(num9); float num17 = num14 * Mathf.Sin(num9) + num15 * Mathf.Cos(num9); orbitRenderers[j].SetPosition(k, new Vector3(num16, num17, 0f)); } orbitRenderers[j].startColor = val; orbitRenderers[j].endColor = val; } } } private void UpdateUI() { if (!((Object)(object)cooldownUI == (Object)null)) { if (isShieldActive) { cooldownUI.ShowActive(GetShieldTimeRemaining()); } else if (!isReady && cooldownRemaining > 0f) { cooldownUI.ShowCooldown(cooldownRemaining, 15f); } else { cooldownUI.Hide(); } } } private void OnDestroy() { if ((Object)(object)block != (Object)null && blockAction != null) { block.BlockAction = (Action)Delegate.Remove(block.BlockAction, blockAction); } if ((Object)(object)data != (Object)null && (Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive)); } GameModeManager.RemoveHook("PointStart", (Func)OnPointStart); if ((Object)(object)shieldVisual != (Object)null) { Object.Destroy((Object)(object)shieldVisual); } if ((Object)(object)cooldownUI != (Object)null) { Object.Destroy((Object)(object)((Component)cooldownUI).gameObject); } } } public class ArcFieldMono : MonoBehaviour { private const float RADIUS_BONUS = 3f; private const float DAMAGE_MULTIPLIER = 0.01f; private const float BASE_BULLET_DAMAGE = 55f; private const float TICK_INTERVAL = 0.15f; private const float ARC_DURATION = 0.15f; private Player player; private CharacterData data; private PhotonView view; private float nextTickTime; private float currentRadius; private Player[] cachedPlayers; private float lastPlayerCacheTime; private const float PLAYER_CACHE_INTERVAL = 0.5f; private static Material sharedMaterial; private List ambientArcs = new List(); private const int AMBIENT_ARC_COUNT = 4; private float ambientUpdateInterval = 0.07f; private float lastAmbientUpdate; private static int wallLayerMask = -1; private static bool wallLayerMaskInitialized = false; private void Start() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown player = ((Component)this).GetComponent(); data = ((Component)this).GetComponent(); view = player?.data?.view; if ((Object)(object)sharedMaterial == (Object)null) { sharedMaterial = new Material(Shader.Find("Sprites/Default")); } if (!wallLayerMaskInitialized) { wallLayerMask = LayerMask.GetMask(new string[3] { "Default", "Obstacle", "IgnorePlayer" }); if (wallLayerMask == 0) { wallLayerMask = ~LayerMask.GetMask(new string[2] { "Player", "PlayerObjectCollider" }); } wallLayerMaskInitialized = true; } UpdatePlayerCache(); nextTickTime = Time.time + 0.15f; CreateAmbientArcs(); } private void Update() { if ((Object)(object)player == (Object)null || (Object)(object)data == (Object)null || !data.isPlaying || data.dead) { return; } UpdateRadius(); if (Time.time - lastPlayerCacheTime > 0.5f) { UpdatePlayerCache(); } UpdateAmbientArcs(); if (Time.time >= nextTickTime) { if ((Object)(object)view != (Object)null && view.IsMine) { DamageNearbyEnemies(); } nextTickTime = Time.time + 0.15f; } } private void UpdateRadius() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) float num = 1f; if ((Object)(object)data.stats != (Object)null) { num = data.stats.sizeMultiplier; } float num2 = Mathf.Max(((Component)this).transform.localScale.x, ((Component)this).transform.localScale.y); if (num2 > num) { num = num2; } currentRadius = num + 3f; } private float GetPlayerBulletDamage() { if ((Object)(object)player?.data?.weaponHandler?.gun != (Object)null) { return player.data.weaponHandler.gun.damage * 55f; } return 55f; } private void UpdatePlayerCache() { if ((Object)(object)PlayerManager.instance != (Object)null && PlayerManager.instance.players != null) { cachedPlayers = PlayerManager.instance.players.ToArray(); } lastPlayerCacheTime = Time.time; } private void DamageNearbyEnemies() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if (cachedPlayers == null) { return; } Vector3 position = ((Component)this).transform.position; float playerBulletDamage = GetPlayerBulletDamage(); float num = playerBulletDamage * 0.01f; for (int i = 0; i < cachedPlayers.Length; i++) { Player val = cachedPlayers[i]; if (IsValidTarget(val)) { Vector3 position2 = ((Component)val).transform.position; float num2 = Vector2.Distance(Vector2.op_Implicit(position), Vector2.op_Implicit(position2)); if (num2 <= currentRadius && HasLineOfSight(position, position2)) { Vector3 val2 = position2 - position; Vector2 val3 = Vector2.op_Implicit(((Vector3)(ref val2)).normalized); ((Damagable)val.data.healthHandler).CallTakeDamage(val3 * num, Vector2.op_Implicit(position), (GameObject)null, player, true); NetworkingManager.RPC(typeof(ArcFieldMono), "RPCA_CreateLightningArc", new object[2] { player.playerID, val.playerID }); } } } } private bool IsValidTarget(Player targetPlayer) { if ((Object)(object)targetPlayer == (Object)null) { return false; } if (targetPlayer.playerID == player.playerID) { return false; } if (targetPlayer.teamID == player.teamID) { return false; } if ((Object)(object)targetPlayer.data == (Object)null) { return false; } if (targetPlayer.data.dead) { return false; } if (!targetPlayer.data.isPlaying) { return false; } return true; } private bool HasLineOfSight(Vector3 from, Vector3 to) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //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) Vector2 val = Vector2.op_Implicit(to - from); float magnitude = ((Vector2)(ref val)).magnitude; RaycastHit2D val2 = Physics2D.Raycast(Vector2.op_Implicit(from), ((Vector2)(ref val)).normalized, magnitude, wallLayerMask); return (Object)(object)((RaycastHit2D)(ref val2)).collider == (Object)null; } [UnboundRPC] public static void RPCA_CreateLightningArc(int ownerPlayerID, int targetPlayerID) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) Player val = PlayerManager.instance.players.Find((Player p) => p.playerID == ownerPlayerID); Player val2 = PlayerManager.instance.players.Find((Player p) => p.playerID == targetPlayerID); if (!((Object)(object)val == (Object)null) && !((Object)(object)val2 == (Object)null)) { CreateLightningArcVisual(((Component)val).transform.position, ((Component)val2).transform.position); ArcFieldMono component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { component.BoostAmbientArcs(); } } } private static void CreateLightningArcVisual(Vector3 start, Vector3 end) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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_00ec: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_0134: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("ArcField_Lightning"); val.transform.position = start; LineRenderer val2 = val.AddComponent(); val2.startWidth = 0.12f; val2.endWidth = 0.05f; val2.positionCount = 5; if ((Object)(object)sharedMaterial == (Object)null) { sharedMaterial = new Material(Shader.Find("Sprites/Default")); } ((Renderer)val2).material = sharedMaterial; val2.startColor = new Color(0.4f, 0.75f, 1f, 1f); val2.endColor = new Color(0.85f, 0.95f, 1f, 0.8f); ((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val2).receiveShadows = false; val2.SetPosition(0, start); for (int i = 1; i < val2.positionCount - 1; i++) { float num = (float)i / (float)(val2.positionCount - 1); Vector3 val3 = Vector3.Lerp(start, end, num); val3 += Vector2.op_Implicit(Random.insideUnitCircle) * 0.35f; val2.SetPosition(i, val3); } val2.SetPosition(val2.positionCount - 1, end); ArcFieldLightningDestroy arcFieldLightningDestroy = val.AddComponent(); arcFieldLightningDestroy.lifetime = 0.15f; } private void CreateAmbientArcs() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 4; i++) { GameObject val = new GameObject($"ArcField_Ambient_{i}"); val.transform.SetParent(((Component)this).transform); val.transform.localPosition = Vector3.zero; LineRenderer val2 = val.AddComponent(); val2.startWidth = 0.06f; val2.endWidth = 0.02f; val2.positionCount = 3; ((Renderer)val2).material = sharedMaterial; val2.startColor = new Color(0.5f, 0.8f, 1f, 0.5f); val2.endColor = new Color(0.85f, 0.95f, 1f, 0.25f); ((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val2).receiveShadows = false; ambientArcs.Add(val2); } } private void UpdateAmbientArcs() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) if (Time.time - lastAmbientUpdate < ambientUpdateInterval) { return; } lastAmbientUpdate = Time.time; Vector3 position = ((Component)this).transform.position; float num = Mathf.Min(1.2f, currentRadius * 0.2f); Vector3 val2 = default(Vector3); for (int i = 0; i < ambientArcs.Count; i++) { LineRenderer val = ambientArcs[i]; if (!((Object)(object)val == (Object)null)) { for (int j = 0; j < val.positionCount; j++) { float num2 = Random.Range(0f, 360f) * (MathF.PI / 180f); float num3 = Random.Range(num * 0.4f, num); ((Vector3)(ref val2))..ctor(Mathf.Cos(num2) * num3, Mathf.Sin(num2) * num3, 0f); val.SetPosition(j, position + val2); } } } } private void BoostAmbientArcs() { //IL_0035: 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) for (int i = 0; i < ambientArcs.Count; i++) { LineRenderer val = ambientArcs[i]; if (!((Object)(object)val == (Object)null)) { val.startColor = new Color(0.5f, 0.85f, 1f, 0.95f); val.endColor = new Color(0.9f, 0.95f, 1f, 0.75f); val.startWidth = 0.1f; } } ((MonoBehaviour)this).Invoke("ResetAmbientArcs", 0.12f); } private void ResetAmbientArcs() { //IL_0035: 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) for (int i = 0; i < ambientArcs.Count; i++) { LineRenderer val = ambientArcs[i]; if (!((Object)(object)val == (Object)null)) { val.startColor = new Color(0.5f, 0.8f, 1f, 0.5f); val.endColor = new Color(0.85f, 0.95f, 1f, 0.25f); val.startWidth = 0.06f; } } } private void OnDestroy() { for (int i = 0; i < ambientArcs.Count; i++) { if ((Object)(object)ambientArcs[i] != (Object)null) { Object.Destroy((Object)(object)((Component)ambientArcs[i]).gameObject); } } ambientArcs.Clear(); } } public class ArcFieldLightningDestroy : MonoBehaviour { public float lifetime = 0.15f; private float timer = 0f; private LineRenderer lineRenderer; private Color startColorInitial; private Color endColorInitial; private void Start() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) lineRenderer = ((Component)this).GetComponent(); if ((Object)(object)lineRenderer != (Object)null) { startColorInitial = lineRenderer.startColor; endColorInitial = lineRenderer.endColor; } } private void Update() { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) timer += Time.deltaTime; if ((Object)(object)lineRenderer != (Object)null) { float num = 1f - timer / lifetime; lineRenderer.startColor = new Color(startColorInitial.r, startColorInitial.g, startColorInitial.b, startColorInitial.a * num); lineRenderer.endColor = new Color(endColorInitial.r, endColorInitial.g, endColorInitial.b, endColorInitial.a * num); } if (timer >= lifetime) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class BacktrackMono : MonoBehaviour { private struct Snapshot { public Vector3 position; public float time; } [CompilerGenerated] private sealed class d__23 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public BacktrackMono <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__23(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ResetState(); 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 float BACKTRACK_TIME = 3f; private const float BASE_COOLDOWN = 10f; private const float COOLDOWN_REDUCTION_PER_STACK = 1f; private const float RECORD_INTERVAL = 0.05f; private const float HISTORY_DURATION = 4f; public int stackCount = 1; private Player player; private Block block; private CharacterData data; private float cooldownRemaining = 0f; private bool isReady = true; private float lastRecordTime = 0f; private LinkedList history = new LinkedList(); private Action blockAction; private CooldownUI cooldownUI; private GameObject backtrackPreview; private SpriteRenderer previewSprite; private static Material ghostMaterial; public bool IsHolding => false; private void Start() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) player = ((Component)this).GetComponent(); block = ((Component)this).GetComponent(); data = ((Component)this).GetComponent(); if ((Object)(object)ghostMaterial == (Object)null) { ghostMaterial = new Material(Shader.Find("Sprites/Default")); } blockAction = OnBlock; block.BlockAction = (Action)Delegate.Combine(block.BlockAction, blockAction); if (data.view.IsMine) { cooldownUI = CooldownUI.Create(((Component)this).transform, 1f); cooldownUI.SetIcon("<", (Color?)new Color(0.5f, 0.8f, 1f)); CreateBacktrackPreview(); } GameModeManager.AddHook("PointStart", (Func)OnPointStart); if ((Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive)); } } private void OnRevive() { ResetState(); } [IteratorStateMachine(typeof(d__23))] private IEnumerator OnPointStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__23(0) { <>4__this = this, gm = gm }; } private void Update() { if ((Object)(object)player == (Object)null || (Object)(object)data == (Object)null) { HideAllUI(); return; } if (data.dead) { HideAllUI(); return; } if (Time.time - lastRecordTime >= 0.05f) { RecordSnapshot(); lastRecordTime = Time.time; } CleanOldHistory(); if (!isReady) { cooldownRemaining -= Time.deltaTime; if (cooldownRemaining <= 0f) { cooldownRemaining = 0f; isReady = true; } } if (data.view.IsMine) { UpdateUI(); UpdateBacktrackPreview(); } } private void OnDisable() { HideAllUI(); } private void HideAllUI() { CooldownUI obj = cooldownUI; if (obj != null) { obj.Hide(); } if ((Object)(object)backtrackPreview != (Object)null) { backtrackPreview.SetActive(false); } } private void ResetState() { history?.Clear(); cooldownRemaining = 0f; isReady = true; lastRecordTime = 0f; HideAllUI(); } private void RecordSnapshot() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)data == (Object)null) && history != null) { history.AddLast(new Snapshot { position = ((Component)this).transform.position, time = Time.time }); } } private void CleanOldHistory() { if (history != null) { float num = Time.time - 4f; while (history.Count > 0 && history.First.Value.time < num) { history.RemoveFirst(); } } } private void OnBlock(BlockTriggerType triggerType) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Invalid comparison between Unknown and I4 //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0172: 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_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)data == (Object)null) && !data.dead && isReady && data.view.IsMine && (int)triggerType <= 0 && history != null && history.Count != 0) { float num = Time.time - 3f; float time = history.First.Value.time; float targetTime = Mathf.Max(num, time); Snapshot? snapshot = FindSnapshotAtTime(targetTime); if (snapshot.HasValue && !(Vector3.Distance(((Component)this).transform.position, snapshot.Value.position) < 0.5f)) { Vector3 position = ((Component)this).transform.position; NetworkingManager.RPC(typeof(BacktrackMono), "RPC_PerformBacktrack", new object[7] { player.playerID, snapshot.Value.position.x, snapshot.Value.position.y, snapshot.Value.position.z, position.x, position.y, position.z }); isReady = false; cooldownRemaining = GetCooldown(); } } } [UnboundRPC] public static void RPC_PerformBacktrack(int playerID, float px, float py, float pz, float ox, float oy, float oz) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player x) => x.playerID == playerID)); if ((Object)(object)val != (Object)null) { BacktrackMono component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)val.data != (Object)null && !val.data.dead) { component.PerformBacktrackLocal(new Vector3(px, py, pz)); component.SpawnGhostEffect(new Vector3(ox, oy, oz)); } } } private void PerformBacktrackLocal(Vector3 position) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)data == (Object)null) && !data.dead) { PlayerCollision component = ((Component)player).GetComponent(); if (component != null) { component.IgnoreWallForFrames(10); } Rigidbody2D component2 = ((Component)player).GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.velocity = Vector2.zero; component2.position = Vector2.op_Implicit(position); } ((Component)this).transform.position = position; history?.Clear(); } } private Snapshot? FindSnapshotAtTime(float targetTime) { if (history == null || history.Count == 0) { return null; } return history.OrderBy((Snapshot s) => Mathf.Abs(s.time - targetTime)).First(); } private float GetCooldown() { return Mathf.Max(10f - (float)(stackCount - 1) * 1f, 5f); } public void AddStack() { stackCount++; } public void RemoveStack() { stackCount = Mathf.Max(0, stackCount - 1); } private void UpdateUI() { if (!((Object)(object)cooldownUI == (Object)null)) { if (!isReady && cooldownRemaining > 0f) { cooldownUI.ShowCooldown(cooldownRemaining, GetCooldown()); } else { cooldownUI.Hide(); } } } private void CreateBacktrackPreview() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) backtrackPreview = new GameObject("BacktrackPreview"); previewSprite = backtrackPreview.AddComponent(); SpriteRenderer componentInChildren = ((Component)this).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { previewSprite.sprite = componentInChildren.sprite; } Color color = player.GetTeamColors().color; color.a = 0.35f; previewSprite.color = color; ((Renderer)previewSprite).material = ghostMaterial; ((Renderer)previewSprite).sortingLayerName = "MostFront"; ((Renderer)previewSprite).sortingOrder = 40; backtrackPreview.SetActive(false); } private void UpdateBacktrackPreview() { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //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_0120: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)backtrackPreview == (Object)null || (Object)(object)data == (Object)null) { return; } if (isReady && !data.dead && history != null && history.Count > 0) { float num = Time.time - 3f; float time = history.First.Value.time; float targetTime = Mathf.Max(num, time); Vector3? interpolatedPosition = GetInterpolatedPosition(targetTime); if (interpolatedPosition.HasValue && Vector3.Distance(((Component)this).transform.position, interpolatedPosition.Value) >= 0.5f) { backtrackPreview.SetActive(true); backtrackPreview.transform.position = Vector3.Lerp(backtrackPreview.transform.position, interpolatedPosition.Value, Time.deltaTime * 15f); backtrackPreview.transform.localScale = ((Component)this).transform.localScale; } else { backtrackPreview.SetActive(false); } } else { backtrackPreview.SetActive(false); } } private Vector3? GetInterpolatedPosition(float targetTime) { //IL_0052: 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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) if (history == null || history.Count < 2) { LinkedList linkedList = history; return (linkedList != null && linkedList.Count > 0) ? new Vector3?(history.First.Value.position) : null; } Snapshot? snapshot = null; Snapshot? snapshot2 = null; foreach (Snapshot item in history) { if (item.time <= targetTime) { snapshot = item; continue; } snapshot2 = item; break; } if (!snapshot.HasValue || !snapshot2.HasValue) { return snapshot.HasValue ? new Vector3?(snapshot.GetValueOrDefault().position) : snapshot2?.position; } float num = (targetTime - snapshot.Value.time) / (snapshot2.Value.time - snapshot.Value.time); return Vector3.Lerp(snapshot.Value.position, snapshot2.Value.position, num); } private void SpawnGhostEffect(Vector3 pos) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) Color color = player.GetTeamColors().color; GameObject val = new GameObject("Ghost"); GhostEffectRunner ghostEffectRunner = val.AddComponent(); ghostEffectRunner.Run(pos, ((Component)this).transform.localScale, ((Component)this).GetComponentInChildren(), ghostMaterial, color); } private void OnDestroy() { if ((Object)(object)block != (Object)null && blockAction != null) { block.BlockAction = (Action)Delegate.Remove(block.BlockAction, blockAction); } if ((Object)(object)data != (Object)null && (Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive)); } GameModeManager.RemoveHook("PointStart", (Func)OnPointStart); if ((Object)(object)cooldownUI != (Object)null) { Object.Destroy((Object)(object)((Component)cooldownUI).gameObject); } if ((Object)(object)backtrackPreview != (Object)null) { Object.Destroy((Object)(object)backtrackPreview); } } } public class GhostEffectRunner : MonoBehaviour { private SpriteRenderer sr; private float life = 0.8f; private float timer = 0f; private Color ghostColor; private Vector3 initialScale; public void Run(Vector3 pos, Vector3 scale, SpriteRenderer source, Material mat, Color color) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = pos; ((Component)this).transform.localScale = scale; initialScale = scale; ghostColor = color; sr = ((Component)this).gameObject.AddComponent(); if ((Object)(object)source != (Object)null) { sr.sprite = source.sprite; sr.flipX = source.flipX; } ((Renderer)sr).material = mat; sr.color = new Color(ghostColor.r, ghostColor.g, ghostColor.b, 0.6f); ((Renderer)sr).sortingLayerName = "MostFront"; ((Renderer)sr).sortingOrder = 40; } private void Update() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) timer += Time.deltaTime; float num = timer / life; if (num >= 1f) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } sr.color = new Color(ghostColor.r, ghostColor.g, ghostColor.b, Mathf.Lerp(0.6f, 0f, num)); ((Component)this).transform.localScale = initialScale * (1f + num * 0.3f); } } public class BulletTeleporterMono : MonoBehaviour { [CompilerGenerated] private sealed class d__22 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public BulletTeleporterMono <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__22(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ResetState(); 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 d__21 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public BulletTeleporterMono <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ResetState(); 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 static readonly Color teleportColor = new Color(0.3f, 0.7f, 1f, 1f); private static readonly Color teleportColorBright = new Color(0.5f, 0.85f, 1f, 1f); private Player player; private CharacterData data; private Block block; private Gun gun; private bool isOn = false; private Transform particleTransform; private ParticleSystem[] parts; private SoundEvent soundSpawn; private SoundEvent soundShoot; private Action blockAction; private Action shootAction; private ReversibleColorEffect colorEffect; private static Material ghostMaterial; public bool IsCharged { get; private set; } = false; private void Start() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Expected O, but got Unknown //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: 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_017a: Unknown result type (might be due to invalid IL or missing references) player = ((Component)this).GetComponent(); data = ((Component)this).GetComponent(); block = ((Component)this).GetComponent(); gun = data.weaponHandler.gun; GameObject val = (GameObject)Resources.Load("0 cards/Empower"); if ((Object)(object)val == (Object)null) { MrFuntikMod.LogError("[BulletTeleporter] Failed to load Empower prefab!"); return; } GameObject addObjectToPlayer = val.GetComponent().AddObjectToPlayer; if ((Object)(object)addObjectToPlayer == (Object)null) { MrFuntikMod.LogError("[BulletTeleporter] AddObjectToPlayer is null!"); return; } Empower component = addObjectToPlayer.GetComponent(); if ((Object)(object)component != (Object)null) { soundSpawn = component.soundEmpowerSpawn; GameObject addObjectToBullet = component.addObjectToBullet; if ((Object)(object)addObjectToBullet != (Object)null) { SoundUnityEventPlayer component2 = addObjectToBullet.GetComponent(); if ((Object)(object)component2 != (Object)null) { soundShoot = component2.soundStart; } } } if (addObjectToPlayer.transform.childCount > 0) { GameObject gameObject = ((Component)addObjectToPlayer.transform.GetChild(0)).gameObject; particleTransform = Object.Instantiate(gameObject, ((Component)this).transform).transform; parts = ((Component)particleTransform).GetComponentsInChildren(); ParticleSystem[] array = parts; foreach (ParticleSystem val2 in array) { if ((Object)(object)val2 != (Object)null) { MainModule main = val2.main; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(teleportColor); } } } else { MrFuntikMod.LogError("[BulletTeleporter] No particle child found in Empower prefab!"); parts = (ParticleSystem[])(object)new ParticleSystem[0]; } blockAction = OnBlock; block.BlockAction = (Action)Delegate.Combine(block.BlockAction, blockAction); shootAction = OnShoot; gun.ShootPojectileAction = (Action)Delegate.Combine(gun.ShootPojectileAction, shootAction); if ((Object)(object)ghostMaterial == (Object)null) { ghostMaterial = new Material(Shader.Find("Sprites/Default")); } GameModeManager.AddHook("PointStart", (Func)OnPointStart); GameModeManager.AddHook("BattleStart", (Func)OnBattleStart); if ((Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive)); } } private void OnRevive() { ResetState(); } [IteratorStateMachine(typeof(d__21))] private IEnumerator OnPointStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__21(0) { <>4__this = this, gm = gm }; } [IteratorStateMachine(typeof(d__22))] private IEnumerator OnBattleStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__22(0) { <>4__this = this, gm = gm }; } private void ResetState() { IsCharged = false; isOn = false; if (parts != null) { ParticleSystem[] array = parts; foreach (ParticleSystem val in array) { if ((Object)(object)val != (Object)null) { val.Stop(); } } } if ((Object)(object)colorEffect != (Object)null) { ((ColorEffect)colorEffect).Destroy(); colorEffect = null; } } private void OnBlock(BlockTriggerType triggerType) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 if ((int)triggerType != 3 && (int)triggerType != 4 && (int)triggerType != 2 && !((Object)(object)data == (Object)null) && !data.dead) { IsCharged = true; } } private void OnShoot(GameObject projectile) { if (IsCharged && !((Object)(object)projectile == (Object)null)) { IsCharged = false; TeleportBulletMarker teleportBulletMarker = projectile.GetComponent(); if ((Object)(object)teleportBulletMarker == (Object)null) { teleportBulletMarker = projectile.AddComponent(); } teleportBulletMarker.Initialize(player.playerID); if ((Object)(object)soundShoot != (Object)null) { SoundManager.Instance.PlayAtPosition(soundShoot, SoundManager.Instance.GetTransform(), ((Component)this).transform); } } } private void Update() { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null || (Object)(object)data == (Object)null) { return; } if (data.dead) { if (isOn) { ResetState(); } } else if (IsCharged) { if ((Object)(object)particleTransform != (Object)null && (Object)(object)gun != (Object)null) { particleTransform.position = ((Component)data.weaponHandler.gun).transform.position; particleTransform.rotation = ((Component)data.weaponHandler.gun).transform.rotation; } if (isOn) { return; } if ((Object)(object)soundSpawn != (Object)null) { SoundManager.Instance.PlayAtPosition(soundSpawn, SoundManager.Instance.GetTransform(), ((Component)this).transform); } if (parts != null) { for (int i = 0; i < parts.Length; i++) { if ((Object)(object)parts[i] != (Object)null) { parts[i].Play(); } } } if ((Object)(object)colorEffect == (Object)null) { colorEffect = ((Component)player).gameObject.AddComponent(); ((ColorEffect)colorEffect).SetColor(teleportColor); colorEffect.SetLivesToEffect(1); } isOn = true; } else { if (!isOn) { return; } if (parts != null) { for (int j = 0; j < parts.Length; j++) { if ((Object)(object)parts[j] != (Object)null) { parts[j].Stop(); } } } if ((Object)(object)colorEffect != (Object)null) { ((ColorEffect)colorEffect).Destroy(); colorEffect = null; } isOn = false; } } public void PerformTeleport(Vector3 targetPosition) { //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_0075: 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) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)data == (Object)null) && !data.dead) { Vector3 position = ((Component)this).transform.position; PlayerCollision component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { component.IgnoreWallForFrames(5); } Rigidbody2D component2 = ((Component)this).GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.velocity = Vector2.zero; } ((Component)this).transform.position = targetPosition; SpawnGhostEffect(position); SpawnArrivalEffect(targetPosition); } } private void SpawnGhostEffect(Vector3 position) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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) SpriteRenderer componentInChildren = ((Component)this).GetComponentInChildren(); if (!((Object)(object)componentInChildren == (Object)null)) { Color color = PlayerSkinBank.GetPlayerSkinColors(player.playerID).color; GameObject val = new GameObject("TeleportGhost"); TeleportGhostEffect teleportGhostEffect = val.AddComponent(); teleportGhostEffect.Run(position, ((Component)this).transform.localScale, componentInChildren, ghostMaterial, color); } } private void SpawnArrivalEffect(Vector3 position) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) Color color = PlayerSkinBank.GetPlayerSkinColors(player.playerID).color; GameObject val = new GameObject("TeleportWave"); val.transform.position = position; TeleportWaveEffect teleportWaveEffect = val.AddComponent(); teleportWaveEffect.color = color; } private void OnDestroy() { if ((Object)(object)block != (Object)null && blockAction != null) { block.BlockAction = (Action)Delegate.Remove(block.BlockAction, blockAction); } if ((Object)(object)gun != (Object)null && shootAction != null) { gun.ShootPojectileAction = (Action)Delegate.Remove(gun.ShootPojectileAction, shootAction); } GameModeManager.RemoveHook("PointStart", (Func)OnPointStart); GameModeManager.RemoveHook("BattleStart", (Func)OnBattleStart); if ((Object)(object)data != (Object)null && (Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive)); } if ((Object)(object)colorEffect != (Object)null) { ((ColorEffect)colorEffect).Destroy(); colorEffect = null; } if ((Object)(object)particleTransform != (Object)null) { Object.Destroy((Object)(object)((Component)particleTransform).gameObject); } } } public class TeleportBulletMarker : RayHitEffect { private int ownerPlayerID = -1; private bool hasTeleported = false; private ProjectileHit projectileHit; public void Initialize(int playerID) { ownerPlayerID = playerID; hasTeleported = false; } private void Start() { projectileHit = ((Component)this).GetComponent(); if ((Object)(object)projectileHit != (Object)null && projectileHit.effects != null) { projectileHit.effects.Insert(0, (RayHitEffect)(object)this); } ApplyVisuals(); } private void ApplyVisuals() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) Color val = default(Color); ((Color)(ref val))..ctor(0.3f, 0.7f, 1f, 1f); if ((Object)(object)projectileHit != (Object)null) { projectileHit.projectileColor = val; } SpriteRenderer[] componentsInChildren = ((Component)this).GetComponentsInChildren(); SpriteRenderer[] array = componentsInChildren; foreach (SpriteRenderer val2 in array) { if ((Object)(object)val2 != (Object)null) { val2.color = val; } } TrailRenderer[] componentsInChildren2 = ((Component)this).GetComponentsInChildren(); TrailRenderer[] array2 = componentsInChildren2; foreach (TrailRenderer val3 in array2) { if ((Object)(object)val3 != (Object)null) { val3.startColor = val; val3.endColor = new Color(val.r, val.g, val.b, 0f); } } SetTeamColor[] componentsInChildren3 = ((Component)this).GetComponentsInChildren(); SetTeamColor[] array3 = componentsInChildren3; foreach (SetTeamColor val4 in array3) { ((Behaviour)val4).enabled = false; } } public override HasToReturn DoHitEffect(HitInfo hit) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) if (hasTeleported) { return (HasToReturn)1; } if (hit == null) { return (HasToReturn)1; } if ((Object)(object)hit.transform != (Object)null && (Object)(object)((Component)hit.transform).GetComponent() != (Object)null) { return (HasToReturn)1; } Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player p) => p.playerID == ownerPlayerID)); if ((Object)(object)val == (Object)null) { return (HasToReturn)1; } if ((Object)(object)val.data == (Object)null || val.data.dead) { return (HasToReturn)1; } if (!val.data.view.IsMine) { return (HasToReturn)1; } hasTeleported = true; Vector3 val2 = Vector2.op_Implicit(hit.point) + Vector2.op_Implicit(hit.normal * 0.5f); NetworkingManager.RPC(typeof(TeleportBulletMarker), "RPC_DoTeleport", new object[4] { ownerPlayerID, val2.x, val2.y, val2.z }); return (HasToReturn)1; } [UnboundRPC] public static void RPC_DoTeleport(int playerID, float x, float y, float z) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player p) => p.playerID == playerID)); if (!((Object)(object)val == (Object)null)) { BulletTeleporterMono component = ((Component)val).GetComponent(); if (!((Object)(object)component == (Object)null)) { component.PerformTeleport(new Vector3(x, y, z)); } } } } public class TeleportGhostEffect : MonoBehaviour { private SpriteRenderer sr; private float life = 0.8f; private float timer = 0f; private Color ghostColor; private Vector3 initialScale; public void Run(Vector3 pos, Vector3 scale, SpriteRenderer source, Material mat, Color color) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = pos; ((Component)this).transform.localScale = scale; initialScale = scale; ghostColor = new Color(color.r, color.g, color.b, 0.6f); sr = ((Component)this).gameObject.AddComponent(); if ((Object)(object)source != (Object)null) { sr.sprite = source.sprite; sr.flipX = source.flipX; } ((Renderer)sr).material = mat; sr.color = ghostColor; ((Renderer)sr).sortingLayerName = "MostFront"; ((Renderer)sr).sortingOrder = 40; } private void Update() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) timer += Time.deltaTime; float num = timer / life; if (num >= 1f) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } sr.color = new Color(ghostColor.r, ghostColor.g, ghostColor.b, Mathf.Lerp(0.6f, 0f, num)); ((Component)this).transform.localScale = initialScale * (1f + num * 0.3f); } } public class TeleportWaveEffect : MonoBehaviour { public Color color = new Color(0.5f, 0.85f, 1f, 1f); private float life = 0.5f; private float timer = 0f; private float maxRadius = 3f; private LineRenderer line; private void Start() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) line = ((Component)this).gameObject.AddComponent(); line.useWorldSpace = false; line.loop = true; line.startWidth = 0.15f; line.endWidth = 0.15f; ((Renderer)line).material = new Material(Shader.Find("Sprites/Default")); line.startColor = color; line.endColor = color; ((Renderer)line).sortingLayerName = "MostFront"; ((Renderer)line).sortingOrder = 50; int num = 32; line.positionCount = num; for (int i = 0; i < num; i++) { float num2 = (float)i / (float)num * MathF.PI * 2f; line.SetPosition(i, new Vector3(Mathf.Cos(num2), Mathf.Sin(num2), 0f) * 0.1f); } } private void Update() { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) timer += Time.deltaTime; float num = timer / life; if (num >= 1f) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } float num2 = Mathf.Lerp(0.1f, maxRadius, num); int positionCount = line.positionCount; for (int i = 0; i < positionCount; i++) { float num3 = (float)i / (float)positionCount * MathF.PI * 2f; line.SetPosition(i, new Vector3(Mathf.Cos(num3), Mathf.Sin(num3), 0f) * num2); } Color val = default(Color); ((Color)(ref val))..ctor(color.r, color.g, color.b, Mathf.Lerp(1f, 0f, num)); line.startColor = val; line.endColor = val; line.startWidth = Mathf.Lerp(0.15f, 0.02f, num); line.endWidth = line.startWidth; } } public class DancerMono : MonoBehaviour { [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public DancerMono <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ResetForNewRound(); 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 float BASE_DODGE_CHANCE = 0.2f; private const float DODGE_CHANCE_PER_STACK = 0.2f; private const float MAX_DODGE_CHANCE = 0.6f; public int stackCount = 1; private Player player; private void Start() { player = ((Component)this).GetComponent(); GameModeManager.AddHook("PointStart", (Func)OnPointStart); } private void OnDestroy() { GameModeManager.RemoveHook("PointStart", (Func)OnPointStart); } [IteratorStateMachine(typeof(d__7))] private IEnumerator OnPointStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { <>4__this = this, gm = gm }; } public float GetDodgeChance() { float num = 0.2f + (float)(stackCount - 1) * 0.2f; return Mathf.Min(num, 0.6f); } public bool TryDodge() { if (!CanDodge()) { return false; } float value = Random.value; float dodgeChance = GetDodgeChance(); return value < dodgeChance; } public bool CanDodge() { if ((Object)(object)player == (Object)null) { return false; } if ((Object)(object)player.data == (Object)null) { return false; } if (player.data.health <= 0f) { return false; } if (player.data.dead) { return false; } if (!((Component)player).gameObject.activeInHierarchy) { return false; } return true; } public void ShowMissText() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_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_0044: Unknown result type (might be due to invalid IL or missing references) if (CanDodge()) { Vector3 position = ((Component)player).transform.position + new Vector3(Random.Range(-0.3f, 0.3f), 0.5f, 0f); TextEffectPool.Show(position); } } public void AddStack() { stackCount++; } public void RemoveStack() { stackCount--; } public void ResetForNewRound() { } } public class DeathDefyMono : MonoBehaviour { private const float BASE_REVIVE_CHANCE = 0.2f; private const float REVIVE_CHANCE_PER_STACK = 0.2f; private const float MAX_REVIVE_CHANCE = 0.6f; private const float RESPAWN_CHANCE_REDUCTION_FACTOR = 2f; public int stackCount = 1; private Player player = null; private CharacterData data = null; private int remainingDeathDefyRespawns = 0; private int totalAddedThisRound = 0; private float currentRoundChance = -1f; private bool hasRolledThisRound = false; private float lastPhoenixRollTime = -999f; private const float PHOENIX_ROLL_COOLDOWN = 2f; private static Dictionary lastTextTimeByPlayer = new Dictionary(); private static Dictionary lastRespawnTimeByPlayer = new Dictionary(); private const float COOLDOWN = 1f; public int OurRemainingCount => remainingDeathDefyRespawns; private void Start() { player = ((Component)this).GetComponent(); data = ((Component)this).GetComponent(); } private float GetBaseChance() { return Mathf.Min(0.2f + (float)(stackCount - 1) * 0.2f, 0.6f); } public float GetReviveChance() { if (currentRoundChance < 0f) { currentRoundChance = GetBaseChance(); } return currentRoundChance; } public bool TryRollReviveOnBattleStart() { if (hasRolledThisRound) { return false; } hasRolledThisRound = true; currentRoundChance = GetBaseChance(); return RollRevive("BattleStart"); } public bool TryProcessDeathDefyRespawn() { if (remainingDeathDefyRespawns <= 0) { return false; } remainingDeathDefyRespawns--; float time = Time.time; if (time - lastPhoenixRollTime < 2f) { return false; } lastPhoenixRollTime = time; currentRoundChance /= 2f; return RollRevive("PhoenixDeath"); } public bool HasDeathDefyRespawns() { return remainingDeathDefyRespawns > 0; } private bool RollRevive(string source) { float reviveChance = GetReviveChance(); int num = Random.Range(0, 100); int num2 = Mathf.RoundToInt(reviveChance * 100f); return num < num2; } public void AddTempRespawn() { if (!((Object)(object)data?.stats == (Object)null) && !((Object)(object)player == (Object)null)) { int playerID = player.playerID; float time = Time.time; if (!lastRespawnTimeByPlayer.TryGetValue(playerID, out var value) || !(time - value < 1f)) { lastRespawnTimeByPlayer[playerID] = time; CharacterStatModifiers stats = data.stats; stats.respawns++; CharacterStatModifiers stats2 = data.stats; stats2.remainingRespawns++; remainingDeathDefyRespawns++; totalAddedThisRound++; } } } public void ClearTempRespawns() { if (!((Object)(object)data?.stats == (Object)null)) { CharacterStatModifiers stats = data.stats; stats.respawns -= totalAddedThisRound; remainingDeathDefyRespawns = 0; totalAddedThisRound = 0; hasRolledThisRound = false; lastPhoenixRollTime = -999f; currentRoundChance = -1f; } } public void ShowReviveText() { //IL_0064: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null)) { int playerID = player.playerID; float time = Time.time; if (!lastTextTimeByPlayer.TryGetValue(playerID, out var value) || !(time - value < 1f)) { lastTextTimeByPlayer[playerID] = time; Vector3 position = ((Component)player).transform.position + new Vector3(0f, 0.5f, 0f); TextEffectPool.Show(position); } } } public void AddStack() { stackCount++; } public void RemoveStack() { stackCount--; } public static void ClearStaticData() { lastTextTimeByPlayer.Clear(); lastRespawnTimeByPlayer.Clear(); } } public class ExecutionerMono : MonoBehaviour { public struct PendingExecution { public int attackerPlayerID; public Vector3 position; public float timestamp; } private const float BASE_EXECUTE_CHANCE = 0.02f; private const float EXECUTE_CHANCE_PER_STACK = 0.02f; private const float MAX_EXECUTE_CHANCE = 0.5f; private const float PENDING_EXECUTION_TIMEOUT = 0.5f; public int stackCount = 1; private Player player = null; private static Dictionary pendingExecutions = new Dictionary(); private void Start() { player = ((Component)this).GetComponent(); } public float GetExecuteChance() { float num = 0.02f + (float)(stackCount - 1) * 0.02f; return Mathf.Min(num, 0.5f); } public bool TryExecute() { float value = Random.value; float executeChance = GetExecuteChance(); return value < executeChance; } public static void RegisterPendingExecution(int targetPlayerID, int attackerPlayerID, Vector3 position) { //IL_001f: 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) CleanupOldPendingExecutions(); pendingExecutions[targetPlayerID] = new PendingExecution { attackerPlayerID = attackerPlayerID, position = position, timestamp = Time.time }; } public static void OnPlayerDied(int deadPlayerID) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (pendingExecutions.TryGetValue(deadPlayerID, out var value)) { if (Time.time - value.timestamp > 0.5f) { pendingExecutions.Remove(deadPlayerID); return; } pendingExecutions.Remove(deadPlayerID); ShowExecuteTextStatic(value.attackerPlayerID, value.position); } } public static void ShowExecuteTextStatic(int attackerPlayerID, Vector3 position) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) Vector3 position2 = position + new Vector3(Random.Range(-0.3f, 0.3f), 0.5f, 0f); TextEffectPool.Show(position2); } public void ShowExecuteText(Vector3 position) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) ShowExecuteTextStatic(player?.playerID ?? (-1), position); } private static void CleanupOldPendingExecutions() { List list = new List(); foreach (KeyValuePair pendingExecution in pendingExecutions) { if (Time.time - pendingExecution.Value.timestamp > 1f) { list.Add(pendingExecution.Key); } } foreach (int item in list) { pendingExecutions.Remove(item); } } public void AddStack() { stackCount++; } public void RemoveStack() { stackCount--; } public static void ClearPendingExecutions() { pendingExecutions.Clear(); } private void OnDestroy() { } } public class ExecutionerBullet : MonoBehaviour { public bool isExecutionerShot = false; private bool visualsApplied = false; private GameObject bloodDropsObj = null; private GameObject deathGlowObj = null; private GameObject orbitsObj = null; private ParticleSystem bloodDrops = null; private ParticleSystem deathGlow = null; private ParticleSystem orbits = null; private static readonly Color bulletColor = new Color(1f, 0f, 0f, 1f); private static readonly Color bloodBright = new Color(1f, 0.1f, 0.1f, 1f); private static readonly Color bloodMid = new Color(0.8f, 0f, 0f, 1f); private static readonly Color bloodDark = new Color(0.3f, 0f, 0f, 1f); private static readonly Color glowColor = new Color(1f, 0.2f, 0.2f, 0.45f); private static readonly Color deathBlack = new Color(0.2f, 0f, 0f, 0.9f); private static Material cachedMaterial = null; private int frameCount = 0; private void Update() { if (isExecutionerShot && visualsApplied && frameCount < 5) { frameCount++; ForceApplyColor(); } } private static Material GetMaterial() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown if ((Object)(object)cachedMaterial == (Object)null) { cachedMaterial = new Material(Shader.Find("Sprites/Default")); } return cachedMaterial; } private void ForceApplyColor() { //IL_0047: 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_00c0: 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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) SetTeamColor[] componentsInChildren = ((Component)this).GetComponentsInChildren(); SetTeamColor[] array = componentsInChildren; foreach (SetTeamColor val in array) { ((Behaviour)val).enabled = false; } SpawnedAttack component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { component.SetColor(bulletColor); } SpriteRenderer[] componentsInChildren2 = ((Component)this).GetComponentsInChildren(); SpriteRenderer[] array2 = componentsInChildren2; foreach (SpriteRenderer val2 in array2) { if ((Object)(object)val2 != (Object)null) { val2.color = bulletColor; } } TrailRenderer[] componentsInChildren3 = ((Component)this).GetComponentsInChildren(); TrailRenderer[] array3 = componentsInChildren3; foreach (TrailRenderer val3 in array3) { if ((Object)(object)val3 != (Object)null) { val3.startColor = bulletColor; val3.endColor = new Color(bulletColor.r, bulletColor.g, bulletColor.b, 0f); } } ProjectileHit component2 = ((Component)this).GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.projectileColor = bulletColor; } } public void ApplyBloodyVisuals() { if (!visualsApplied) { visualsApplied = true; ForceApplyColor(); CreateDeathGlow(); CreateOrbits(); CreateBloodDrops(); } } private void CreateDeathGlow() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0033: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_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_00d1: 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_00f7: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown //IL_014c: 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_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Expected O, but got Unknown //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: 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_01bf: 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_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) deathGlowObj = new GameObject("DeathGlow"); deathGlowObj.transform.SetParent(((Component)this).transform); deathGlowObj.transform.localPosition = Vector3.zero; deathGlow = deathGlowObj.AddComponent(); MainModule main = deathGlow.main; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.1f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0.25f); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(glowColor); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)0; ((MainModule)(ref main)).maxParticles = 2; EmissionModule emission = deathGlow.emission; ((EmissionModule)(ref emission)).enabled = true; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(15f); ShapeModule shape = deathGlow.shape; ((ShapeModule)(ref shape)).enabled = false; SizeOverLifetimeModule sizeOverLifetime = deathGlow.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true; AnimationCurve val = new AnimationCurve(); val.AddKey(0f, 0.8f); val.AddKey(0.5f, 1f); val.AddKey(1f, 0.7f); ((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, val); ColorOverLifetimeModule colorOverLifetime = deathGlow.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val2 = new Gradient(); val2.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(glowColor, 0f), new GradientColorKey(glowColor, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(0.4f, 0f), new GradientAlphaKey(0.5f, 0.5f), new GradientAlphaKey(0.3f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val2); ParticleSystemRenderer component = deathGlowObj.GetComponent(); ((Renderer)component).sortingLayerName = "MostFront"; ((Renderer)component).sortingOrder = 98; ((Renderer)component).material = GetMaterial(); deathGlow.Play(); } private void CreateOrbits() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0033: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00db: 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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Expected O, but got Unknown //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: 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_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: 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_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) orbitsObj = new GameObject("DeathOrbits"); orbitsObj.transform.SetParent(((Component)this).transform); orbitsObj.transform.localPosition = Vector3.zero; orbits = orbitsObj.AddComponent(); MainModule main = orbits.main; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.3f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.03f, 0.05f); ((MainModule)(ref main)).startColor = new MinMaxGradient(bloodBright, deathBlack); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)0; ((MainModule)(ref main)).maxParticles = 6; EmissionModule emission = orbits.emission; ((EmissionModule)(ref emission)).enabled = true; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(12f); ShapeModule shape = orbits.shape; ((ShapeModule)(ref shape)).enabled = true; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)10; ((ShapeModule)(ref shape)).radius = 0.12f; ((ShapeModule)(ref shape)).radiusThickness = 0f; VelocityOverLifetimeModule velocityOverLifetime = orbits.velocityOverLifetime; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).orbitalZ = new MinMaxCurve(10f, 15f); ColorOverLifetimeModule colorOverLifetime = orbits.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val = new Gradient(); val.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(bloodBright, 0f), new GradientColorKey(deathBlack, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(0.6f, 0.5f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val); ParticleSystemRenderer component = orbitsObj.GetComponent(); ((Renderer)component).sortingLayerName = "MostFront"; ((Renderer)component).sortingOrder = 101; ((Renderer)component).material = GetMaterial(); orbits.Play(); } private void CreateBloodDrops() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0033: 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_005a: 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_007e: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Expected O, but got Unknown //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Expected O, but got Unknown //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0269: 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_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: 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_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) bloodDropsObj = new GameObject("BloodDrops"); bloodDropsObj.transform.SetParent(((Component)this).transform); bloodDropsObj.transform.localPosition = Vector3.zero; bloodDrops = bloodDropsObj.AddComponent(); MainModule main = bloodDrops.main; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(2f, 3.5f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.4f, 1.2f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.04f, 0.14f); ((MainModule)(ref main)).startColor = new MinMaxGradient(bloodBright, bloodMid); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).maxParticles = 455; ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(0.067f); EmissionModule emission = bloodDrops.emission; ((EmissionModule)(ref emission)).enabled = true; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(130f); ShapeModule shape = bloodDrops.shape; ((ShapeModule)(ref shape)).enabled = true; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).radius = 0.08f; VelocityOverLifetimeModule velocityOverLifetime = bloodDrops.velocityOverLifetime; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true; AnimationCurve val = new AnimationCurve(); val.AddKey(0f, 1f); val.AddKey(0.3f, 0.5f); val.AddKey(0.6f, 0.2f); val.AddKey(1f, 0f); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).speedModifier = new MinMaxCurve(1f, val); SizeOverLifetimeModule sizeOverLifetime = bloodDrops.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true; AnimationCurve val2 = new AnimationCurve(); val2.AddKey(0f, 0.8f); val2.AddKey(0.15f, 1f); val2.AddKey(0.5f, 0.6f); val2.AddKey(1f, 0f); ((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, val2); ColorOverLifetimeModule colorOverLifetime = bloodDrops.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val3 = new Gradient(); val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[4] { new GradientColorKey(bloodBright, 0f), new GradientColorKey(bloodMid, 0.3f), new GradientColorKey(bloodDark, 0.6f), new GradientColorKey(new Color(0.1f, 0f, 0f), 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[4] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(0.8f, 0.3f), new GradientAlphaKey(0.4f, 0.7f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val3); ParticleSystemRenderer component = bloodDropsObj.GetComponent(); ((Renderer)component).sortingLayerName = "MostFront"; ((Renderer)component).sortingOrder = 100; ((Renderer)component).material = GetMaterial(); bloodDrops.Play(); } private void OnDestroy() { DetachAndFade(deathGlowObj, deathGlow); DetachAndFade(orbitsObj, orbits); DetachAndFade(bloodDropsObj, bloodDrops); } private void DetachAndFade(GameObject obj, ParticleSystem ps) { //IL_0028: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)obj == (Object)null) && !((Object)(object)ps == (Object)null)) { obj.transform.SetParent((Transform)null); EmissionModule emission = ps.emission; ((EmissionModule)(ref emission)).enabled = false; MainModule main = ps.main; MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime; Object.Destroy((Object)(object)obj, ((MinMaxCurve)(ref startLifetime)).constantMax + 0.1f); } } } public class ExtendedGuardMono : MonoBehaviour { [CompilerGenerated] private sealed class d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public ExtendedGuardMono <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ResetState(); 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 float BASE_CRIT_CHANCE = 0.25f; private const float CRIT_CHANCE_PER_STACK = 0.15f; private const float MAX_CRIT_CHANCE = 0.75f; private const float CRIT_BLOCK_DURATION = 0.6f; public int stackCount = 1; private Player player; private Block block; private CharacterData data; private Action blockAction; private GameObject critVisual; private LineRenderer critRenderer; private float critVisualTimer = 0f; private const float CRIT_VISUAL_DURATION = 0.6f; private bool isCritBlock = false; private float critBlockTimer = 0f; private void Start() { player = ((Component)this).GetComponent(); block = ((Component)this).GetComponent(); data = ((Component)this).GetComponent(); blockAction = OnBlock; block.BlockAction = (Action)Delegate.Combine(block.BlockAction, blockAction); CreateCritVisual(); GameModeManager.AddHook("PointStart", (Func)OnPointStart); if ((Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive)); } } private void OnRevive() { ResetState(); } [IteratorStateMachine(typeof(d__17))] private IEnumerator OnPointStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0) { <>4__this = this, gm = gm }; } public float GetCritChance() { float num = 0.25f + (float)(stackCount - 1) * 0.15f; return Mathf.Min(num, 0.75f); } private void OnBlock(BlockTriggerType triggerType) { } public void ActivateCritBlockFromRPC() { isCritBlock = true; critBlockTimer = 0f; ShowCritVisual(); } private void Update() { if ((Object)(object)player == (Object)null || (Object)(object)data == (Object)null) { return; } if (data.dead) { HideCritVisual(); return; } if (isCritBlock) { critBlockTimer += TimeHandler.deltaTime; if (critBlockTimer < 0.6f) { block.sinceBlock = 0f; } else { isCritBlock = false; } } if (critVisualTimer > 0f) { critVisualTimer -= Time.deltaTime; UpdateCritVisual(); if (critVisualTimer <= 0f) { HideCritVisual(); } } } private void ResetState() { isCritBlock = false; critVisualTimer = 0f; critBlockTimer = 0f; HideCritVisual(); } private void CreateCritVisual() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) critVisual = new GameObject("ExtendedGuardCrit"); critVisual.transform.SetParent(((Component)this).transform); critVisual.transform.localPosition = Vector3.zero; critRenderer = critVisual.AddComponent(); critRenderer.useWorldSpace = false; critRenderer.loop = true; critRenderer.startWidth = 0.2f; critRenderer.endWidth = 0.2f; critRenderer.positionCount = 6; ((Renderer)critRenderer).material = new Material(Shader.Find("Sprites/Default")); ((Renderer)critRenderer).sortingLayerName = "MostFront"; ((Renderer)critRenderer).sortingOrder = 100; for (int i = 0; i < 6; i++) { float num = (float)i / 6f * MathF.PI * 2f - MathF.PI / 2f; critRenderer.SetPosition(i, new Vector3(Mathf.Cos(num), Mathf.Sin(num), 0f)); } critVisual.SetActive(false); } private void ShowCritVisual() { critVisualTimer = 0.6f; if ((Object)(object)critVisual != (Object)null) { critVisual.SetActive(true); } } private void UpdateCritVisual() { //IL_008c: 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_00e5: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)critRenderer == (Object)null)) { float num = critVisualTimer / 0.6f; float num2 = 1f + Mathf.Sin(Time.time * 15f) * 0.15f; float num3 = 1.5f * num2; for (int i = 0; i < 6; i++) { float num4 = (float)i / 6f * MathF.PI * 2f - MathF.PI / 2f; critRenderer.SetPosition(i, new Vector3(Mathf.Cos(num4) * num3, Mathf.Sin(num4) * num3, 0f)); } float num5 = Mathf.Lerp(0.3f, 1f, num); Color val = default(Color); ((Color)(ref val))..ctor(1f, 0.85f, 0.2f, num5); critRenderer.startColor = val; critRenderer.endColor = val; float num6 = Mathf.Lerp(0.1f, 0.25f, num); critRenderer.startWidth = num6; critRenderer.endWidth = num6; } } private void HideCritVisual() { if ((Object)(object)critVisual != (Object)null) { critVisual.SetActive(false); } } public void AddStack() { stackCount++; } public void RemoveStack() { stackCount--; } private void OnDestroy() { if ((Object)(object)block != (Object)null && blockAction != null) { block.BlockAction = (Action)Delegate.Remove(block.BlockAction, blockAction); } if ((Object)(object)data != (Object)null && (Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive)); } GameModeManager.RemoveHook("PointStart", (Func)OnPointStart); if ((Object)(object)critVisual != (Object)null) { Object.Destroy((Object)(object)critVisual); } } } public class GravitySurgeMono : MonoBehaviour { private const float COOLDOWN = 20f; private const float DURATION = 0.5f; private const float FORCE_MULTIPLIER = 10f; private const float BASE_PULL_FORCE = 125f; private const float MAX_DISTANCE = 50f; private const float MIN_DISTANCE = 2f; private Player player; private Block block; private PhotonView view; private FieldInfo velocityField; private FieldInfo simulatedField; private float cooldownTimer = 0f; private float activeTimer = 0f; private bool isActive = false; private bool isReady = true; private CooldownUI cooldownUI; private void Start() { //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) player = ((Component)this).GetComponent(); if ((Object)(object)player == (Object)null) { Object.Destroy((Object)(object)this); return; } block = player.data.block; view = player.data.view; if ((Object)(object)block != (Object)null) { block.BlockAction = (Action)Delegate.Combine(block.BlockAction, new Action(OnBlock)); } velocityField = typeof(PlayerVelocity).GetField("velocity", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); simulatedField = typeof(PlayerVelocity).GetField("simulated", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (view.IsMine || PhotonNetwork.OfflineMode) { cooldownUI = CooldownUI.Create(((Component)this).transform, 1f); cooldownUI.SetIcon("◉", (Color?)new Color(0.6f, 0.3f, 0.8f)); cooldownUI.SetColors(new Color(0.6f, 0.3f, 0.8f), new Color(0.8f, 0.3f, 0.3f), new Color(0.3f, 0.6f, 1f)); } } private void OnBlock(BlockTriggerType triggerType) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 if ((int)triggerType <= 0 && isReady && !player.data.dead && player.data.isPlaying && (!((Object)(object)view != (Object)null) || view.IsMine || PhotonNetwork.OfflineMode)) { ActivateSurge(); } } private void ActivateSurge() { isActive = true; isReady = false; activeTimer = 0.5f; cooldownTimer = 20f; NetworkingManager.RPC(typeof(GravitySurgeMono), "RPCA_ActivateSurge", new object[1] { player.playerID }); } [UnboundRPC] public static void RPCA_ActivateSurge(int playerID) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) Player val = PlayerManager.instance.players.Find((Player p) => p.playerID == playerID); if (!((Object)(object)val == (Object)null)) { GravitySurgeMono component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { component.isActive = true; component.activeTimer = 0.5f; } CreateSurgeVisual(((Component)val).transform.position); } } private static void CreateSurgeVisual(Vector3 position) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("GravitySurge_Visual"); val.transform.position = position; LineRenderer val2 = val.AddComponent(); val2.positionCount = 32; val2.loop = true; val2.startWidth = 0.3f; val2.endWidth = 0.3f; ((Renderer)val2).material = new Material(Shader.Find("Sprites/Default")); val2.startColor = new Color(0.6f, 0.3f, 0.8f, 0.8f); val2.endColor = new Color(0.4f, 0.2f, 0.6f, 0.5f); ((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0; float num = 2f; for (int i = 0; i < 32; i++) { float num2 = (float)i / 32f * MathF.PI * 2f; Vector3 val3 = position + new Vector3(Mathf.Cos(num2), Mathf.Sin(num2), 0f) * num; val2.SetPosition(i, val3); } GravitySurgeVisualExpand gravitySurgeVisualExpand = val.AddComponent(); gravitySurgeVisualExpand.duration = 0.5f; } private void FixedUpdate() { if (!((Object)(object)player == (Object)null) && !player.data.dead && player.data.isPlaying && isActive) { ApplyGravityToAllPlayers(); } } private void Update() { if ((Object)(object)player == (Object)null) { return; } if (PhotonNetwork.OfflineMode || ((Object)(object)view != (Object)null && view.IsMine)) { if (isActive) { activeTimer -= Time.deltaTime; if (activeTimer <= 0f) { NetworkingManager.RPC(typeof(GravitySurgeMono), "RPCA_DeactivateSurge", new object[1] { player.playerID }); } } if (!isReady) { cooldownTimer -= Time.deltaTime; if (cooldownTimer <= 0f) { isReady = true; cooldownTimer = 0f; } } } UpdateUI(); } [UnboundRPC] public static void RPCA_DeactivateSurge(int playerID) { Player val = PlayerManager.instance.players.Find((Player p) => p.playerID == playerID); if (!((Object)(object)val == (Object)null)) { GravitySurgeMono component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { component.isActive = false; component.activeTimer = 0f; } } } private void UpdateUI() { if (!((Object)(object)cooldownUI == (Object)null)) { if ((Object)(object)view != (Object)null && !view.IsMine && !PhotonNetwork.OfflineMode) { cooldownUI.Hide(); } else if (player.data.dead || !player.data.isPlaying) { cooldownUI.Hide(); } else if (isActive) { cooldownUI.ShowActive(activeTimer); } else if (!isReady) { cooldownUI.ShowCooldown(cooldownTimer, 20f); } else { cooldownUI.Hide(); } } } private void ApplyGravityToAllPlayers() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; float pullForce = 1250f; foreach (Player player in PlayerManager.instance.players) { if (player.playerID != this.player.playerID && IsValidTarget(player)) { PullPlayer(player, position, pullForce); } } } private bool IsValidTarget(Player target) { if ((Object)(object)target == (Object)null) { return false; } if ((Object)(object)target.data == (Object)null) { return false; } if (!target.data.isPlaying) { return false; } if (target.data.dead) { return false; } if (target.data.health <= 0f) { return false; } if ((Object)(object)target.data.playerVel != (Object)null && simulatedField != null && !(bool)simulatedField.GetValue(target.data.playerVel)) { return false; } return true; } private void PullPlayer(Player target, Vector3 myPosition, float pullForce) { //IL_001d: 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_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_005c: Unknown result type (might be due to invalid IL or missing references) //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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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) if ((Object)(object)((Component)target).gameObject.GetComponent() != (Object)null) { return; } Vector3 val = myPosition - ((Component)target).transform.position; float magnitude = ((Vector3)(ref val)).magnitude; if (!(magnitude > 50f) && !(magnitude < 2f)) { float num = pullForce * Time.fixedDeltaTime; Vector2 val2 = Vector2.op_Implicit(((Vector3)(ref val)).normalized * num); PlayerVelocity playerVel = target.data.playerVel; if ((Object)(object)playerVel != (Object)null && velocityField != null) { Vector2 val3 = (Vector2)velocityField.GetValue(playerVel); val3 += val2; velocityField.SetValue(playerVel, val3); } } } private void OnDestroy() { if ((Object)(object)block != (Object)null) { block.BlockAction = (Action)Delegate.Remove(block.BlockAction, new Action(OnBlock)); } if ((Object)(object)cooldownUI != (Object)null) { Object.Destroy((Object)(object)((Component)cooldownUI).gameObject); } } public void ResetState() { isActive = false; isReady = true; cooldownTimer = 0f; activeTimer = 0f; } } public class GravitySurgeVisualExpand : MonoBehaviour { public float duration = 1f; private float timer = 0f; private LineRenderer line; private Vector3 center; private float startRadius = 2f; private float endRadius = 50f; private void Start() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) line = ((Component)this).GetComponent(); center = ((Component)this).transform.position; } private void Update() { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) timer += Time.deltaTime; float num = timer / duration; if (num >= 1f) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } float num2 = Mathf.Lerp(startRadius, endRadius, num); float num3 = 1f - num; if ((Object)(object)line != (Object)null) { line.startColor = new Color(0.6f, 0.3f, 0.8f, 0.8f * num3); line.endColor = new Color(0.4f, 0.2f, 0.6f, 0.5f * num3); line.startWidth = 0.3f * (1f - num * 0.5f); line.endWidth = 0.3f * (1f - num * 0.5f); for (int i = 0; i < 32; i++) { float num4 = (float)i / 32f * MathF.PI * 2f; Vector3 val = center + new Vector3(Mathf.Cos(num4), Mathf.Sin(num4), 0f) * num2; line.SetPosition(i, val); } } } } public class AntiSlowMono : MonoBehaviour { private Player player = null; private CharacterStatModifiers stats = null; public void Start() { player = ((Component)this).GetComponent(); stats = ((Component)this).GetComponent(); } public void Update() { if ((Object)(object)stats != (Object)null && (stats.slow > 0f || stats.slowSlow > 0f || stats.fastSlow > 0f)) { stats.slow = 0f; stats.slowSlow = 0f; stats.fastSlow = 0f; } } private void OnDestroy() { } } public class AntiKnockbackMono : MonoBehaviour { private Player player = null; public void Start() { player = ((Component)this).GetComponent(); } private void OnDestroy() { } } public class AntiSilenceMono : MonoBehaviour { private Player player; public void Start() { player = ((Component)this).GetComponent(); } private void OnDestroy() { } } public class AntiStunMono : MonoBehaviour { private CharacterData data = null; public Player player = null; private Vector2 lastMoveSpeed; private float lastEffectTime; private readonly float effectCooldown = 0.15f; public void Start() { data = ((Component)this).GetComponentInParent(); player = ((Component)this).GetComponent(); } public void Update() { if (!((Object)(object)player == (Object)null) && !((Object)(object)player.data == (Object)null)) { if (player.data.isStunned) { CancelStun(); PlayResistEffect(); } else { TrySaveVelocity(); } } } private void CancelStun() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) StunHandler stunHandler = player.data.stunHandler; ((MonoBehaviour)stunHandler.codeAnim).StopAllCoroutines(); stunHandler.codeAnim.currentState = (AnimationUse)2; stunHandler.codeAnim.animations = (CodeAnimationInstance[])(object)new CodeAnimationInstance[0]; stunHandler.codeAnim.isPlaying = false; stunHandler.StopStun(); ExtensionMethods.SetFieldValue((object)player.data.playerVel, "velocity", (object)lastMoveSpeed); } private void PlayResistEffect() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) if (!(Time.time - lastEffectTime < effectCooldown)) { lastEffectTime = Time.time; Color color = default(Color); ((Color)(ref color))..ctor(0.3f, 0.8f, 1f, 1f); ShieldEffect.PlayShieldEffect(player, color); } } private void TrySaveVelocity() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) try { lastMoveSpeed = (Vector2)ExtensionMethods.GetFieldValue((object)player.data.playerVel, "velocity"); } catch { } } private void OnDestroy() { } } public class NothingMono : MonoBehaviour { private Player player; private readonly float updateDelay = 1f; private float lastCheckTime; public void Start() { player = ((Component)this).GetComponent(); lastCheckTime = Time.time; } public void Update() { if (Time.time < lastCheckTime + updateDelay) { return; } lastCheckTime = Time.time; if ((Object)(object)player == (Object)null) { player = ((Component)this).GetComponent(); if ((Object)(object)player == (Object)null) { return; } } if (NothingTimerManager.GetTimerCount(player) == 0) { Object.Destroy((Object)(object)this); return; } float oldestTimerElapsed = NothingTimerManager.GetOldestTimerElapsed(player); if (!(oldestTimerElapsed < 0f) && oldestTimerElapsed >= 600f) { NothingTimerManager.TransformOldestNothing(targetCardName: (!NothingTimerManager.HasItBecomesAll(player)) ? "Something" : "All", player: player); } } private void OnDestroy() { MrFuntikMod.Log("[NothingMono] Destroyed for player " + (((Object)(object)player != (Object)null) ? player.playerID.ToString() : "null")); } } public class PhoenixSurgeMono : MonoBehaviour { private Player player = null; private CharacterData data = null; private bool respawnAdded = false; private int totalAddedThisRound = 0; private bool pendingExplosion = false; private static Dictionary lastRespawnTimeByPlayer = new Dictionary(); private static Dictionary lastTextTimeByPlayer = new Dictionary(); private const float COOLDOWN = 1f; public int OurRemainingCount => respawnAdded ? 1 : 0; private void Start() { player = ((Component)this).GetComponent(); data = ((Component)this).GetComponent(); if ((Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive)); } } private void OnRevive() { if (pendingExplosion) { pendingExplosion = false; DoExplosion(); } } public void AddTempRespawn() { if (!((Object)(object)data?.stats == (Object)null) && !((Object)(object)player == (Object)null)) { int playerID = player.playerID; float time = Time.time; if (!lastRespawnTimeByPlayer.TryGetValue(playerID, out var value) || !(time - value < 1f)) { lastRespawnTimeByPlayer[playerID] = time; CharacterStatModifiers stats = data.stats; stats.respawns++; CharacterStatModifiers stats2 = data.stats; stats2.remainingRespawns++; respawnAdded = true; totalAddedThisRound++; } } } public bool TryConsumeRespawn() { if (!respawnAdded) { return false; } respawnAdded = false; return true; } public bool HasActiveRespawn() { return respawnAdded; } public void MarkPendingExplosion() { pendingExplosion = true; } public void ClearTempRespawn() { if (!((Object)(object)data?.stats == (Object)null)) { CharacterStatModifiers stats = data.stats; stats.respawns -= totalAddedThisRound; respawnAdded = false; totalAddedThisRound = 0; pendingExplosion = false; } } public void ShowSurgeText() { //IL_0064: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null)) { int playerID = player.playerID; float time = Time.time; if (!lastTextTimeByPlayer.TryGetValue(playerID, out var value) || !(time - value < 1f)) { lastTextTimeByPlayer[playerID] = time; Vector3 position = ((Component)player).transform.position + new Vector3(0f, 0.5f, 0f); TextEffectPool.Show(position); } } } public void DoExplosion() { //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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //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_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_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return; } GameObject kamikazeVisual = KamikazeMono.kamikazeVisual; if ((Object)(object)kamikazeVisual != (Object)null) { Object.Instantiate(kamikazeVisual, ((Component)player).transform.position, Quaternion.identity); } Vector2 val = Vector2.op_Implicit(((Component)player).transform.position); Player[] array = PlayerManager.instance.players.ToArray(); Player[] array2 = array; foreach (Player val2 in array2) { if (val2.teamID == player.teamID) { continue; } float num = Vector2.Distance(val, Vector2.op_Implicit(((Component)val2).transform.position)); bool canSee = PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)player).transform.position), val2).canSee; if (num < 18f && canSee) { HealthHandler component = ((Component)val2).GetComponent(); if ((Object)(object)component != (Object)null) { ((Damagable)component).TakeDamage(200f * Vector2.down, Vector2.op_Implicit(((Component)val2).transform.position), ((Component)player.data.weaponHandler).gameObject, player, true, false); Vector3 val3 = ((Component)val2).transform.position - Vector2.op_Implicit(val); component.TakeForce(Vector2.op_Implicit(((Vector3)(ref val3)).normalized * 12000f), (ForceMode2D)1, true, false, 0.8f); } } } } private void OnDestroy() { if ((Object)(object)data != (Object)null && (Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive)); } } public static void ClearStaticData() { lastRespawnTimeByPlayer.Clear(); lastTextTimeByPlayer.Clear(); } } public class GravityFieldMono : MonoBehaviour { private Player player = null; private float pullForce = 125f; private float maxDistance = 50f; private float minDistance = 2f; private float deadZone = 5f; private float weakZoneEnd = 10f; private int stacks = 1; private float bulletSearchInterval = 0.1f; private float lastBulletSearch; private ProjectileHit[] cachedBullets = null; private FieldInfo simulatedField = null; private FieldInfo velocityField = null; public void Start() { player = ((Component)this).GetComponent(); simulatedField = typeof(PlayerVelocity).GetField("simulated", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); velocityField = typeof(PlayerVelocity).GetField("velocity", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } public void FixedUpdate() { //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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null || !player.data.isPlaying || player.data.dead) { return; } Vector3 position = ((Component)this).transform.position; foreach (Player player in PlayerManager.instance.players) { if (player.playerID != this.player.playerID && IsValidTarget(player)) { PullPlayer(player, position); } } if (Time.time - lastBulletSearch > bulletSearchInterval) { cachedBullets = Object.FindObjectsOfType(); lastBulletSearch = Time.time; } if (cachedBullets == null) { return; } ProjectileHit[] array = cachedBullets; foreach (ProjectileHit val in array) { if (!((Object)(object)val == (Object)null)) { PullBullet(val, position); } } } private bool IsValidTarget(Player target) { if ((Object)(object)target == (Object)null) { return false; } if ((Object)(object)target.data == (Object)null) { return false; } if (!target.data.isPlaying) { return false; } if (target.data.dead) { return false; } if (target.data.health <= 0f) { return false; } if ((Object)(object)target.data.playerVel != (Object)null && simulatedField != null && !(bool)simulatedField.GetValue(target.data.playerVel)) { return false; } return true; } private void PullPlayer(Player target, Vector3 myPosition) { //IL_001d: 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_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_00f4: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)target).gameObject.GetComponent() != (Object)null) { return; } Vector3 val = myPosition - ((Component)target).transform.position; float magnitude = ((Vector3)(ref val)).magnitude; if (!(magnitude > maxDistance) && !(magnitude < minDistance)) { float num2; if (magnitude < deadZone) { float num = (magnitude - minDistance) / (deadZone - minDistance); num2 = pullForce * num * 0.1f; } else if (magnitude < weakZoneEnd) { float num3 = (magnitude - deadZone) / (weakZoneEnd - deadZone); num2 = pullForce * (0.1f + num3 * 0.2f); } else { num2 = pullForce * 0.3f; } num2 *= Time.fixedDeltaTime * (float)stacks; Vector2 val2 = Vector2.op_Implicit(((Vector3)(ref val)).normalized * num2); PlayerVelocity playerVel = target.data.playerVel; if ((Object)(object)playerVel != (Object)null && velocityField != null) { Vector2 val3 = (Vector2)velocityField.GetValue(playerVel); val3 += val2; velocityField.SetValue(playerVel, val3); } } } private void PullBullet(ProjectileHit bullet, Vector3 myPosition) { //IL_0001: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) Vector3 val = myPosition - ((Component)bullet).transform.position; float magnitude = ((Vector3)(ref val)).magnitude; if (!(magnitude > maxDistance) && !(magnitude < minDistance)) { float num = pullForce * 0.2f; Vector2 val2 = Vector2.op_Implicit(((Vector3)(ref val)).normalized * num); Rigidbody2D component = ((Component)bullet).GetComponent(); if ((Object)(object)component != (Object)null) { component.AddForce(val2, (ForceMode2D)0); } } } public void AddStack() { stacks++; } public bool RemoveStack() { stacks--; return stacks <= 0; } private void OnDestroy() { } } public class RollbackMono : MonoBehaviour { private struct HealthSnapshot { public float health; public float time; } [CompilerGenerated] private sealed class d__18 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public RollbackMono <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ResetState(); 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 float ROLLBACK_TIME = 3f; private const float BASE_COOLDOWN = 20f; private const float COOLDOWN_REDUCTION_PER_STACK = 3f; private const float RECORD_INTERVAL = 0.1f; private const float HISTORY_DURATION = 4f; public int stackCount = 1; private Player player; private Block block; private CharacterData data; private float cooldownRemaining = 0f; private bool isReady = true; private float lastRecordTime = 0f; private LinkedList healthHistory = new LinkedList(); private Action blockAction; private CooldownUI cooldownUI; private void Start() { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) player = ((Component)this).GetComponent(); block = ((Component)this).GetComponent(); data = ((Component)this).GetComponent(); blockAction = OnBlock; block.BlockAction = (Action)Delegate.Combine(block.BlockAction, blockAction); if (data.view.IsMine) { cooldownUI = CooldownUI.Create(((Component)this).transform, 1f); cooldownUI.SetIcon("+", (Color?)new Color(1f, 0.4f, 0.4f)); } GameModeManager.AddHook("PointStart", (Func)OnPointStart); if ((Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive)); } } private void OnRevive() { ResetState(); } [IteratorStateMachine(typeof(d__18))] private IEnumerator OnPointStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(0) { <>4__this = this, gm = gm }; } private void Update() { if ((Object)(object)player == (Object)null || (Object)(object)data == (Object)null) { return; } if (data.dead) { CooldownUI obj = cooldownUI; if (obj != null) { obj.Hide(); } return; } if (Time.time - lastRecordTime >= 0.1f) { RecordHealthSnapshot(); lastRecordTime = Time.time; } CleanOldHistory(); if (!isReady) { cooldownRemaining -= Time.deltaTime; if (cooldownRemaining <= 0f) { cooldownRemaining = 0f; isReady = true; } } if (data.view.IsMine) { UpdateUI(); } } private void ResetState() { healthHistory?.Clear(); cooldownRemaining = 0f; isReady = true; lastRecordTime = 0f; CooldownUI obj = cooldownUI; if (obj != null) { obj.Hide(); } } private void RecordHealthSnapshot() { if (!((Object)(object)data == (Object)null) && healthHistory != null) { healthHistory.AddLast(new HealthSnapshot { health = data.health, time = Time.time }); } } private void CleanOldHistory() { if (healthHistory != null) { float num = Time.time - 4f; while (healthHistory.Count > 0 && healthHistory.First.Value.time < num) { healthHistory.RemoveFirst(); } } } private void OnBlock(BlockTriggerType triggerType) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Invalid comparison between Unknown and I4 if (!((Object)(object)data == (Object)null) && !data.dead && isReady && data.view.IsMine && (int)triggerType <= 0 && healthHistory != null && healthHistory.Count != 0) { float num = Time.time - 3f; float time = healthHistory.First.Value.time; float targetTime = Mathf.Max(num, time); float? num2 = FindHealthAtTime(targetTime); if (num2.HasValue && !(num2.Value <= data.health)) { NetworkingManager.RPC(typeof(RollbackMono), "RPC_RestoreHealth", new object[2] { player.playerID, num2.Value }); isReady = false; cooldownRemaining = GetCooldown(); } } } [UnboundRPC] public static void RPC_RestoreHealth(int playerID, float health) { Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player x) => x.playerID == playerID)); if ((Object)(object)val != (Object)null) { RollbackMono component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)val.data != (Object)null && !val.data.dead) { component.RestoreHealthLocal(health); } } } private void RestoreHealthLocal(float health) { if (!((Object)(object)data == (Object)null) && !data.dead) { float maxHealth = data.maxHealth; data.health = Mathf.Min(health, maxHealth); SpawnHealEffect(); healthHistory?.Clear(); } } private float? FindHealthAtTime(float targetTime) { if (healthHistory == null || healthHistory.Count == 0) { return null; } HealthSnapshot? healthSnapshot = null; float num = float.MaxValue; foreach (HealthSnapshot item in healthHistory) { float num2 = Mathf.Abs(item.time - targetTime); if (num2 < num) { num = num2; healthSnapshot = item; } } return healthSnapshot?.health; } private float GetCooldown() { return Mathf.Max(20f - (float)(stackCount - 1) * 3f, 10f); } public void AddStack() { stackCount++; } public void RemoveStack() { stackCount = Mathf.Max(0, stackCount - 1); } private void UpdateUI() { if (!((Object)(object)cooldownUI == (Object)null)) { if (!isReady && cooldownRemaining > 0f) { cooldownUI.ShowCooldown(cooldownRemaining, GetCooldown()); } else { cooldownUI.Hide(); } } } private void SpawnHealEffect() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("HealEffect"); val.transform.position = ((Component)this).transform.position; HealEffectRunner healEffectRunner = val.AddComponent(); healEffectRunner.Run(((Component)this).transform); } private void OnDestroy() { if ((Object)(object)block != (Object)null && blockAction != null) { block.BlockAction = (Action)Delegate.Remove(block.BlockAction, blockAction); } if ((Object)(object)data != (Object)null && (Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive)); } GameModeManager.RemoveHook("PointStart", (Func)OnPointStart); if ((Object)(object)cooldownUI != (Object)null) { Object.Destroy((Object)(object)((Component)cooldownUI).gameObject); } } } public class HealEffectRunner : MonoBehaviour { private float life = 0.5f; private float timer = 0f; private Transform target; private SpriteRenderer sr; public void Run(Transform followTarget) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) target = followTarget; sr = ((Component)this).gameObject.AddComponent(); sr.sprite = CreateCircleSprite(); sr.color = new Color(0.3f, 1f, 0.5f, 0.6f); ((Renderer)sr).sortingLayerName = "MostFront"; ((Renderer)sr).sortingOrder = 50; ((Component)this).transform.localScale = Vector3.one * 0.5f; } private Sprite CreateCircleSprite() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) int num = 32; Texture2D val = new Texture2D(num, num); Color[] array = (Color[])(object)new Color[num * num]; float num2 = (float)num / 2f; float num3 = (float)num / 2f - 1f; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float num4 = Vector2.Distance(new Vector2((float)j, (float)i), new Vector2(num2, num2)); array[i * num + j] = ((num4 <= num3) ? Color.white : Color.clear); } } val.SetPixels(array); val.Apply(); return Sprite.Create(val, new Rect(0f, 0f, (float)num, (float)num), new Vector2(0.5f, 0.5f), (float)num); } private void Update() { //IL_006e: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) timer += Time.deltaTime; float num = timer / life; if (num >= 1f) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } if ((Object)(object)target != (Object)null) { ((Component)this).transform.position = target.position; } ((Component)this).transform.localScale = Vector3.one * (0.5f + num * 2f); sr.color = new Color(0.3f, 1f, 0.5f, Mathf.Lerp(0.6f, 0f, num)); } } public class SidePortalEffect : MonoBehaviour { [CompilerGenerated] private sealed class d__39 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public SidePortalEffect <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__39(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this._pointActive = false; <>4__this.ResetState(); 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 d__38 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public SidePortalEffect <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__38(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; s_boundsLastRefresh = -999f; <>4__this._pointActive = true; <>4__this.ResetState(); 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 float MIN_UPWARD_VEL = 12f; private const float WALL_CHECK_RADIUS = 0.6f; private const float WALL_CHECK_Y_OFFSET = 0.2f; private const float HP_COST_PERCENT = 0.1f; private const float WRAP_SPAM_GUARD = 0.05f; public Player ownerPlayer; private CharacterData data; private OutOfBoundsHandler oobHandler; private Block block; private PlayerCollision playerCollision; private int playerLayerMask; private float wrapCooldown = 0f; private bool _pointActive = false; private float _lastBlockedLog = -99f; private const float UNIT_RATIO = 1f / 27f; private static float s_xMin = -35.56f; private static float s_xMax = 35.56f; private static float s_yMin = -20f; private static float s_yMax = 20f; private static float s_boundsLastRefresh = -999f; private const float BOUNDS_CACHE_TTL = 0.2f; private static float s_loggedXMin = float.MinValue; private static bool s_mapsExtProbed = false; private static MethodInfo s_getCustomMap = null; private static PropertyInfo s_settingsProp = null; private static PropertyInfo s_mapSizeProp = null; private static MethodInfo s_getMinX = null; private static MethodInfo s_getMaxX = null; private static MethodInfo s_getMinY = null; private static MethodInfo s_getMaxY = null; private static Material s_ghostMat; private static void ProbeMapExtensions() { if (s_mapsExtProbed) { return; } s_mapsExtProbed = true; try { Assembly assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => a.GetName().Name == "MapsExtended"); if (assembly == null) { return; } s_getCustomMap = assembly.GetType("MapsExt.MapManagerExtensions")?.GetMethod("GetCurrentCustomMap", BindingFlags.Static | BindingFlags.Public); Type type = assembly.GetType("MapsExt.CustomMap"); Type type2 = assembly.GetType("MapsExt.CustomMapSettings"); s_settingsProp = type?.GetProperty("Settings", BindingFlags.Instance | BindingFlags.Public); s_mapSizeProp = type2?.GetProperty("MapSize", BindingFlags.Instance | BindingFlags.Public); Type[] types = assembly.GetTypes(); foreach (Type type3 in types) { if (!(type3.Name != "OutOfBoundsHandler_Patch")) { s_getMinX = type3.GetMethod("GetMinX", BindingFlags.Static | BindingFlags.NonPublic); s_getMaxX = type3.GetMethod("GetMaxX", BindingFlags.Static | BindingFlags.NonPublic); s_getMinY = type3.GetMethod("GetMinY", BindingFlags.Static | BindingFlags.NonPublic); s_getMaxY = type3.GetMethod("GetMaxY", BindingFlags.Static | BindingFlags.NonPublic); break; } } } catch { } } private static void RefreshBoundsCache() { //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) ProbeMapExtensions(); if (s_getMinX != null && s_getMaxX != null && s_getMinY != null && s_getMaxY != null) { try { s_xMin = (float)s_getMinX.Invoke(null, null); s_xMax = (float)s_getMaxX.Invoke(null, null); s_yMin = (float)s_getMinY.Invoke(null, null); s_yMax = (float)s_getMaxY.Invoke(null, null); s_boundsLastRefresh = Time.time; if (s_xMin != s_loggedXMin) { s_loggedXMin = s_xMin; MrFuntikMod.Log($"[SidePortal] BOUNDS (MapsExt): X[{s_xMin:F2}, {s_xMax:F2}] Y[{s_yMin:F2}, {s_yMax:F2}]"); } return; } catch { } } float num = 35.56f; float num2 = 20f; try { if (s_getCustomMap != null) { object obj2 = s_getCustomMap.Invoke(null, new object[1] { MapManager.instance }); if (obj2 != null && s_settingsProp != null && s_mapSizeProp != null) { object value = s_settingsProp.GetValue(obj2); if (value != null) { object value2 = s_mapSizeProp.GetValue(value); if (value2 is Vector2) { Vector2 val = (Vector2)value2; if (true) { num = val.x * (1f / 27f) / 2f; num2 = val.y * (1f / 27f) / 2f; } } } } } } catch { } s_xMin = 0f - num; s_xMax = num; s_yMin = 0f - num2; s_yMax = num2; s_boundsLastRefresh = Time.time; if (s_xMin != s_loggedXMin) { s_loggedXMin = s_xMin; MrFuntikMod.Log($"[SidePortal] BOUNDS (fallback): X[{s_xMin:F2}, {s_xMax:F2}] Y[{s_yMin:F2}, {s_yMax:F2}]"); } } private static void GetBounds(out float xMin, out float xMax, out float yMin, out float yMax) { if (Time.time - s_boundsLastRefresh > 0.2f) { RefreshBoundsCache(); } xMin = s_xMin; xMax = s_xMax; yMin = s_yMin; yMax = s_yMax; } private static Material GetGhostMat() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown if ((Object)(object)s_ghostMat == (Object)null) { s_ghostMat = new Material(Shader.Find("Sprites/Default")); } return s_ghostMat; } private void Start() { if ((Object)(object)ownerPlayer == (Object)null) { ownerPlayer = ((Component)this).GetComponent(); } data = ownerPlayer?.data; Player obj = ownerPlayer; block = ((obj != null) ? ((Component)obj).GetComponent() : null); Player obj2 = ownerPlayer; playerCollision = ((obj2 != null) ? ((Component)obj2).GetComponent() : null); playerLayerMask = (((Object)(object)ownerPlayer != (Object)null) ? (1 << ((Component)ownerPlayer).gameObject.layer) : 0); GameModeManager.AddHook("PointStart", (Func)OnPointStart); GameModeManager.AddHook("PointEnd", (Func)OnPointEnd); if ((Object)(object)data?.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive)); } } private void OnDestroy() { if ((Object)(object)oobHandler != (Object)null) { ((Behaviour)oobHandler).enabled = true; } GameModeManager.RemoveHook("PointStart", (Func)OnPointStart); GameModeManager.RemoveHook("PointEnd", (Func)OnPointEnd); if ((Object)(object)data?.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive)); } } private void FindAndDisableOobHandler() { if ((Object)(object)oobHandler != (Object)null || (Object)(object)ownerPlayer == (Object)null) { return; } OutOfBoundsHandler[] array = Object.FindObjectsOfType(); foreach (OutOfBoundsHandler val in array) { object value = Traverse.Create((object)val).Field("data").GetValue(); if (((CharacterData)(((value is CharacterData) ? value : null)?)).player?.playerID == ownerPlayer.playerID) { oobHandler = val; ((Behaviour)oobHandler).enabled = false; break; } } } [IteratorStateMachine(typeof(d__38))] private IEnumerator OnPointStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__38(0) { <>4__this = this, gm = gm }; } [IteratorStateMachine(typeof(d__39))] private IEnumerator OnPointEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__39(0) { <>4__this = this, gm = gm }; } private void OnRevive() { ResetState(); } private void ResetState() { wrapCooldown = 0f; } private void Update() { //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ownerPlayer == (Object)null || (Object)(object)data == (Object)null || data.dead || !data.isPlaying) { return; } if (!data.view.IsMine && !PhotonNetwork.OfflineMode) { if ((Object)(object)oobHandler != (Object)null && !((Behaviour)oobHandler).enabled) { ((Behaviour)oobHandler).enabled = true; } return; } if (!_pointActive && !PhotonNetwork.OfflineMode) { if ((Object)(object)oobHandler != (Object)null && !((Behaviour)oobHandler).enabled) { ((Behaviour)oobHandler).enabled = true; } return; } if ((Object)(object)oobHandler == (Object)null) { FindAndDisableOobHandler(); } wrapCooldown = Mathf.Max(0f, wrapCooldown - Time.deltaTime); Vector3 position = ((Component)ownerPlayer).transform.position; GetBounds(out var xMin, out var xMax, out var yMin, out var yMax); float num = position.x; float num2 = position.y; bool flag = false; bool flag2 = false; bool fromBottom = false; bool flag3 = false; if (position.x > xMax) { num = position.x - (xMax - xMin); flag = true; flag3 = true; } else if (position.x < xMin) { num = position.x + (xMax - xMin); flag = true; flag3 = true; } else if (position.y > yMax) { num2 = position.y - (yMax - yMin); flag2 = true; flag3 = true; } else if (position.y < yMin) { num2 = position.y + (yMax - yMin); fromBottom = true; flag3 = true; } if (!flag3) { if ((Object)(object)oobHandler != (Object)null && !((Behaviour)oobHandler).enabled) { ((Behaviour)oobHandler).enabled = true; } return; } if ((Object)(object)block != (Object)null && block.IsBlocking()) { if ((Object)(object)oobHandler != (Object)null && !((Behaviour)oobHandler).enabled) { ((Behaviour)oobHandler).enabled = true; } return; } float num3 = Mathf.Clamp(num, xMin + 0.2f, xMax - 0.2f); float num4 = (flag ? Mathf.Clamp(num2, yMin + 2f, yMax - 2f) : (flag2 ? (yMin + 2f) : (yMax - 2f))); int num5 = (((Object)(object)playerCollision != (Object)null) ? LayerMask.op_Implicit(playerCollision.mask) : LayerMask.GetMask(new string[1] { "Default" })) & ~playerLayerMask; Collider2D val = Physics2D.OverlapCircle(new Vector2(num3, num4 + 0.2f), 0.6f, num5); bool flag4 = (Object)(object)val != (Object)null; if (flag4 || wrapCooldown > 0f) { if (Time.time - _lastBlockedLog >= 1f) { _lastBlockedLog = Time.time; string text = (flag4 ? $"wall '{((Object)val).name}' (layer {((Component)val).gameObject.layer}) at check ({num3:F2}, {num4 + 0.2f:F2})" : $"cooldown {wrapCooldown:F3}s"); MrFuntikMod.Log($"[SidePortal] NO PORTAL: pos=({position.x:F2},{position.y:F2}) dest=({num3:F2},{num4:F2}) reason={text}"); } if ((Object)(object)oobHandler != (Object)null && !((Behaviour)oobHandler).enabled) { ((Behaviour)oobHandler).enabled = true; } } else { string text2 = ((!flag) ? (flag2 ? "top→bottom" : "bottom→top") : ((position.x > xMax) ? "right→left" : "left→right")); MrFuntikMod.Log($"[SidePortal] PORTAL: {text2} from ({position.x:F2},{position.y:F2}) → dest ({num:F2},{num2:F2}) bounds X[{xMin:F2},{xMax:F2}] Y[{yMin:F2},{yMax:F2}]"); if ((Object)(object)oobHandler != (Object)null) { ((Behaviour)oobHandler).enabled = false; } TryWrap(new Vector3(num, num2, position.z), flag, flag2, fromBottom); } } private void TryWrap(Vector3 destPos, bool isXAxis, bool fromTop, bool fromBottom) { //IL_0011: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_021e: 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_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0270: 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_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: 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_02bb: 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_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0201: 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) GetBounds(out var xMin, out var xMax, out var yMin, out var yMax); destPos.x = Mathf.Clamp(destPos.x, xMin + 0.2f, xMax - 0.2f); if (!isXAxis) { destPos.y = (fromTop ? (yMin + 2f) : (yMax - 2f)); } else { destPos.y = Mathf.Clamp(destPos.y, yMin + 2f, yMax - 2f); } int num = (((Object)(object)playerCollision != (Object)null) ? LayerMask.op_Implicit(playerCollision.mask) : LayerMask.GetMask(new string[1] { "Default" })) & ~playerLayerMask; Collider2D val = Physics2D.OverlapCircle(new Vector2(destPos.x, destPos.y + 0.2f), 0.6f, num); if ((Object)(object)val != (Object)null) { MrFuntikMod.Log($"[SidePortal] SAFETY ABORT: dest ({destPos.x:F2},{destPos.y + 0.2f:F2}) hit '{((Object)val).name}' (layer {((Component)val).gameObject.layer})"); if ((Object)(object)oobHandler != (Object)null) { ((Behaviour)oobHandler).enabled = true; } return; } wrapCooldown = 0.05f; Vector3 position = ((Component)ownerPlayer).transform.position; PlayerCollision obj = playerCollision; if (obj != null) { obj.IgnoreWallForFrames(2); } Rigidbody2D component = ((Component)ownerPlayer).GetComponent(); if ((Object)(object)component != (Object)null) { Vector2 velocity = component.velocity; if (fromTop && velocity.y < 12f) { velocity.y = 12f; } if (fromBottom) { velocity.y = 0f; } component.velocity = velocity; component.position = new Vector2(destPos.x, destPos.y); } ((Component)ownerPlayer).transform.position = destPos; MrFuntikMod.Log($"[SidePortal] RPC SENT: player {ownerPlayer.playerID} dest ({destPos.x:F2},{destPos.y:F2}) from ({position.x:F2},{position.y:F2})"); if (PhotonNetwork.OfflineMode) { RPCA_WrapPlayer(ownerPlayer.playerID, destPos.x, destPos.y, destPos.z, fromTop, fromBottom, position.x, position.y); return; } NetworkingManager.RPC(typeof(SidePortalEffect), "RPCA_WrapPlayer", new object[8] { ownerPlayer.playerID, destPos.x, destPos.y, destPos.z, fromTop, fromBottom, position.x, position.y }); } [UnboundRPC] public static void RPCA_WrapPlayer(int playerID, float x, float y, float z, bool fromTop, bool fromBottom, float oldX, float oldY) { //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: 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_01e9: 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_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_026a: 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_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player p) => p.playerID == playerID)); if ((Object)(object)val == (Object)null || val.data.dead) { return; } PlayerCollision component = ((Component)val).GetComponent(); if (component != null) { component.IgnoreWallForFrames(2); } Rigidbody2D component2 = ((Component)val).GetComponent(); if ((Object)(object)component2 != (Object)null) { Vector2 velocity = component2.velocity; if (fromTop && velocity.y < 12f) { velocity.y = 12f; } if (fromBottom) { velocity.y = 0f; } component2.velocity = velocity; component2.position = new Vector2(x, y); } ((Component)val).transform.position = new Vector3(x, y, z); MrFuntikMod.Log($"[SidePortal] RPC RECV: player {playerID} placed at ({x:F2},{y:F2})"); PlayerCollision component3 = ((Component)val).GetComponent(); int num = (((Object)(object)component3 != (Object)null) ? LayerMask.op_Implicit(component3.mask) : LayerMask.GetMask(new string[1] { "Default" })) & ~(1 << ((Component)val).gameObject.layer); CircleCollider2D component4 = ((Component)val).GetComponent(); float num2 = (((Object)(object)component4 != (Object)null) ? (component4.radius * ((Component)val).transform.localScale.x) : 0.5f); if ((Object)(object)Physics2D.OverlapCircle(new Vector2(x, y), num2 + 0.1f, num) != (Object)null) { Vector2 val2 = FindSafeExit(new Vector2(x, y), num2, num); MrFuntikMod.Log($"[SidePortal] WALL PENETRATION: inside wall at ({x:F2},{y:F2}) → safe exit ({val2.x:F2},{val2.y:F2})"); ((Component)val).transform.position = new Vector3(val2.x, val2.y, z); if ((Object)(object)component2 != (Object)null) { component2.position = val2; } } else { MrFuntikMod.Log($"[SidePortal] TELEPORT OK: player {playerID} at ({x:F2},{y:F2}) — no wall overlap"); } SpawnPortalGhost(val, new Vector3(oldX, oldY, z)); if (val.data.view.IsMine || PhotonNetwork.OfflineMode) { float num3 = val.data.maxHealth * 0.1f; MrFuntikMod.Log($"[SidePortal] HP COST: -{num3:F1} (before: {val.data.health:F1} / {val.data.maxHealth:F1})"); ((Damagable)val.data.healthHandler).CallTakeDamage(Vector2.up * num3, Vector2.op_Implicit(((Component)val).transform.position), (GameObject)null, (Player)null, true); } } private static Vector2 FindSafeExit(Vector2 insidePos, float radius, int wallMask) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_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_0077: 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_0080: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: 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) GetBounds(out var xMin, out var xMax, out var yMin, out var yMax); float num = 15f; Vector2[] obj = new Vector2[8] { Vector2.right, Vector2.left, Vector2.up, Vector2.down, default(Vector2), default(Vector2), default(Vector2), default(Vector2) }; Vector2 val = new Vector2(1f, 1f); obj[4] = ((Vector2)(ref val)).normalized; val = new Vector2(-1f, 1f); obj[5] = ((Vector2)(ref val)).normalized; val = new Vector2(1f, -1f); obj[6] = ((Vector2)(ref val)).normalized; val = new Vector2(-1f, -1f); obj[7] = ((Vector2)(ref val)).normalized; Vector2[] array = (Vector2[])(object)obj; float num2 = float.MaxValue; Vector2 result = insidePos; Vector2[] array2 = array; foreach (Vector2 val2 in array2) { RaycastHit2D val3 = Physics2D.Raycast(insidePos + val2 * num, -val2, num, wallMask); if ((Object)(object)((RaycastHit2D)(ref val3)).collider == (Object)null) { continue; } Vector2 val4 = ((RaycastHit2D)(ref val3)).point + val2 * (radius + 0.2f); if (!(val4.x < xMin) && !(val4.x > xMax) && !(val4.y < yMin) && !(val4.y > yMax) && !((Object)(object)Physics2D.OverlapCircle(val4, radius * 0.9f, wallMask) != (Object)null)) { float num3 = Vector2.Distance(insidePos, val4); if (num3 < num2) { num2 = num3; result = val4; } } } return result; } private static void SpawnPortalGhost(Player player, Vector3 atPosition) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("PortalGhost"); GhostEffectRunner ghostEffectRunner = val.AddComponent(); Color color = player.GetTeamColors().color; SpriteRenderer componentInChildren = ((Component)player).GetComponentInChildren(); ghostEffectRunner.Run(atPosition, ((Component)player).transform.localScale, componentInChildren, GetGhostMat(), color); } } public class SoulPiercerMono : MonoBehaviour { public int stackCount = 1; public void AddStack() { stackCount++; } public void RemoveStack() { stackCount--; } } public class ThornShieldMono : MonoBehaviour { [CompilerGenerated] private sealed class d__19 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public ThornShieldMono <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ResetState(); 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 float EFFECT_DURATION = 3f; private const float BASE_COOLDOWN = 13f; private const float REFLECT_PERCENT = 0.1f; public int stackCount = 1; private Player player; private Block block; private CharacterData data; private float cooldownRemaining = 0f; private float effectEndTime = 0f; private bool isReady = true; private Action blockAction; private CooldownUI cooldownUI; private GameObject shieldVisual; private LineRenderer shieldLine; private static bool isReflecting; public bool IsEffectActive => Time.time < effectEndTime; public float ReflectPercent => 0.1f * (float)stackCount; private void Start() { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) player = ((Component)this).GetComponent(); block = ((Component)this).GetComponent(); data = ((Component)this).GetComponent(); blockAction = OnBlock; block.BlockAction = (Action)Delegate.Combine(block.BlockAction, blockAction); if (data.view.IsMine) { cooldownUI = CooldownUI.Create(((Component)this).transform, 1f); cooldownUI.SetIcon("*", (Color?)new Color(0.4f, 0.8f, 0.4f)); } CreateShieldVisual(); GameModeManager.AddHook("PointStart", (Func)OnPointStart); if ((Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive)); } } private void OnRevive() { ResetState(); } [IteratorStateMachine(typeof(d__19))] private IEnumerator OnPointStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__19(0) { <>4__this = this, gm = gm }; } private void Update() { if ((Object)(object)player == (Object)null || (Object)(object)data == (Object)null) { HideAllUI(); HideShieldVisual(); return; } if (data.dead) { HideAllUI(); HideShieldVisual(); return; } if (!isReady) { cooldownRemaining -= Time.deltaTime; if (cooldownRemaining <= 0f) { cooldownRemaining = 0f; isReady = true; } } UpdateShieldVisual(); if (data.view.IsMine) { UpdateUI(); } } private void OnDisable() { HideAllUI(); HideShieldVisual(); } private void HideAllUI() { CooldownUI obj = cooldownUI; if (obj != null) { obj.Hide(); } } private void ResetState() { cooldownRemaining = 0f; effectEndTime = 0f; isReady = true; HideAllUI(); HideShieldVisual(); } private void OnBlock(BlockTriggerType triggerType) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Invalid comparison between Unknown and I4 if (!((Object)(object)data == (Object)null) && !data.dead && isReady && data.view.IsMine && (int)triggerType <= 0) { NetworkingManager.RPC(typeof(ThornShieldMono), "RPC_ActivateThornShield", new object[2] { player.playerID, 3f }); isReady = false; cooldownRemaining = 13f; } } [UnboundRPC] public static void RPC_ActivateThornShield(int playerID, float duration) { Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player x) => x.playerID == playerID)); if ((Object)(object)val != (Object)null) { ThornShieldMono component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)val.data != (Object)null && !val.data.dead) { component.ActivateEffect(duration); } } } private void ActivateEffect(float duration) { effectEndTime = Time.time + duration; } public void AddStack() { stackCount++; } public void RemoveStack() { stackCount = Mathf.Max(0, stackCount - 1); } public static void TryReflectDamage(Player victim, Vector2 damage, Player attacker) { //IL_00cf: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) if (isReflecting || (Object)(object)victim == (Object)null || (Object)(object)attacker == (Object)null || (Object)(object)victim == (Object)(object)attacker || !victim.data.view.IsMine) { return; } ThornShieldMono component = ((Component)victim).GetComponent(); if ((Object)(object)component == (Object)null || !component.IsEffectActive) { return; } float num = ((Vector2)(ref damage)).magnitude * component.ReflectPercent; if (num <= 0f) { return; } HealthHandler component2 = ((Component)attacker).GetComponent(); if ((Object)(object)component2 == (Object)null) { return; } isReflecting = true; try { Vector2 val = Vector2.down * num; ((Damagable)component2).CallTakeDamage(val, Vector2.op_Implicit(((Component)attacker).transform.position), ((Component)victim.data.weaponHandler.gun).gameObject, victim, true); NetworkingManager.RPC(typeof(ThornShieldMono), "RPC_ShowReflectEffect", new object[3] { attacker.playerID, ((Component)attacker).transform.position.x, ((Component)attacker).transform.position.y }); } finally { isReflecting = false; } } [UnboundRPC] public static void RPC_ShowReflectEffect(int attackerID, float posX, float posY) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player x) => x.playerID == attackerID)); if ((Object)(object)val != (Object)null) { SpawnReflectEffect(new Vector3(posX, posY, 0f), val); } } private static void SpawnReflectEffect(Vector3 position, Player target) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("ThornReflectEffect"); val.transform.position = position; ThornReflectEffectRunner thornReflectEffectRunner = val.AddComponent(); thornReflectEffectRunner.Initialize(target); } private void CreateShieldVisual() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) shieldVisual = new GameObject("ThornShieldVisual"); shieldVisual.transform.SetParent(((Component)this).transform); shieldVisual.transform.localPosition = Vector3.zero; shieldLine = shieldVisual.AddComponent(); shieldLine.useWorldSpace = false; shieldLine.loop = true; ((Renderer)shieldLine).sortingLayerName = "MostFront"; ((Renderer)shieldLine).sortingOrder = 50; ((Renderer)shieldLine).material = new Material(Shader.Find("Sprites/Default")); shieldLine.startWidth = 0.1f; shieldLine.endWidth = 0.1f; int num = 10; float num2 = 1.1f; float num3 = 0.25f; int num4 = 3; int positionCount = num * num4; shieldLine.positionCount = positionCount; for (int i = 0; i < num; i++) { float num5 = (float)i / (float)num * MathF.PI * 2f; float num6 = ((float)i + 0.5f) / (float)num * MathF.PI * 2f; float num7 = ((float)i + 1f) / (float)num * MathF.PI * 2f; int num8 = i * num4; shieldLine.SetPosition(num8, new Vector3(Mathf.Cos(num5) * num2, Mathf.Sin(num5) * num2, 0f)); shieldLine.SetPosition(num8 + 1, new Vector3(Mathf.Cos(num6) * (num2 + num3), Mathf.Sin(num6) * (num2 + num3), 0f)); shieldLine.SetPosition(num8 + 2, new Vector3(Mathf.Cos(num7) * num2, Mathf.Sin(num7) * num2, 0f)); } shieldVisual.SetActive(false); } private void UpdateShieldVisual() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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) if (!((Object)(object)shieldVisual == (Object)null)) { if (IsEffectActive && !data.dead) { shieldVisual.SetActive(true); Color color = player.GetTeamColors().color; float num = 0.8f + 0.2f * Mathf.Sin(Time.time * 5f); float num2 = effectEndTime - Time.time; float num3 = Mathf.Clamp01(num2 / 0.5f); Color val = default(Color); ((Color)(ref val))..ctor(color.r, color.g, color.b, 0.6f * num * num3); shieldLine.startColor = val; shieldLine.endColor = val; shieldVisual.transform.Rotate(Vector3.forward, Time.deltaTime * 30f); float x = ((Component)this).transform.localScale.x; shieldVisual.transform.localScale = Vector3.one * x * num; } else { shieldVisual.SetActive(false); } } } private void HideShieldVisual() { if ((Object)(object)shieldVisual != (Object)null) { shieldVisual.SetActive(false); } } private void UpdateUI() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)cooldownUI == (Object)null)) { if (IsEffectActive) { float num = effectEndTime - Time.time; cooldownUI.SetIcon("⬡", (Color?)new Color(0.2f, 1f, 0.2f)); cooldownUI.ShowCooldown(num, 3f); } else if (!isReady && cooldownRemaining > 0f) { cooldownUI.SetIcon("⬡", (Color?)new Color(0.5f, 0.5f, 0.5f)); cooldownUI.ShowCooldown(cooldownRemaining, 13f); } else { cooldownUI.Hide(); } } } private void OnDestroy() { if ((Object)(object)block != (Object)null && blockAction != null) { block.BlockAction = (Action)Delegate.Remove(block.BlockAction, blockAction); } if ((Object)(object)data != (Object)null && (Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive)); } GameModeManager.RemoveHook("PointStart", (Func)OnPointStart); if ((Object)(object)cooldownUI != (Object)null) { Object.Destroy((Object)(object)((Component)cooldownUI).gameObject); } if ((Object)(object)shieldVisual != (Object)null) { Object.Destroy((Object)(object)shieldVisual); } } } public class ThornReflectEffectRunner : MonoBehaviour { private float lifetime = 0.5f; private float timer = 0f; private List spikes = new List(); private Player target; private static Sprite cachedSpikeSprite; public void Initialize(Player targetPlayer) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_006d: 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_00ce: Unknown result type (might be due to invalid IL or missing references) target = targetPlayer; int num = 6; float num2 = 1.2f; for (int i = 0; i < num; i++) { float num3 = (float)i / (float)num * MathF.PI * 2f; GameObject val = new GameObject("Spike"); val.transform.SetParent(((Component)this).transform); float num4 = Mathf.Cos(num3) * num2; float num5 = Mathf.Sin(num3) * num2; val.transform.localPosition = new Vector3(num4, num5, 0f); val.transform.rotation = Quaternion.Euler(0f, 0f, num3 * 57.29578f - 90f); SpriteRenderer val2 = val.AddComponent(); val2.sprite = GetSpikeSprite(); val2.color = new Color(1f, 0.3f, 0.3f, 0.9f); ((Renderer)val2).sortingLayerName = "MostFront"; ((Renderer)val2).sortingOrder = 100; spikes.Add(val2); } } private Sprite GetSpikeSprite() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_00f2: 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) //IL_009a: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cachedSpikeSprite != (Object)null) { return cachedSpikeSprite; } Texture2D val = new Texture2D(16, 32); Color[] array = (Color[])(object)new Color[512]; for (int i = 0; i < 32; i++) { for (int j = 0; j < 16; j++) { float num = (float)i / 32f; float num2 = (1f - num) * 8f; float num3 = 8f; if (Mathf.Abs((float)j - num3) <= num2) { array[i * 16 + j] = Color.white; } else { array[i * 16 + j] = Color.clear; } } } val.SetPixels(array); val.Apply(); cachedSpikeSprite = Sprite.Create(val, new Rect(0f, 0f, 16f, 32f), new Vector2(0.5f, 0f), 32f); return cachedSpikeSprite; } private void Update() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) timer += Time.deltaTime; if (timer >= lifetime) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } if ((Object)(object)target != (Object)null && !target.data.dead) { ((Component)this).transform.position = ((Component)target).transform.position; } float num = timer / lifetime; foreach (SpriteRenderer spike in spikes) { if (!((Object)(object)spike == (Object)null)) { ((Component)spike).transform.localPosition = Vector3.Lerp(((Component)spike).transform.localPosition, Vector3.zero, Time.deltaTime * 8f); Color color = spike.color; color.a = Mathf.Lerp(0.9f, 0f, num); spike.color = color; ((Component)spike).transform.localScale = Vector3.one * Mathf.Lerp(1f, 0.3f, num); } } } } public static class TextEffectPool where T : FloatingTextEffect { private static readonly Stack pool = new Stack(); private static Transform poolContainer = null; private const int MAX_POOL_SIZE = 10; public static int PoolSize => pool.Count; private static void EnsureContainer() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown if ((Object)(object)poolContainer == (Object)null) { GameObject val = new GameObject("TextEffectPool_" + typeof(T).Name); Object.DontDestroyOnLoad((Object)(object)val); poolContainer = val.transform; } } public static T Get() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown EnsureContainer(); T val; if (pool.Count > 0) { val = pool.Pop(); } else { GameObject val2 = new GameObject(typeof(T).Name); Object.DontDestroyOnLoad((Object)(object)val2); val = val2.AddComponent(); } ((Component)val).gameObject.SetActive(true); return val; } public static void Return(T effect) { if (!((Object)(object)effect == (Object)null)) { ((Component)effect).gameObject.SetActive(false); if (pool.Count < 10) { ((Component)effect).transform.SetParent(poolContainer); pool.Push(effect); } else { Object.Destroy((Object)(object)((Component)effect).gameObject); } } } public static void Show(Vector3 position) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) T val = Get(); val.Activate(position); } } public abstract class FloatingTextEffect : MonoBehaviour { protected TextMesh textMesh = null; protected MeshRenderer meshRenderer = null; protected TextMesh[] outlineTexts = null; protected GameObject[] outlineObjects = null; protected float timer = 0f; protected Vector3 startPosition; protected bool isActive = false; protected const int OUTLINE_COUNT = 8; protected abstract string DisplayText { get; } protected abstract Color MainColor { get; } protected abstract Color OutlineColor { get; } protected virtual Color EndColor => new Color(MainColor.r * 0.5f, MainColor.g * 0.5f, MainColor.b * 0.5f, 0f); protected virtual float Lifetime => 1.4f; protected virtual float FloatSpeed => 2.5f; protected virtual int FontSize => 48; protected virtual float CharacterSize => 0.15f; protected virtual float OutlineOffset => 0.015f; protected virtual float InitialScale => 0.3f; protected virtual float MaxRotation => 15f; protected virtual void Awake() { CreateOutlines(); CreateMainText(); } private void CreateOutlines() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) outlineTexts = (TextMesh[])(object)new TextMesh[8]; outlineObjects = (GameObject[])(object)new GameObject[8]; for (int i = 0; i < 8; i++) { outlineObjects[i] = new GameObject($"Outline_{i}"); outlineObjects[i].transform.SetParent(((Component)this).transform); float num = (float)i / 8f * MathF.PI * 2f; outlineObjects[i].transform.localPosition = new Vector3(Mathf.Cos(num) * OutlineOffset, Mathf.Sin(num) * OutlineOffset, 0.01f); outlineTexts[i] = outlineObjects[i].AddComponent(); outlineTexts[i].text = DisplayText; outlineTexts[i].fontSize = FontSize; outlineTexts[i].characterSize = CharacterSize; outlineTexts[i].anchor = (TextAnchor)4; outlineTexts[i].alignment = (TextAlignment)1; outlineTexts[i].color = OutlineColor; outlineTexts[i].fontStyle = (FontStyle)1; MeshRenderer component = outlineObjects[i].GetComponent(); if ((Object)(object)component != (Object)null) { ((Renderer)component).sortingLayerName = "MostFront"; ((Renderer)component).sortingOrder = 499; } } } private void CreateMainText() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) textMesh = ((Component)this).gameObject.AddComponent(); textMesh.text = DisplayText; textMesh.fontSize = FontSize; textMesh.characterSize = CharacterSize; textMesh.anchor = (TextAnchor)4; textMesh.alignment = (TextAlignment)1; textMesh.color = MainColor; textMesh.fontStyle = (FontStyle)1; meshRenderer = ((Component)this).GetComponent(); if ((Object)(object)meshRenderer != (Object)null) { ((Renderer)meshRenderer).sortingLayerName = "MostFront"; ((Renderer)meshRenderer).sortingOrder = 500; } } public virtual void Activate(Vector3 position) { //IL_0007: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = position; startPosition = position; timer = 0f; isActive = true; textMesh.color = MainColor; for (int i = 0; i < 8; i++) { outlineTexts[i].color = OutlineColor; } ((Component)this).transform.localScale = Vector3.one * InitialScale; ((Component)this).transform.rotation = Quaternion.Euler(0f, 0f, Random.Range(0f - MaxRotation, MaxRotation)); ((Component)this).gameObject.SetActive(true); } protected virtual void Update() { if (isActive) { timer += Time.deltaTime; float num = timer / Lifetime; if (num >= 1f) { Deactivate(); return; } UpdatePosition(num); UpdateScale(num); UpdateAlpha(num); ApplyExtraEffects(num); } } protected virtual void UpdatePosition(float progress) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) float num = 1f - Mathf.Pow(1f - progress, 2f); float num2 = num * FloatSpeed; ((Component)this).transform.position = startPosition + new Vector3(0f, num2, 0f); } protected virtual void UpdateScale(float progress) { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) float num2; if (progress < 0.1f) { float num = progress / 0.1f; num2 = InitialScale + num * (1.5f - InitialScale); } else if (progress < 0.2f) { float num3 = (progress - 0.1f) / 0.1f; num2 = 1.5f - num3 * 0.3f; } else if (progress < 0.7f) { float num4 = Mathf.Sin((progress - 0.2f) * 20f) * 0.05f; num2 = 1.2f + num4; } else { float num5 = (progress - 0.7f) / 0.3f; num2 = 1.2f - num5 * 0.4f; } ((Component)this).transform.localScale = Vector3.one * num2; } protected virtual void UpdateAlpha(float progress) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0068: 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_008b: Unknown result type (might be due to invalid IL or missing references) float num; if (progress < 0.6f) { num = 1f; } else { num = 1f - (progress - 0.6f) / 0.4f; num = Mathf.Pow(num, 0.5f); } Color color = Color.Lerp(MainColor, EndColor, progress * 0.7f); color.a = num; textMesh.color = color; Color outlineColor = OutlineColor; outlineColor.a = num * 0.8f; for (int i = 0; i < 8; i++) { outlineTexts[i].color = outlineColor; } } protected virtual void ApplyExtraEffects(float progress) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Sin(timer * 12f) * 0.08f * (1f - progress); Transform transform = ((Component)this).transform; transform.position += new Vector3(num, 0f, 0f); } protected virtual void Deactivate() { isActive = false; ((Component)this).gameObject.SetActive(false); } } public class MissTextEffect : FloatingTextEffect { protected override string DisplayText => "MISS!"; protected override Color MainColor => new Color(1f, 1f, 0.2f, 1f); protected override Color OutlineColor => new Color(0.1f, 0.1f, 0.1f, 1f); protected override Color EndColor => new Color(1f, 0.5f, 0f, 0f); protected override void ApplyExtraEffects(float progress) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) base.ApplyExtraEffects(progress); float num = Mathf.Sin(timer * 8f) * 5f * (1f - progress); ((Component)this).transform.rotation = Quaternion.Euler(0f, 0f, num + Random.Range(-0.5f, 0.5f)); } } public class ExecuteTextEffect : FloatingTextEffect { protected override string DisplayText => "EXECUTED!"; protected override Color MainColor => new Color(1f, 0.1f, 0.1f, 1f); protected override Color OutlineColor => new Color(0.2f, 0f, 0f, 1f); protected override Color EndColor => new Color(0.5f, 0f, 0f, 0f); protected override float Lifetime => 1.6f; protected override float FloatSpeed => 2f; protected override int FontSize => 52; protected override float OutlineOffset => 0.02f; protected override float InitialScale => 0.2f; protected override float MaxRotation => 10f; protected override void UpdateScale(float progress) { //IL_0093: 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) float num2; if (progress < 0.08f) { float num = progress / 0.08f; num2 = 0.2f + num * 1.6f; } else if (progress < 0.15f) { float num3 = (progress - 0.08f) / 0.07f; num2 = 1.8f - num3 * 0.5f; } else if (progress < 0.65f) { num2 = 1.3f; } else { float num4 = (progress - 0.65f) / 0.35f; num2 = 1.3f - num4 * 0.5f; } ((Component)this).transform.localScale = Vector3.one * num2; } protected override void ApplyExtraEffects(float progress) { //IL_0029: 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) if (progress < 0.2f) { float num = (1f - progress / 0.2f) * 0.1f; Transform transform = ((Component)this).transform; transform.position += new Vector3(Random.Range(0f - num, num), Random.Range(0f - num, num), 0f); } } } public class ReviveTextEffect : FloatingTextEffect { protected override string DisplayText => "I'll be back!"; protected override Color MainColor => new Color(1f, 1f, 1f, 1f); protected override Color OutlineColor => new Color(0.7f, 0.85f, 1f, 1f); protected override void ApplyExtraEffects(float progress) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Sin(timer * 15f) * 0.1f + 0.9f; Color color = textMesh.color; color.r *= num; color.g *= num; color.b *= num; textMesh.color = color; float num2 = Mathf.Sin(timer * 12f) * 0.08f * (1f - progress); Transform transform = ((Component)this).transform; transform.position += new Vector3(num2, 0f, 0f); } } public class PhoenixSurgeTextEffect : FloatingTextEffect { protected override string DisplayText => "Run it back. Boom"; protected override Color MainColor => new Color(1f, 0.2f, 0.1f, 1f); protected override Color OutlineColor => new Color(0.4f, 0.05f, 0f, 1f); protected override Color EndColor => new Color(1f, 0.5f, 0f, 0f); protected override float Lifetime => 1.6f; protected override int FontSize => 44; protected override void ApplyExtraEffects(float progress) { //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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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) if (progress < 0.15f) { float num = (1f - progress / 0.15f) * 0.12f; Transform transform = ((Component)this).transform; transform.position += new Vector3(Random.Range(0f - num, num), Random.Range(0f - num, num), 0f); } else { float num2 = Mathf.Sin(timer * 20f) * 0.15f + 0.85f; Color color = textMesh.color; color.r *= num2; textMesh.color = color; } } } public class PlanetRegenMono : MonoBehaviour { private CharacterData data = null; private int stacks = 1; private float timer = 0f; private void Awake() { data = ((Component)this).GetComponentInParent(); } public void AddStack() { stacks++; } public bool RemoveStack() { stacks--; return stacks <= 0; } private void Update() { if (!((Object)(object)data == (Object)null)) { timer += Time.deltaTime; if (timer >= 1f) { timer = 0f; float maxHealth = data.maxHealth; float num = maxHealth * 0.01f * (float)stacks; data.healthHandler.Heal(num); } } } } public class ShieldEffect : MonoBehaviour { private static Dictionary activeShields = new Dictionary(); public static void PlayShieldEffect(Player player, Color color, float duration = 1f, float targetRadius = 0.8f) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null)) { if (activeShields.TryGetValue(player.playerID, out GameObject value) && (Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } GameObject val = new GameObject("ShieldEffect"); val.transform.SetParent(((Component)player).transform); val.transform.localPosition = Vector3.zero; LineRenderer val2 = val.AddComponent(); val2.useWorldSpace = false; val2.loop = true; val2.startWidth = 0.1f; val2.endWidth = 0.1f; val2.positionCount = 36; ((Renderer)val2).material = new Material(Shader.Find("Sprites/Default")); val2.startColor = color; val2.endColor = color; ((Renderer)val2).sortingLayerName = "UI"; ((Renderer)val2).sortingOrder = 10000; for (int i = 0; i < 36; i++) { float num = (float)i / 36f * MathF.PI * 2f; val2.SetPosition(i, new Vector3(Mathf.Cos(num), Mathf.Sin(num), 0f)); } ShieldAnimator shieldAnimator = val.AddComponent(); shieldAnimator.Init(val2, color, duration, targetRadius, player.playerID); activeShields[player.playerID] = val; } } public static void RemoveShield(int playerID) { activeShields.Remove(playerID); } } public class ShieldAnimator : MonoBehaviour { private LineRenderer line; private Color baseColor; private float duration; private float targetRadius; private int playerID; private float startTime; public void Init(LineRenderer lr, Color color, float dur, float radius, int pid) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) line = lr; baseColor = color; duration = dur; targetRadius = radius; playerID = pid; startTime = Time.time; ((Component)this).transform.localScale = Vector3.zero; } private void Update() { //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_016b: Unknown result type (might be due to invalid IL or missing references) float num = Time.time - startTime; float num2 = num / duration; if (num2 >= 1f) { ShieldEffect.RemoveShield(playerID); Object.Destroy((Object)(object)((Component)this).gameObject); return; } float num4; float num5; if (num2 < 0.2f) { float num3 = num2 / 0.2f; num4 = targetRadius * (1f - Mathf.Pow(1f - num3, 2f)); num5 = num3; } else if (num2 < 0.7f) { float num6 = (num2 - 0.2f) / 0.5f; float num7 = 1f + Mathf.Sin(num6 * MathF.PI * 4f) * 0.05f; num4 = targetRadius * num7; num5 = 1f; } else { float num8 = (num2 - 0.7f) / 0.3f; num4 = targetRadius * (1f + num8 * 0.1f); num5 = 1f - num8; } ((Component)this).transform.localScale = Vector3.one * num4; ((Component)this).transform.Rotate(0f, 0f, Time.deltaTime * 45f); Color val = baseColor; val.a = num5 * 0.85f; line.startColor = val; line.endColor = val; } } public static class NothingTimerManager { private class PlayerTimerData { public List timerStartTimes = new List(); public bool hasItBecomesAll = false; public bool isTransforming = false; public bool isInReplaceOperation = false; } [CompilerGenerated] private sealed class d__25 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Player player; public CardInfo targetCard; public int count; private int 5__1; private CardInfo 5__2; private List.Enumerator <>s__3; private CardInfo 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__25(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>s__3 = default(List.Enumerator); 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; SetIsInReplaceOperation(player, value: true); 5__1 = 0; break; case 1: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; case 2: <>1__state = -1; 5__2 = null; 5__1++; break; } if (5__1 < count) { 5__2 = null; <>s__3 = player.data.currentCards.GetEnumerator(); try { while (<>s__3.MoveNext()) { 5__4 = <>s__3.Current; if (5__4.cardName == "Nothing" || 5__4.cardName.EndsWith("Nothing")) { 5__2 = 5__4; break; } 5__4 = null; } } finally { ((IDisposable)<>s__3).Dispose(); } <>s__3 = default(List.Enumerator); if (!((Object)(object)5__2 == (Object)null)) { <>2__current = Cards.instance.ReplaceCard(player, 5__2, targetCard, "", 0f, 0f, (SelectionType)1, true); <>1__state = 1; return true; } } SetIsInReplaceOperation(player, value: false); CardBarUtils.instance.ShowAtEndOfPhase(player, targetCard); 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 d__29 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Player player; public CardInfo nothingCard; public CardInfo targetCard; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__29(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; SetIsInReplaceOperation(player, value: true); <>2__current = Cards.instance.ReplaceCard(player, nothingCard, targetCard, "", 0f, 0f, (SelectionType)2, true); <>1__state = 1; return true; case 1: <>1__state = -1; SetIsInReplaceOperation(player, value: false); CardBarUtils.instance.ShowAtEndOfPhase(player, targetCard); 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 d__21 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Player player; public CardInfo nothingCard; public CardInfo targetCard; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; SetIsInReplaceOperation(player, value: true); <>2__current = Cards.instance.ReplaceCard(player, nothingCard, targetCard, "", 0f, 0f, (SelectionType)1, true); <>1__state = 1; return true; case 1: <>1__state = -1; SetIsInReplaceOperation(player, value: false); SetIsTransforming(player, value: false); CardBarUtils.instance.ShowAtEndOfPhase(player, targetCard); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public const float TRANSFORMATION_TIME = 600f; private static Dictionary playerData = new Dictionary(); private static PlayerTimerData GetOrCreatePlayerData(int playerID) { if (!playerData.ContainsKey(playerID)) { playerData[playerID] = new PlayerTimerData(); } return playerData[playerID]; } public static bool IsNewNothingCard(Player player, int currentNothingCount) { PlayerTimerData orCreatePlayerData = GetOrCreatePlayerData(player.playerID); return currentNothingCount > orCreatePlayerData.timerStartTimes.Count; } public static void RegisterTimer(Player player) { PlayerTimerData orCreatePlayerData = GetOrCreatePlayerData(player.playerID); orCreatePlayerData.timerStartTimes.Add(Time.time); } public static float GetOldestTimerElapsed(Player player) { PlayerTimerData orCreatePlayerData = GetOrCreatePlayerData(player.playerID); if (orCreatePlayerData.timerStartTimes.Count == 0) { return -1f; } return Time.time - orCreatePlayerData.timerStartTimes[0]; } public static void RemoveOldestTimer(Player player) { PlayerTimerData orCreatePlayerData = GetOrCreatePlayerData(player.playerID); if (orCreatePlayerData.timerStartTimes.Count > 0) { orCreatePlayerData.timerStartTimes.RemoveAt(0); } } public static int GetTimerCount(Player player) { PlayerTimerData orCreatePlayerData = GetOrCreatePlayerData(player.playerID); return orCreatePlayerData.timerStartTimes.Count; } public static bool HasItBecomesAll(Player player) { PlayerTimerData orCreatePlayerData = GetOrCreatePlayerData(player.playerID); return orCreatePlayerData.hasItBecomesAll; } public static void SetHasItBecomesAll(Player player, bool value) { PlayerTimerData orCreatePlayerData = GetOrCreatePlayerData(player.playerID); orCreatePlayerData.hasItBecomesAll = value; } public static bool IsTransforming(Player player) { PlayerTimerData orCreatePlayerData = GetOrCreatePlayerData(player.playerID); return orCreatePlayerData.isTransforming; } public static void SetIsTransforming(Player player, bool value) { PlayerTimerData orCreatePlayerData = GetOrCreatePlayerData(player.playerID); orCreatePlayerData.isTransforming = value; } public static bool IsInReplaceOperation(Player player) { PlayerTimerData orCreatePlayerData = GetOrCreatePlayerData(player.playerID); return orCreatePlayerData.isInReplaceOperation; } public static void SetIsInReplaceOperation(Player player, bool value) { PlayerTimerData orCreatePlayerData = GetOrCreatePlayerData(player.playerID); orCreatePlayerData.isInReplaceOperation = value; } public static void ClearAllTimers(Player player) { PlayerTimerData orCreatePlayerData = GetOrCreatePlayerData(player.playerID); int count = orCreatePlayerData.timerStartTimes.Count; orCreatePlayerData.timerStartTimes.Clear(); orCreatePlayerData.isTransforming = false; } public static void ClearAll() { playerData.Clear(); } private static CardInfo FindHiddenCard(string cardName) { string cardName2 = cardName; if (MrFuntikMod.hiddenCards == null || MrFuntikMod.hiddenCards.Count == 0) { return null; } CardInfo val = MrFuntikMod.hiddenCards.Find((CardInfo c) => c.cardName == cardName2); if ((Object)(object)val != (Object)null) { return val; } val = MrFuntikMod.hiddenCards.Find((CardInfo c) => c.cardName.EndsWith(cardName2)); if ((Object)(object)val != (Object)null) { return val; } return null; } public static void TransformOldestNothing(Player player, string targetCardName) { if (IsTransforming(player)) { return; } bool flag = PhotonNetwork.OfflineMode; if (!flag && (Object)(object)player.data.view != (Object)null) { flag = player.data.view.IsMine; } if (flag) { SetIsTransforming(player, value: true); if (PhotonNetwork.OfflineMode) { TransformOldestNothingInternal(player.playerID, targetCardName); return; } NetworkingManager.RPC(typeof(NothingTimerManager), "RPCA_TransformOldestNothing", new object[2] { player.playerID, targetCardName }); } } [UnboundRPC] public static void RPCA_TransformOldestNothing(int playerID, string targetCardName) { TransformOldestNothingInternal(playerID, targetCardName); } private static void TransformOldestNothingInternal(int playerID, string targetCardName) { Player val = PlayerManager.instance.players.Find((Player p) => p.playerID == playerID); if ((Object)(object)val == (Object)null) { return; } RemoveOldestTimer(val); CardInfo val2 = null; foreach (CardInfo currentCard in val.data.currentCards) { if (currentCard.cardName == "Nothing" || currentCard.cardName.EndsWith("Nothing")) { val2 = currentCard; break; } } if ((Object)(object)val2 == (Object)null) { SetIsTransforming(val, value: false); return; } CardInfo val3 = FindHiddenCard(targetCardName); if ((Object)(object)val3 == (Object)null) { SetIsTransforming(val, value: false); } else { ((MonoBehaviour)Unbound.Instance).StartCoroutine(TransformOldestNothingCoroutine(val, val2, val3)); } } [IteratorStateMachine(typeof(d__21))] private static IEnumerator TransformOldestNothingCoroutine(Player player, CardInfo nothingCard, CardInfo targetCard) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__21(0) { player = player, nothingCard = nothingCard, targetCard = targetCard }; } public static void TransformAllNothingsToAll(Player player) { bool flag = PhotonNetwork.OfflineMode; if (!flag && (Object)(object)player.data.view != (Object)null) { flag = player.data.view.IsMine; } if (!flag) { return; } int timerCount = GetTimerCount(player); if (timerCount != 0) { if (PhotonNetwork.OfflineMode) { TransformAllNothingsToAllInternal(player.playerID, timerCount); return; } NetworkingManager.RPC(typeof(NothingTimerManager), "RPCA_TransformAllNothingsToAll", new object[2] { player.playerID, timerCount }); } } [UnboundRPC] public static void RPCA_TransformAllNothingsToAll(int playerID, int count) { TransformAllNothingsToAllInternal(playerID, count); } private static void TransformAllNothingsToAllInternal(int playerID, int count) { Player val = PlayerManager.instance.players.Find((Player p) => p.playerID == playerID); if (!((Object)(object)val == (Object)null)) { ClearAllTimers(val); CardInfo val2 = FindHiddenCard("All"); if (!((Object)(object)val2 == (Object)null)) { ((MonoBehaviour)Unbound.Instance).StartCoroutine(TransformAllNothingsSequential(val, val2, count)); } } } [IteratorStateMachine(typeof(d__25))] private static IEnumerator TransformAllNothingsSequential(Player player, CardInfo targetCard, int count) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__25(0) { player = player, targetCard = targetCard, count = count }; } public static void TransformImmediatelyToAll(Player player) { bool flag = PhotonNetwork.OfflineMode; if (!flag && (Object)(object)player.data.view != (Object)null) { flag = player.data.view.IsMine; } if (flag) { if (PhotonNetwork.OfflineMode) { TransformImmediatelyToAllInternal(player.playerID); return; } NetworkingManager.RPC(typeof(NothingTimerManager), "RPCA_TransformImmediatelyToAll", new object[1] { player.playerID }); } } [UnboundRPC] public static void RPCA_TransformImmediatelyToAll(int playerID) { TransformImmediatelyToAllInternal(playerID); } private static void TransformImmediatelyToAllInternal(int playerID) { Player player = PlayerManager.instance.players.Find((Player p) => p.playerID == playerID); if ((Object)(object)player == (Object)null) { return; } CardInfo targetCard = FindHiddenCard("All"); if ((Object)(object)targetCard == (Object)null) { return; } ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)Unbound.Instance, 0.2f, (Action)delegate { CardInfo val = null; foreach (CardInfo currentCard in player.data.currentCards) { if (currentCard.cardName == "Nothing" || currentCard.cardName.EndsWith("Nothing")) { val = currentCard; break; } } if (!((Object)(object)val == (Object)null)) { ((MonoBehaviour)Unbound.Instance).StartCoroutine(TransformImmediatelyCoroutine(player, val, targetCard)); } }); } [IteratorStateMachine(typeof(d__29))] private static IEnumerator TransformImmediatelyCoroutine(Player player, CardInfo nothingCard, CardInfo targetCard) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__29(0) { player = player, nothingCard = nothingCard, targetCard = targetCard }; } } } namespace MrFuntikMod.Cards { public class AegisCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ((Component)player).gameObject.AddComponent(); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AegisShieldMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Aegis"; } protected override string GetDescription() { return "Blocking grants invulnerability for a short duration."; } 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 return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Invulnerability Duration", amount = "3s", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Shield Cooldown", amount = "15s", 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)0; } public override string GetModName() { return "BFRM"; } } public class AllCard : CustomCard { public const string CardName = "All"; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { statModifiers.health = 2f; statModifiers.movementSpeed = 1.3f; statModifiers.regen = 10f; gun.damage = 1.5f; gun.ammo = 3; gun.attackSpeed = 0.5f; gun.reloadTime = 0.5f; block.additionalBlocks = 1; block.cdMultiplier = 0.7f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override bool GetEnabled() { return false; } protected override string GetTitle() { return "All"; } protected override string GetDescription() { return "Worth It"; } protected override GameObject GetCardArt() { return Assets.AllCardArt; } 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_000a: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0108: 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_0110: Expected O, but got Unknown //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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_0129: 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_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Expected O, but got Unknown //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_0168: Expected O, but got Unknown //IL_016a: 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_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[9] { new CardInfoStat { positive = true, stat = "Health", amount = "+100%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Regen", amount = "+10", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Move Speed", amount = "+30%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Damage", amount = "+50%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Attack Speed", amount = "+50%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Reload Time", amount = "-50%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Ammo", amount = "+3", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Additional Blocks", amount = "+1", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Block Cooldown", amount = "-30%", 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 "IS"; } } public class AmmoDropCard : CustomCard { private static readonly string[] BonusCardNames = new string[5] { "Ammo +1", "Ammo +2", "Ammo +3", "Ammo +4", "Ammo +5" }; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = true; CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { if (!((Object)(object)PlayerManager.instance == (Object)null) && PlayerManager.instance.players != null && PlayerManager.instance.players.Count != 0 && PlayerManager.instance.players.Contains(player) && (PhotonNetwork.OfflineMode || data.view.IsMine)) { int num = Random.Range(1, 6); if (PhotonNetwork.OfflineMode) { ApplyBonusCardLocal(player, num); return; } NetworkingManager.RPC(typeof(AmmoDropCard), "RPC_ApplyBonusCard", new object[2] { player.playerID, num }); } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } [UnboundRPC] public static void RPC_ApplyBonusCard(int playerID, int ammoBonus) { Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player p) => p.playerID == playerID)); if (!((Object)(object)val == (Object)null) && PhotonNetwork.IsMasterClient) { string cardName = BonusCardNames[ammoBonus - 1]; CardInfo bonusCard = GetBonusCard(cardName); if (!((Object)(object)bonusCard == (Object)null)) { Cards.instance.AddCardToPlayer(val, bonusCard, false, "", 0f, 0f, true); CardBarUtils.instance.ShowAtEndOfPhase(val, bonusCard); } } } private static void ApplyBonusCardLocal(Player player, int ammoBonus) { string cardName = BonusCardNames[ammoBonus - 1]; CardInfo bonusCard = GetBonusCard(cardName); if (!((Object)(object)bonusCard == (Object)null)) { Cards.instance.AddCardToPlayer(player, bonusCard, false, "", 0f, 0f, true); CardBarUtils.instance.ShowAtEndOfPhase(player, bonusCard); } } private static CardInfo GetBonusCard(string cardName) { string cardName2 = cardName; if (MrFuntikMod.hiddenCards != null) { CardInfo val = MrFuntikMod.hiddenCards.Find((CardInfo c) => c.cardName == cardName2); if ((Object)(object)val != (Object)null) { return val; } } ReadOnlyCollection hiddenCards = Cards.instance.HiddenCards; foreach (CardInfo item in hiddenCards) { if (item.cardName == cardName2) { return item; } } return null; } protected override string GetTitle() { return "Ammo Drop"; } protected override string GetDescription() { return "Gain a random ammo bonus between 1 and 5."; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)0; } protected override CardInfoStat[] GetStats() { return (CardInfoStat[])(object)new CardInfoStat[0]; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)1; } public override string GetModName() { return "BFRM"; } } public abstract class AmmoDropBonusBase : CustomCard { protected abstract int AmmoAmount { get; } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { gun.ammo = AmmoAmount; cardInfo.allowMultiple = true; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)0; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)1; } public override string GetModName() { return "BFRM"; } public override bool GetEnabled() { return false; } } public class AmmoDrop_Bonus_1 : AmmoDropBonusBase { protected override int AmmoAmount => 1; protected override string GetTitle() { return "Ammo +1"; } protected override string GetDescription() { return "Bonus ammo from Ammo Drop."; } 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 return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Ammo", amount = "+1", simepleAmount = (SimpleAmount)0 } }; } } public class AmmoDrop_Bonus_2 : AmmoDropBonusBase { protected override int AmmoAmount => 2; protected override string GetTitle() { return "Ammo +2"; } protected override string GetDescription() { return "Bonus ammo from Ammo Drop."; } 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 return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Ammo", amount = "+2", simepleAmount = (SimpleAmount)0 } }; } } public class AmmoDrop_Bonus_3 : AmmoDropBonusBase { protected override int AmmoAmount => 3; protected override string GetTitle() { return "Ammo +3"; } protected override string GetDescription() { return "Bonus ammo from Ammo Drop."; } 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 return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Ammo", amount = "+3", simepleAmount = (SimpleAmount)0 } }; } } public class AmmoDrop_Bonus_4 : AmmoDropBonusBase { protected override int AmmoAmount => 4; protected override string GetTitle() { return "Ammo +4"; } protected override string GetDescription() { return "Bonus ammo from Ammo Drop."; } 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 return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Ammo", amount = "+4", simepleAmount = (SimpleAmount)0 } }; } } public class AmmoDrop_Bonus_5 : AmmoDropBonusBase { protected override int AmmoAmount => 5; protected override string GetTitle() { return "Ammo +5"; } protected override string GetDescription() { return "Bonus ammo from Ammo Drop."; } 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 return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Ammo", amount = "+5", simepleAmount = (SimpleAmount)0 } }; } } public class ArcFieldCard : CustomCard { public static CardInfo cardInfoSelf; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { MrFuntikMod.ArcFieldCategory }; cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { if ((Object)(object)((Component)player).gameObject.GetComponent() == (Object)null) { ((Component)player).gameObject.AddComponent(); } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ArcFieldMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Arc Field"; } protected override string GetDescription() { return "Thunder Core + Planet\nStatic electricity arcs to nearby enemies."; } protected override GameObject GetCardArt() { return null; } 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("Hidden"); } 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 return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Arc Damage", amount = "1%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Tick Rate", amount = "0.15s", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) return CardThemeLib.instance.CreateOrGetType("Hidden", (CardThemeColor)null); } public override string GetModName() { return "BFRM"; } } public class AuraBloodRotCard : CustomCard { private const string AuraCardName = "Aura: Blood Rot"; private const string DebuffCardName = "Debuff: Blood Rot"; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { MrFuntikMod.AuraCards }; cardInfo.allowMultiple = true; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AuraHelper.ApplyDebuffsToEnemies(player, "Aura: Blood Rot", "Debuff: Blood Rot"); AuraMasterHelper.CheckUnlockAuraMaster(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AuraMasterHelper.CheckLockAuraMaster(player); } protected override string GetTitle() { return "Aura: Blood Rot"; } protected override string GetDescription() { return "Applies a debuff to enemies."; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)0; } 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 = true, stat = "Regen", amount = "-5", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Lifesteal", amount = "-30%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Healing Effect", amount = "-10%", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)4; } public override string GetModName() { return "BFRM"; } } public class BloodRotDebuffCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = true; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { player.data.stats.lifeSteal = Mathf.Max(0f, player.data.stats.lifeSteal - 0.3f); WeakenedHealMono weakenedHealMono = ((Component)player).gameObject.GetComponent(); if ((Object)(object)weakenedHealMono == (Object)null) { weakenedHealMono = ((Component)player).gameObject.AddComponent(); } weakenedHealMono.AddStack(); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { WeakenedHealMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && component.RemoveStack()) { Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Debuff: Blood Rot"; } protected override string GetDescription() { return "Cursed effect."; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)0; } 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 = "Regen", amount = "-5", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Lifesteal", amount = "-30%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Healing Effect", amount = "-10%", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)4; } public override string GetModName() { return "BFRM"; } public override bool GetEnabled() { return false; } } public class WeakenedHealMono : MonoBehaviour { private Player player; private HealthHandler healthHandler; private int stacks = 0; private const float HEAL_REDUCTION_PER_STACK = 0.1f; private const float REGEN_REDUCTION_PER_STACK = 5f; private float appliedRegenReduction = 0f; private bool initialized = false; private void Start() { player = ((Component)this).GetComponent(); healthHandler = ((Component)this).GetComponent(); if ((Object)(object)healthHandler != (Object)null) { initialized = true; ApplyRegenDebuff(); } } public void AddStack() { stacks++; if (initialized) { ApplyRegenDebuff(); } } public bool RemoveStack() { stacks--; if (stacks <= 0) { RestoreRegen(); return true; } ApplyRegenDebuff(); return false; } private void ApplyRegenDebuff() { if (!((Object)(object)healthHandler == (Object)null)) { HealthHandler obj = healthHandler; obj.regeneration += appliedRegenReduction; float num = 5f * (float)stacks; float regeneration = healthHandler.regeneration; appliedRegenReduction = Mathf.Min(num, regeneration); healthHandler.regeneration = regeneration - appliedRegenReduction; } } private void RestoreRegen() { if (!((Object)(object)healthHandler == (Object)null)) { HealthHandler obj = healthHandler; obj.regeneration += appliedRegenReduction; appliedRegenReduction = 0f; } } public float GetHealMultiplier() { float num = 1f - 0.1f * (float)stacks; return Mathf.Max(0.1f, num); } public int GetStacks() { return stacks; } private void OnDestroy() { RestoreRegen(); } } public class AuraBrokenBurstCard : CustomCard { private const string AuraCardName = "Aura: Broken Burst"; private const string DebuffCardName = "Debuff: Broken Burst"; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { MrFuntikMod.AuraCards }; cardInfo.allowMultiple = true; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AuraHelper.ApplyDebuffsToEnemies(player, "Aura: Broken Burst", "Debuff: Broken Burst"); AuraMasterHelper.CheckUnlockAuraMaster(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AuraMasterHelper.CheckLockAuraMaster(player); } protected override string GetTitle() { return "Aura: Broken Burst"; } protected override string GetDescription() { return "Applies a debuff to enemies."; } protected override GameObject? GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)0; } 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 = true, stat = "Bursts", amount = "-1", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Bullets", amount = "-1", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Ammo", amount = "-3", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)4; } public override string GetModName() { return "BFRM"; } } public class BrokenBurstDebuffCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { gun.ammo = -3; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { gun.bursts = Mathf.Max(0, gun.bursts - 1); gun.numberOfProjectiles = Mathf.Max(1, gun.numberOfProjectiles - 1); } 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 "Debuff: Broken Burst"; } protected override string GetDescription() { return "Cursed effect."; } 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)0; } 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 = "Bursts", amount = "-1", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Bullets", amount = "-1", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Ammo", amount = "-3", 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)4; } public override string GetModName() { return "BFRM"; } public override bool GetEnabled() { return false; } } public class AuraColdWaterCard : CustomCard { private const string AuraCardName = "Aura: Cold Water"; private const string DebuffCardName = "Debuff: Cold Water"; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { MrFuntikMod.AuraCards }; cardInfo.allowMultiple = true; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AuraHelper.ApplyDebuffsToEnemies(player, "Aura: Cold Water", "Debuff: Cold Water"); AuraMasterHelper.CheckUnlockAuraMaster(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AuraMasterHelper.CheckLockAuraMaster(player); } protected override string GetTitle() { return "Aura: Cold Water"; } protected override string GetDescription() { return "Applies a debuff to enemies."; } protected override GameObject? GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)0; } 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 = true, stat = "Decay", amount = "-1", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Additional Blocks", amount = "-1", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Block Cooldown", amount = "+0.5s", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)4; } public override string GetModName() { return "BFRM"; } } public class ColdWaterDebuffCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { block.additionalBlocks = -1; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { block.cdAdd += 0.5f; player.data.stats.secondsToTakeDamageOver = Mathf.Max(0f, player.data.stats.secondsToTakeDamageOver - 1f); } 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 "Debuff: Cold Water"; } protected override string GetDescription() { return "Cursed effect."; } 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)0; } 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 = "Decay", amount = "-1", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Additional Blocks", amount = "-1", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Block Cooldown", amount = "+0.5s", 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)4; } public override string GetModName() { return "BFRM"; } public override bool GetEnabled() { return false; } } public class AuraDeathSentenceCard : CustomCard { private const string AuraCardName = "Aura: Death Sentence"; private const string DebuffCardName = "Debuff: Death Sentence"; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { MrFuntikMod.AuraCards }; cardInfo.allowMultiple = true; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AuraHelper.ApplyDebuffsToEnemies(player, "Aura: Death Sentence", "Debuff: Death Sentence"); AuraMasterHelper.CheckUnlockAuraMaster(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AuraMasterHelper.CheckLockAuraMaster(player); } protected override string GetTitle() { return "Aura: Death Sentence"; } protected override string GetDescription() { return "Applies a debuff to enemies."; } protected override GameObject? GetCardArt() { return null; } protected override Rarity GetRarity() { 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_002c: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_0071: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[3] { new CardInfoStat { positive = true, stat = "Revives", amount = "-1" }, new CardInfoStat { positive = true, stat = "Jumps", amount = "-1", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Gravity", amount = "+20%", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)4; } public override string GetModName() { return "BFRM"; } } public class DeathSentenceDebuffCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { statModifiers.gravity = 1.2f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { player.data.stats.respawns = Mathf.Max(0, player.data.stats.respawns - 1); SlowStepEffect orAddComponent = ExtensionMethods.GetOrAddComponent(((Component)player).gameObject, false); orAddComponent.ApplyJumpPenalty(data, characterStats); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { SlowStepEffect component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.RemoveJumpPenalty(data, characterStats); Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Debuff: Death Sentence"; } protected override string GetDescription() { return "Cursed effect."; } 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_002c: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_0071: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[3] { new CardInfoStat { positive = false, stat = "Revives", amount = "-1" }, new CardInfoStat { positive = false, stat = "Jumps", amount = "-1", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Gravity", amount = "+20%", 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)4; } public override string GetModName() { return "BFRM"; } public override bool GetEnabled() { return false; } } public class SlowStepEffect : MonoBehaviour { private bool jumpPenaltyApplied = false; public void ApplyJumpPenalty(CharacterData data, CharacterStatModifiers stats) { if (data.jumps > 1) { data.jumps--; stats.numberOfJumps--; jumpPenaltyApplied = true; } } public void RemoveJumpPenalty(CharacterData data, CharacterStatModifiers stats) { if (jumpPenaltyApplied) { data.jumps++; stats.numberOfJumps++; jumpPenaltyApplied = false; } } } public class AuraHeavyHandsCard : CustomCard { private const string AuraCardName = "Aura: Heavy Hands"; private const string DebuffCardName = "Debuff: Heavy Hands"; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { MrFuntikMod.AuraCards }; cardInfo.allowMultiple = true; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AuraHelper.ApplyDebuffsToEnemies(player, "Aura: Heavy Hands", "Debuff: Heavy Hands"); AuraMasterHelper.CheckUnlockAuraMaster(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AuraMasterHelper.CheckLockAuraMaster(player); } protected override string GetTitle() { return "Aura: Heavy Hands"; } protected override string GetDescription() { return "Applies a debuff to enemies."; } protected override GameObject? GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)0; } 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 = true, stat = "Bullet Speed", amount = "-20%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Projectile Speed", amount = "-20%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Bullet Spread", amount = "+0.05", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)4; } public override string GetModName() { return "BFRM"; } } public class HeavyHandsDebuffCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { gun.projectileSpeed *= 0.8f; gun.projectielSimulatonSpeed *= 0.8f; gun.spread += 0.05f; } 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 "Debuff: Heavy Hands"; } protected override string GetDescription() { return "Cursed effect."; } 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)0; } 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 = "Bullet Speed", amount = "-20%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Projectile Speed", amount = "-20%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Bullet Spread", amount = "+0.05", 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)4; } public override string GetModName() { return "BFRM"; } public override bool GetEnabled() { return false; } } public class AuraOverheatedCard : CustomCard { private const string AuraCardName = "Aura: Overheated"; private const string DebuffCardName = "Debuff: Overheated"; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { MrFuntikMod.AuraCards }; cardInfo.allowMultiple = true; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AuraHelper.ApplyDebuffsToEnemies(player, "Aura: Overheated", "Debuff: Overheated"); AuraMasterHelper.CheckUnlockAuraMaster(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AuraMasterHelper.CheckLockAuraMaster(player); } protected override string GetTitle() { return "Aura: Overheated"; } protected override string GetDescription() { return "Applies a debuff to enemies."; } protected override GameObject? GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)0; } 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 = true, stat = "Recoil", amount = "+20%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Reload Time", amount = "+0.20s", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Attack Speed", amount = "-20%", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)4; } public override string GetModName() { return "BFRM"; } } public class OverheatedDebuffCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { gun.attackSpeedMultiplier = 1.2f; gun.reloadTimeAdd = 0.2f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { OverheatRecoilEffect component = ((Component)player).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { component = ((Component)player).gameObject.AddComponent(); component.Initialize(player); } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { OverheatRecoilEffect component = ((Component)player).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Debuff: Overheated"; } protected override string GetDescription() { return "Cursed effect."; } 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)0; } 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 = "Recoil", amount = "+20%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Reload Time", amount = "+0.20s", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Attack Speed", amount = "-20%", 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)4; } public override string GetModName() { return "BFRM"; } public override bool GetEnabled() { return false; } } [DisallowMultipleComponent] public class OverheatRecoilEffect : MonoBehaviour { private const float RecoilForce = 300f; private const float UpwardRecoilLimit = 0.1f; private Player player; private Gun gun; private bool subscribed = false; public void Initialize(Player player) { this.player = player; BindGun(); } private void Update() { if ((Object)(object)gun == (Object)null) { BindGun(); } } private void BindGun() { if (Object.op_Implicit((Object)(object)player)) { Gun val = null; Holding component = ((Component)player).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.holdable != (Object)null) { val = ((Component)component.holdable).GetComponent(); } if (!Object.op_Implicit((Object)(object)val)) { val = ((Component)player).GetComponentInChildren(true); } if (Object.op_Implicit((Object)(object)val) && (Object)(object)val != (Object)(object)gun) { UnbindGun(); gun = val; Subscribe(); } } } private void Subscribe() { if (Object.op_Implicit((Object)(object)gun) && !subscribed) { Gun obj = gun; obj.ShootPojectileAction = (Action)Delegate.Remove(obj.ShootPojectileAction, new Action(OnShootProjectile)); Gun obj2 = gun; obj2.ShootPojectileAction = (Action)Delegate.Combine(obj2.ShootPojectileAction, new Action(OnShootProjectile)); subscribed = true; } } private void UnbindGun() { if (Object.op_Implicit((Object)(object)gun) && subscribed) { Gun obj = gun; obj.ShootPojectileAction = (Action)Delegate.Remove(obj.ShootPojectileAction, new Action(OnShootProjectile)); subscribed = false; } gun = null; } private void OnShootProjectile(GameObject projectile) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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) if (Object.op_Implicit((Object)(object)player) && Object.op_Implicit((Object)(object)gun)) { Vector2 val = -Vector2.op_Implicit(((Component)gun).transform.up); if (val.y > 0f) { val.y *= 0.1f; } player.data.healthHandler.TakeForce(val * 300f, (ForceMode2D)1, true, false, 0f); } } private void OnDestroy() { UnbindGun(); } } public class AuraSlowStepCard : CustomCard { private const string AuraCardName = "Aura: Slow Step"; private const string DebuffCardName = "Debuff: Slow Step"; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { MrFuntikMod.AuraCards }; cardInfo.allowMultiple = true; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AuraHelper.ApplyDebuffsToEnemies(player, "Aura: Slow Step", "Debuff: Slow Step"); AuraMasterHelper.CheckUnlockAuraMaster(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AuraMasterHelper.CheckLockAuraMaster(player); } protected override string GetTitle() { return "Aura: Slow Step"; } protected override string GetDescription() { return "Applies a debuff to enemies."; } protected override GameObject? GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)0; } 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 = true, stat = "Size", amount = "+20%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Health", amount = "-25%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Move Speed", amount = "-15%", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)4; } public override string GetModName() { return "BFRM"; } } public class SlowStepDebuffCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { statModifiers.health = 0.75f; statModifiers.movementSpeed = 0.85f; statModifiers.sizeMultiplier = 1.2f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "Debuff: Slow Step"; } protected override string GetDescription() { return "Cursed effect."; } 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)0; } 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 = "Size", amount = "+20%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Health", amount = "-25%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Move Speed", amount = "-15%", 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)4; } public override string GetModName() { return "BFRM"; } public override bool GetEnabled() { return false; } } public class AuraSoftRicochetCard : CustomCard { private const string AuraCardName = "Aura: Soft Ricochet"; private const string DebuffCardName = "Debuff: Soft Ricochet"; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { MrFuntikMod.AuraCards }; cardInfo.allowMultiple = true; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AuraHelper.ApplyDebuffsToEnemies(player, "Aura: Soft Ricochet", "Debuff: Soft Ricochet"); AuraMasterHelper.CheckUnlockAuraMaster(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AuraMasterHelper.CheckLockAuraMaster(player); } protected override string GetTitle() { return "Aura: Soft Ricochet"; } protected override string GetDescription() { return "Applies a debuff to enemies."; } protected override GameObject? GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)0; } 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 = true, stat = "Bounces", amount = "-3", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Damage per Bounce", amount = "-10%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Speed on Bounce", amount = "-10%", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)4; } public override string GetModName() { return "BFRM"; } } public class SoftRicochetDebuffCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { gun.dmgMOnBounce *= 0.9f; gun.reflects = Mathf.Max(0, gun.reflects - 3); gun.speedMOnBounce *= 0.9f; } 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 "Debuff: Soft Ricochet"; } protected override string GetDescription() { return "Cursed effect."; } 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)0; } 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 = "Bounces", amount = "-3", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Damage per Bounce", amount = "-10%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Speed on Bounce", amount = "-10%", 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)4; } public override string GetModName() { return "BFRM"; } public override bool GetEnabled() { return false; } } public class AuraWeakeningCard : CustomCard { private const string AuraCardName = "Aura: Weakening"; private const string DebuffCardName = "Debuff: Weakened"; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { MrFuntikMod.AuraCards }; cardInfo.allowMultiple = true; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AuraHelper.ApplyDebuffsToEnemies(player, "Aura: Weakening", "Debuff: Weakened"); AuraMasterHelper.CheckUnlockAuraMaster(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AuraMasterHelper.CheckLockAuraMaster(player); } protected override string GetTitle() { return "Aura: Weakening"; } protected override string GetDescription() { return "Applies a debuff to enemies."; } protected override GameObject? GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)0; } 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 = true, stat = "Damage", amount = "-25%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Bullet gravity", amount = "+15%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Damage Growth", amount = "-10%", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)4; } public override string GetModName() { return "BFRM"; } } public class WeakenedDebuffCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { gun.damage = 0.75f; gun.gravity = 1.15f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { gun.damageAfterDistanceMultiplier *= 0.9f; } 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 "Debuff: Weakened"; } protected override string GetDescription() { return "Cursed effect."; } 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)0; } 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 = "Damage", amount = "-25%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Bullet gravity", amount = "+15%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Damage Growth", amount = "-10%", 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)4; } public override string GetModName() { return "BFRM"; } public override bool GetEnabled() { return false; } } public class BacktrackCard : CustomCard { public static CardInfo cardInfoSelf; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { BacktrackMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component == (Object)null) { BacktrackMono backtrackMono = ((Component)player).gameObject.AddComponent(); backtrackMono.stackCount = 1; } RollbackHelper.CheckUnlockRollback(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { BacktrackMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } GravitySurgeHelper.CheckLockGravitySurgeOnStackRemove(player, isLastStack: false); } protected override string GetTitle() { return "Backtrack"; } protected override string GetDescription() { return "Block to return to your position.\nUnlocks Rollback for health restore."; } protected override GameObject? GetCardArt() { return null; } protected override Rarity GetRarity() { 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_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 return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Position Rewind", amount = "up to 3s", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Ability Cooldown", amount = "10s", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)2; } public override string GetModName() { return "BFRM"; } } internal class BerserkerCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { gun.damage = 1.5f; gun.attackSpeed = 0.75f; statModifiers.health = 0.7f; statModifiers.movementSpeed = 1.1f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "Berserker"; } protected override string GetDescription() { return "Powerful attacks come with weakness."; } 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)0; } 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 //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[4] { new CardInfoStat { positive = true, stat = "Damage", amount = "+50%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Attack Speed", amount = "+20%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Move Speed", amount = "+10%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Health", amount = "-30%", 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)1; } public override string GetModName() { return "BFRM"; } } internal class BlackPillCard : CustomCard { private const string BlessingCardName = "Black Pill Blessing"; private const string CurseCardName = "Black Pill Curse"; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { if (!((Object)(object)PlayerManager.instance == (Object)null) && PlayerManager.instance.players != null && PlayerManager.instance.players.Count != 0 && PlayerManager.instance.players.Contains(player) && (PhotonNetwork.OfflineMode || data.view.IsMine)) { float value = Random.value; bool flag = value >= 0.2f; if (PhotonNetwork.OfflineMode) { ApplyCardLocal(player, flag); return; } NetworkingManager.RPC(typeof(BlackPillCard), "RPC_ApplyCard", new object[2] { player.playerID, flag }); } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } [UnboundRPC] public static void RPC_ApplyCard(int playerID, bool success) { Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player p) => p.playerID == playerID)); if ((Object)(object)val == (Object)null) { MrFuntikMod.LogError($"[BlackPillCard] Player with ID {playerID} not found!"); } else if (PhotonNetwork.IsMasterClient) { string text = (success ? "Black Pill Blessing" : "Black Pill Curse"); CardInfo card = GetCard(text); if ((Object)(object)card == (Object)null) { MrFuntikMod.LogError("[BlackPillCard] Card '" + text + "' not found!"); return; } MrFuntikMod.Log($"[BlackPillCard] Found card: '{card.cardName}', adding to player {playerID}"); Cards.instance.AddCardToPlayer(val, card, false, "", 0f, 0f, true); CardBarUtils.instance.ShowAtEndOfPhase(val, card); } } private static void ApplyCardLocal(Player player, bool success) { string text = (success ? "Black Pill Blessing" : "Black Pill Curse"); CardInfo card = GetCard(text); if ((Object)(object)card == (Object)null) { MrFuntikMod.LogError("[BlackPillCard] LOCAL: Card '" + text + "' not found!"); return; } MrFuntikMod.Log("[BlackPillCard] LOCAL: Found card: '" + card.cardName + "'"); Cards.instance.AddCardToPlayer(player, card, false, "", 0f, 0f, true); CardBarUtils.instance.ShowAtEndOfPhase(player, card); } private static CardInfo GetCard(string cardName) { string cardName2 = cardName; if (MrFuntikMod.hiddenCards != null) { CardInfo val = MrFuntikMod.hiddenCards.Find((CardInfo c) => c.cardName == cardName2); if ((Object)(object)val != (Object)null) { return val; } } ReadOnlyCollection hiddenCards = Cards.instance.HiddenCards; foreach (CardInfo item in hiddenCards) { if (item.cardName == cardName2) { return item; } } return null; } protected override string GetTitle() { return "Black Pill"; } protected override string GetDescription() { return "Gain immense power, 20% chance: reload triple, ammo set to one."; } protected override GameObject GetCardArt() { return Assets.BlackPillArt; } 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_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 return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Damage", amount = "+80%", 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 "IS"; } } public class BlackPillBlessingCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = true; gun.damage = 1.8f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "Black Pill Blessing"; } protected override string GetDescription() { return "You got lucky."; } protected override GameObject GetCardArt() { return Assets.BlackPillArt; } protected override Rarity GetRarity() { return (Rarity)1; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)7; } public override string GetModName() { return "IS"; } 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 return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Damage", amount = "+80%", simepleAmount = (SimpleAmount)0 } }; } public override bool GetEnabled() { return false; } } public class BlackPillCurseCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = true; gun.damage = 1.8f; gun.reloadTime = 3f; gun.ammo = -999; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "Black Pill Curse"; } protected override string GetDescription() { return "Luck turned against you."; } protected override GameObject GetCardArt() { return Assets.BlackPillArt; } protected override Rarity GetRarity() { return (Rarity)1; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)7; } public override string GetModName() { return "IS"; } 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 = true, stat = "Damage", amount = "+80%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Reload Time", amount = "+200%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Ammo", amount = "Set 1", simepleAmount = (SimpleAmount)0 } }; } public override bool GetEnabled() { return false; } } public class BlazingTrailCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { BlazingTrailEffect component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.stackCount++; } else { BlazingTrailEffect blazingTrailEffect = ((Component)player).gameObject.AddComponent(); blazingTrailEffect.stackCount = 1; blazingTrailEffect.owner = player; } ScorchHelper.CheckUnlockScorch(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { BlazingTrailEffect component = ((Component)player).gameObject.GetComponent(); bool flag = false; if ((Object)(object)component != (Object)null) { component.stackCount--; flag = component.stackCount <= 0; if (flag) { Object.Destroy((Object)(object)component); } } else { flag = true; } ScorchHelper.CheckLockScorchOnStackRemove(player, flag); } protected override string GetTitle() { return "Blazing Trail"; } protected override string GetDescription() { return "Leaves a fire trail dealing percentage enemy max HP."; } protected override GameObject? GetCardArt() { return null; } protected override Rarity GetRarity() { 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_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 //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[4] { new CardInfoStat { positive = true, stat = "Trail Damage", amount = "1%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Trail Duration", amount = "5s", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Burn Damage", amount = "1%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Burn Duration", amount = "2s", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)0; } public override string GetModName() { return "BFRM"; } } public static class FireParticlePool { private static Stack pool = new Stack(); private static Transform poolContainer; private const int INITIAL_POOL_SIZE = 20; private const int MAX_POOL_SIZE = 150; public static int PoolSize => pool.Count; public static void EnsureInitialized() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if ((Object)(object)poolContainer == (Object)null) { GameObject val = new GameObject("FireParticlePool"); Object.DontDestroyOnLoad((Object)(object)val); poolContainer = val.transform; for (int i = 0; i < 20; i++) { PooledFireParticle pooledFireParticle = CreateNewFireParticle(); ((Component)pooledFireParticle).gameObject.SetActive(false); pool.Push(pooledFireParticle); } } } private static PooledFireParticle CreateNewFireParticle() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown GameObject val = new GameObject("PooledFire"); val.transform.SetParent(poolContainer); PooledFireParticle pooledFireParticle = val.AddComponent(); pooledFireParticle.CreateVisuals(); return pooledFireParticle; } public static PooledFireParticle Get() { EnsureInitialized(); PooledFireParticle pooledFireParticle = ((pool.Count <= 0) ? CreateNewFireParticle() : pool.Pop()); ((Component)pooledFireParticle).gameObject.SetActive(true); return pooledFireParticle; } public static void Return(PooledFireParticle fire) { if (!((Object)(object)fire == (Object)null)) { fire.Deactivate(); if (pool.Count < 150) { ((Component)fire).transform.SetParent(poolContainer); ((Component)fire).gameObject.SetActive(false); pool.Push(fire); } else { Object.Destroy((Object)(object)((Component)fire).gameObject); } } } public static void ReturnAllActive() { PooledFireParticle[] array = Object.FindObjectsOfType(); PooledFireParticle[] array2 = array; foreach (PooledFireParticle pooledFireParticle in array2) { if ((Object)(object)pooledFireParticle != (Object)null && ((Component)pooledFireParticle).gameObject.activeInHierarchy) { Return(pooledFireParticle); } } PooledFireParticle.ClearActiveFiresList(); } } public class BlazingTrailEffect : MonoBehaviour { [CompilerGenerated] private sealed class d__38 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public BlazingTrailEffect <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__38(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.effectWarmup = false; <>4__this.effectEnabled = true; <>4__this.hooksTriggered = true; <>4__this.ResetTrailState(); 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 d__39 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public BlazingTrailEffect <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__39(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.effectEnabled = false; <>4__this.effectWarmup = true; FireParticlePool.ReturnAllActive(); 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 d__37 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public BlazingTrailEffect <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__37(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.effectEnabled = false; <>4__this.effectWarmup = true; <>4__this.hooksTriggered = true; <>4__this.ResetTrailState(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public int stackCount = 1; public Player owner; private bool effectEnabled = false; private bool effectWarmup = true; private bool hooksTriggered = false; private const float SPAWN_INTERVAL_STANDING = 0.25f; private const float MIN_MOVE_DISTANCE = 0.35f; private const int MAX_PARTICLES_PER_FRAME = 10; private const float BASE_FIRE_DURATION = 5f; private const float BASE_DAMAGE_PERCENT = 0.01f; private const float FIRE_DAMAGE_INTERVAL = 0.2f; public const float FIRE_RADIUS = 0.3f; private const float DURATION_MULT_PER_STACK = 1.25f; private const float DAMAGE_MULT_PER_STACK = 2f; private const float BASE_SURFACE_CHECK_DISTANCE = 0.8f; private const float SIZE_CHECK_INTERVAL = 0.5f; private const float TELEPORT_THRESHOLD = 5f; private const float TELEPORT_THRESHOLD_SQR = 25f; private Vector3 lastSpawnPosition; private float standingTimer; private Vector3 lastPosition; private float currentSurfaceCheckDistance = 0.8f; private float lastSizeCheck = 0f; public static Material sharedFireMaterial; public static Sprite cachedCircleSprite; public static Gradient sharedFlameGradient; private static RaycastHit2D[] raycastHitCache = (RaycastHit2D[])(object)new RaycastHit2D[16]; private static int totalSpawnedParticles = 0; private static float lastLogTime = 0f; private const int LOG_FIRST_N_PARTICLES = 10; private const float LOG_INTERVAL = 3f; private const bool DEBUG_SURFACE_DETECTION = false; private const float DEBUG_LOG_INTERVAL = 0.5f; private float lastDebugLogTime = 0f; private static readonly Vector2[] raycastDirections = (Vector2[])(object)new Vector2[8] { Vector2.down, new Vector2(-0.707f, -0.707f), new Vector2(0.707f, -0.707f), Vector2.left, Vector2.right, new Vector2(-0.707f, 0.707f), new Vector2(0.707f, 0.707f), Vector2.up }; private void Awake() { GameModeManager.AddHook("PointStart", (Func)OnPointStart); GameModeManager.AddHook("BattleStart", (Func)OnBattleStart); GameModeManager.AddHook("PointEnd", (Func)OnPointEnd); } private void Start() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)owner != (Object)null && (Object)(object)owner.data != (Object)null && (Object)(object)owner.data.healthHandler != (Object)null) { HealthHandler healthHandler = owner.data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive)); } lastSpawnPosition = ((Component)this).transform.position; lastPosition = ((Component)this).transform.position; InitializeSharedResources(); FireParticlePool.EnsureInitialized(); } private void OnDestroy() { GameModeManager.RemoveHook("PointStart", (Func)OnPointStart); GameModeManager.RemoveHook("BattleStart", (Func)OnBattleStart); GameModeManager.RemoveHook("PointEnd", (Func)OnPointEnd); if ((Object)(object)owner != (Object)null && (Object)(object)owner.data != (Object)null && (Object)(object)owner.data.healthHandler != (Object)null) { HealthHandler healthHandler = owner.data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive)); } } [IteratorStateMachine(typeof(d__37))] private IEnumerator OnPointStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__37(0) { <>4__this = this, gm = gm }; } [IteratorStateMachine(typeof(d__38))] private IEnumerator OnBattleStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__38(0) { <>4__this = this, gm = gm }; } [IteratorStateMachine(typeof(d__39))] private IEnumerator OnPointEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__39(0) { <>4__this = this, gm = gm }; } private void ResetTrailState() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) lastSpawnPosition = ((Component)this).transform.position; lastPosition = ((Component)this).transform.position; standingTimer = 0f; } private void OnRevive() { ResetTrailState(); } private void Update() { //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0186: 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_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_024b: 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_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) if (!hooksTriggered && (Object)(object)GameManager.instance != (Object)null && GameManager.instance.battleOngoing && !effectEnabled) { effectEnabled = true; effectWarmup = false; ResetTrailState(); } if (!effectEnabled || effectWarmup || (Object)(object)GameManager.instance == (Object)null || !GameManager.instance.battleOngoing || (Object)(object)owner == (Object)null || (Object)(object)owner.data == (Object)null) { return; } bool dead = owner.data.dead; bool flag = (Object)(object)owner.data.healthHandler != (Object)null && owner.data.healthHandler.isRespawning; if (dead || flag) { return; } Vector3 position = ((Component)this).transform.position; if (Time.time - lastSizeCheck >= 0.5f) { UpdateSurfaceCheckDistance(); lastSizeCheck = Time.time; } Vector3 val = position - lastSpawnPosition; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude > 25f) { ResetTrailState(); return; } Vector3 val2 = position - lastPosition; bool flag2 = ((Vector3)(ref val2)).sqrMagnitude > 0.0001f; lastPosition = position; float num = 0.122499995f; if (flag2 && sqrMagnitude >= num) { float num2 = Mathf.Sqrt(sqrMagnitude); int num3 = Mathf.Clamp(Mathf.CeilToInt(num2 / 0.35f), 1, 10); for (int i = 0; i < num3; i++) { float num4 = (float)(i + 1) / (float)num3; Vector3 position2 = lastSpawnPosition + val * num4; if (TryFindSurfaceAt(position2, out Vector3 surfacePoint, out Vector3 surfaceNormal, out Transform surfaceTransform, out string hitInfo)) { SpawnFireParticle(surfacePoint, surfaceNormal, surfaceTransform, hitInfo); } } lastSpawnPosition = position; standingTimer = 0f; } else if (!flag2) { standingTimer += Time.deltaTime; if (standingTimer >= 0.25f) { if (TryFindSurfaceAt(position, out Vector3 surfacePoint2, out Vector3 surfaceNormal2, out Transform surfaceTransform2, out string hitInfo2)) { SpawnFireParticle(surfacePoint2, surfaceNormal2, surfaceTransform2, hitInfo2); } standingTimer = 0f; } } else { standingTimer = 0f; } } private void UpdateSurfaceCheckDistance() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)owner == (Object)null) && !((Object)(object)owner.data == (Object)null)) { float num = 1f; CharacterStatModifiers stats = owner.data.stats; if ((Object)(object)stats != (Object)null) { num = stats.sizeMultiplier; } float num2 = Mathf.Max(((Component)this).transform.localScale.x, ((Component)this).transform.localScale.y); if (num2 > num) { num = num2; } currentSurfaceCheckDistance = 0.8f * num + 0.3f; currentSurfaceCheckDistance = Mathf.Clamp(currentSurfaceCheckDistance, 0.8f, 8f); } } public static void InitializeSharedResources() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00e6: 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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_013d: 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_0153: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)sharedFireMaterial == (Object)null) { sharedFireMaterial = new Material(Shader.Find("Sprites/Default")); } if ((Object)(object)cachedCircleSprite == (Object)null) { cachedCircleSprite = CreateCircleSprite(); } if (sharedFlameGradient == null) { sharedFlameGradient = new Gradient(); sharedFlameGradient.SetKeys((GradientColorKey[])(object)new GradientColorKey[4] { new GradientColorKey(new Color(1f, 0.9f, 0.3f), 0f), new GradientColorKey(new Color(1f, 0.5f, 0f), 0.3f), new GradientColorKey(new Color(1f, 0.2f, 0f), 0.7f), new GradientColorKey(new Color(0.3f, 0.1f, 0f), 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[4] { new GradientAlphaKey(0.9f, 0f), new GradientAlphaKey(0.8f, 0.3f), new GradientAlphaKey(0.5f, 0.7f), new GradientAlphaKey(0f, 1f) }); } } private bool TryFindSurfaceAt(Vector3 position, out Vector3 surfacePoint, out Vector3 surfaceNormal, out Transform surfaceTransform, out string hitInfo) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) surfacePoint = Vector3.zero; surfaceNormal = Vector3.up; surfaceTransform = null; hitInfo = ""; Vector2 val = Vector2.op_Implicit(position); float num = float.MaxValue; Vector2 val2 = Vector2.zero; Vector2 val3 = Vector2.up; Transform val4 = null; string text = ""; int num2 = -1; if (false) { lastDebugLogTime = Time.time; } for (int i = 0; i < raycastDirections.Length; i++) { Vector2 val5 = raycastDirections[i]; int num3 = Physics2D.RaycastNonAlloc(val, val5, raycastHitCache, currentSurfaceCheckDistance); for (int j = 0; j < num3; j++) { ref RaycastHit2D reference = ref raycastHitCache[j]; if (IsValidSurface(ref reference)) { float num4 = Vector2.Dot(val5, ((RaycastHit2D)(ref reference)).normal); if (!(num4 >= 0f) && ((RaycastHit2D)(ref reference)).distance < num) { num = ((RaycastHit2D)(ref reference)).distance; val2 = ((RaycastHit2D)(ref reference)).point; val3 = ((RaycastHit2D)(ref reference)).normal; val4 = ((Component)((RaycastHit2D)(ref reference)).collider).transform; text = ((Object)((Component)((RaycastHit2D)(ref reference)).collider).gameObject).name; num2 = i; } } } } if (num2 >= 0) { surfacePoint = Vector2.op_Implicit(val2); surfaceNormal = Vector2.op_Implicit(val3); surfaceTransform = val4; hitInfo = $"dir={num2} dist={num:F3} normal=({val3.x:F2},{val3.y:F2}) obj={text}"; return true; } return false; } private bool IsValidSurface(ref RaycastHit2D hit) { //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) Collider2D collider = ((RaycastHit2D)(ref hit)).collider; if ((Object)(object)collider == (Object)null || collider.isTrigger) { return false; } GameObject gameObject = ((Component)collider).gameObject; int layer = gameObject.layer; string text = LayerMask.LayerToName(layer); if (text == "BackgroundObject") { return false; } if (((Object)gameObject).name.Contains("_BG")) { return false; } if ((Object)(object)((Component)collider).GetComponent() != (Object)null) { return false; } if ((Object)(object)((Component)collider).GetComponentInParent() != (Object)null) { return false; } if ((Object)(object)((Component)collider).GetComponent() != (Object)null) { return false; } if ((Object)(object)((Component)collider).GetComponentInParent() != (Object)null) { return false; } if (text == "Projectile") { return false; } string text2 = ((Object)gameObject).name.ToLower(); if (text2.Contains("bullet") || text2.Contains("projectile") || text2.Contains("shot")) { return false; } Rigidbody2D attachedRigidbody = collider.attachedRigidbody; if ((Object)(object)attachedRigidbody != (Object)null) { Vector2 velocity = attachedRigidbody.velocity; if (((Vector2)(ref velocity)).sqrMagnitude > 100f) { return false; } } if ((Object)(object)((Component)collider).GetComponent() != (Object)null) { return false; } if ((Object)(object)((Component)collider).GetComponentInParent() != (Object)null) { return false; } return true; } private void SpawnFireParticle(Vector3 surfacePosition, Vector3 surfaceNormal, Transform surfaceTransform, string hitInfo) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_007e: 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_00d2: 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) Vector3 position = surfacePosition + surfaceNormal * 0.02f; PooledFireParticle pooledFireParticle = PooledFireParticle.FindNearestFire(position, PooledFireParticle.GetMergeRadius(), owner.playerID); if ((Object)(object)pooledFireParticle != (Object)null) { pooledFireParticle.Reinforce(); return; } float duration = 5f * Mathf.Pow(1.25f, (float)(stackCount - 1)); float damagePercent = 0.01f * Mathf.Pow(2f, (float)(stackCount - 1)); float num = Mathf.Atan2(surfaceNormal.y, surfaceNormal.x) * 57.29578f - 90f; totalSpawnedParticles++; PooledFireParticle pooledFireParticle2 = FireParticlePool.Get(); ((Component)pooledFireParticle2).transform.SetParent((Transform)null, false); ((Component)pooledFireParticle2).transform.localScale = Vector3.one; ((Component)pooledFireParticle2).transform.position = position; ((Component)pooledFireParticle2).transform.rotation = Quaternion.Euler(0f, 0f, num); if ((Object)(object)surfaceTransform != (Object)null) { ((Component)pooledFireParticle2).transform.SetParent(surfaceTransform, true); } pooledFireParticle2.Activate(owner, duration, damagePercent, 0.2f, 0.3f, stackCount); } private static Sprite CreateCircleSprite() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(32, 32); Color[] array = (Color[])(object)new Color[1024]; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(16f, 16f); float num = 16f; for (int i = 0; i < 32; i++) { for (int j = 0; j < 32; j++) { float num2 = (float)j - val2.x; float num3 = (float)i - val2.y; float num4 = num2 * num2 + num3 * num3; float num5 = Mathf.Clamp01(1f - Mathf.Sqrt(num4) / num); num5 *= num5; array[i * 32 + j] = new Color(1f, 1f, 1f, num5); } } val.SetPixels(array); val.Apply(); return Sprite.Create(val, new Rect(0f, 0f, 32f, 32f), new Vector2(0.5f, 0.5f), 32f); } } public class PooledFireParticle : MonoBehaviour { private static List activeFires = new List(); private Player owner; private int ownerID; private int ownerTeamID; private float duration; private float damagePercent; private float damageInterval; private float damageRadius; private float damageRadiusSqr; private int activeFlameCount; private int activeSparkCount; private float spawnTime; private float lastDamageTime; private float sizeMultiplier = 1.5f; private bool isActive = false; private SpriteRenderer glowSprite; private LineRenderer[] flameLines; private SpriteRenderer[] sparkSprites; private Transform[] sparkTransforms; private Transform glowTransform; private float[] flameOffsets; private float[] flameSpeeds; private float[] flameHeights; private float[] sparkPhases; private float[] sparkSpeeds; private float baseGlowSize; private float flameBaseOffsetMultiplier; private const int MAX_FLAME_COUNT = 5; private const int MAX_SPARK_COUNT = 7; private static readonly Color GLOW_BASE_COLOR = new Color(1f, 0.3f, 0f, 0.6f); private static readonly Color SPARK_BASE_COLOR = new Color(1f, 0.8f, 0.2f, 0.8f); public static readonly Color FRIENDLY_COLOR = new Color(0f, 1f, 0.1f); public static readonly Color ENEMY_COLOR = new Color(0.6f, 0.15f, 1f); private Color currentGlowColor; private Color currentSparkColor; public static PooledFireParticle FindNearestFire(Vector3 position, float radius, int ownerID) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) PooledFireParticle result = null; float num = radius * radius; for (int num2 = activeFires.Count - 1; num2 >= 0; num2--) { PooledFireParticle pooledFireParticle = activeFires[num2]; if ((Object)(object)pooledFireParticle == (Object)null || !pooledFireParticle.isActive) { activeFires.RemoveAt(num2); } else if (pooledFireParticle.ownerID == ownerID) { Vector3 val = ((Component)pooledFireParticle).transform.position - position; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude < num) { num = sqrMagnitude; result = pooledFireParticle; } } } return result; } public static float GetMergeRadius() { return 0.3f; } public static void ClearActiveFiresList() { activeFires.Clear(); } public void Reinforce() { spawnTime = Time.time; } private static Player GetLocalPlayer() { List players = PlayerManager.instance.players; for (int i = 0; i < players.Count; i++) { Player val = players[i]; if ((Object)(object)val != (Object)null && (Object)(object)val.data != (Object)null && (Object)(object)val.data.view != (Object)null && val.data.view.IsMine) { return val; } } return null; } private Color GetFireColorForLocalPlayer() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_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) Player localPlayer = GetLocalPlayer(); if ((Object)(object)localPlayer == (Object)null) { return ENEMY_COLOR; } if (localPlayer.teamID == ownerTeamID) { return FRIENDLY_COLOR; } return ENEMY_COLOR; } public void CreateVisuals() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Expected O, but got Unknown //IL_01d9: Unknown result type (might be due to invalid IL or missing references) BlazingTrailEffect.InitializeSharedResources(); GameObject val = new GameObject("Glow"); glowTransform = val.transform; glowTransform.SetParent(((Component)this).transform); glowTransform.localPosition = Vector3.zero; glowSprite = val.AddComponent(); glowSprite.sprite = BlazingTrailEffect.cachedCircleSprite; glowSprite.color = GLOW_BASE_COLOR; ((Renderer)glowSprite).sortingOrder = -1; flameLines = (LineRenderer[])(object)new LineRenderer[5]; flameBaseOffsetMultiplier = 0.06f * sizeMultiplier; for (int i = 0; i < 5; i++) { GameObject val2 = new GameObject($"F{i}"); val2.transform.SetParent(((Component)this).transform); val2.transform.localPosition = Vector3.zero; val2.transform.localRotation = Quaternion.identity; LineRenderer val3 = val2.AddComponent(); ((Renderer)val3).material = BlazingTrailEffect.sharedFireMaterial; val3.positionCount = 5; val3.useWorldSpace = false; val3.colorGradient = BlazingTrailEffect.sharedFlameGradient; ((Renderer)val3).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val3).receiveShadows = false; ((Renderer)val3).sortingOrder = 1; flameLines[i] = val3; } sparkSprites = (SpriteRenderer[])(object)new SpriteRenderer[7]; sparkTransforms = (Transform[])(object)new Transform[7]; for (int j = 0; j < 7; j++) { GameObject val4 = new GameObject($"S{j}"); sparkTransforms[j] = val4.transform; sparkTransforms[j].SetParent(((Component)this).transform); sparkSprites[j] = val4.AddComponent(); sparkSprites[j].sprite = BlazingTrailEffect.cachedCircleSprite; sparkSprites[j].color = SPARK_BASE_COLOR; ((Renderer)sparkSprites[j]).sortingOrder = 2; } flameOffsets = new float[5]; flameSpeeds = new float[5]; flameHeights = new float[5]; sparkPhases = new float[7]; sparkSpeeds = new float[7]; } public void Activate(Player owner, float duration, float damagePercent, float damageInterval, float damageRadius, int stackCount) { //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0114: 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_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Expected O, but got Unknown //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) this.owner = owner; ownerID = (((Object)(object)owner != (Object)null) ? owner.playerID : (-1)); ownerTeamID = (((Object)(object)owner != (Object)null) ? owner.teamID : (-1)); this.duration = duration; this.damagePercent = damagePercent; this.damageInterval = damageInterval; this.damageRadius = damageRadius; damageRadiusSqr = damageRadius * damageRadius; spawnTime = Time.time; lastDamageTime = Time.time; isActive = true; if (!activeFires.Contains(this)) { activeFires.Add(this); } activeFlameCount = 4; activeSparkCount = 4; baseGlowSize = 0.55f * sizeMultiplier; glowTransform.localScale = new Vector3(baseGlowSize, baseGlowSize * 0.25f, 1f); ((Renderer)glowSprite).enabled = true; Color fireColorForLocalPlayer = GetFireColorForLocalPlayer(); float num = default(float); float num2 = default(float); float num3 = default(float); Color.RGBToHSV(fireColorForLocalPlayer, ref num, ref num2, ref num3); Color val = Color.HSVToRGB(num, 1f, 1f); Color color = default(Color); Color color2 = default(Color); if (num > 0.2f && num < 0.45f) { color = val; color2 = val; } else { ((Color)(ref color))..ctor(0.8f, 0.3f, 1f); ((Color)(ref color2))..ctor(1f, 0.5f, 1f); } color.a = 0.8f; glowSprite.color = color; float num4 = 0.14f * sizeMultiplier; float num5 = 0.5f * sizeMultiplier; Gradient colorGradient = CreateTeamFlameGradient(fireColorForLocalPlayer); for (int i = 0; i < 5; i++) { if (i < activeFlameCount) { ((Renderer)flameLines[i]).enabled = true; flameOffsets[i] = Random.Range(0f, MathF.PI * 2f); flameSpeeds[i] = Random.Range(8f, 12f); flameHeights[i] = num5 * (0.8f + (float)i * 0.1f); flameLines[i].colorGradient = colorGradient; AnimationCurve val2 = new AnimationCurve(); val2.AddKey(0f, num4); val2.AddKey(0.3f, 0.1f * sizeMultiplier); val2.AddKey(1f, 0f); flameLines[i].widthCurve = val2; } else { ((Renderer)flameLines[i]).enabled = false; } } color2.a = 1f; for (int j = 0; j < 7; j++) { if (j < activeSparkCount) { ((Renderer)sparkSprites[j]).enabled = true; sparkSprites[j].color = color2; sparkTransforms[j].localScale = Vector3.one * 0.05f * sizeMultiplier; sparkPhases[j] = Random.Range(0f, MathF.PI * 2f); sparkSpeeds[j] = Random.Range(3f, 6f); } else { ((Renderer)sparkSprites[j]).enabled = false; } } currentGlowColor = color; currentSparkColor = color2; } private Gradient CreateTeamFlameGradient(Color teamColor) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_004a: 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_0053: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: 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_0171: Unknown result type (might be due to invalid IL or missing references) Gradient val = new Gradient(); float num = default(float); float num2 = default(float); float num3 = default(float); Color.RGBToHSV(teamColor, ref num, ref num2, ref num3); Color val2 = Color.HSVToRGB(num, 1f, 1f); Color val3 = default(Color); Color val4 = default(Color); Color val5 = default(Color); Color val6 = default(Color); if (num > 0.2f && num < 0.45f) { val3 = val2; val4 = val2; val5 = val2 * 0.75f; val6 = val2 * 0.3f; } else { ((Color)(ref val3))..ctor(1f, 0.4f, 1f); ((Color)(ref val4))..ctor(0.7f, 0.2f, 1f); ((Color)(ref val5))..ctor(0.4f, 0.1f, 0.8f); ((Color)(ref val6))..ctor(0.2f, 0.05f, 0.4f); } val.SetKeys((GradientColorKey[])(object)new GradientColorKey[4] { new GradientColorKey(val3, 0f), new GradientColorKey(val4, 0.25f), new GradientColorKey(val5, 0.6f), new GradientColorKey(val6, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[4] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(0.9f, 0.25f), new GradientAlphaKey(0.5f, 0.6f), new GradientAlphaKey(0f, 1f) }); return val; } public void Deactivate() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) isActive = false; owner = null; activeFires.Remove(this); ((Component)this).transform.SetParent((Transform)null); ((Component)this).transform.position = Vector3.zero; ((Component)this).transform.rotation = Quaternion.identity; ((Component)this).transform.localScale = Vector3.one; currentGlowColor = GLOW_BASE_COLOR; currentSparkColor = SPARK_BASE_COLOR; if ((Object)(object)glowSprite != (Object)null) { ((Renderer)glowSprite).enabled = false; } for (int i = 0; i < 5; i++) { if ((Object)(object)flameLines[i] != (Object)null) { ((Renderer)flameLines[i]).enabled = false; } } for (int j = 0; j < 7; j++) { if ((Object)(object)sparkSprites[j] != (Object)null) { ((Renderer)sparkSprites[j]).enabled = false; } } } private void Update() { if (!isActive) { return; } if ((Object)(object)GameManager.instance == (Object)null || !GameManager.instance.battleOngoing) { FireParticlePool.Return(this); return; } try { if ((Object)(object)((Component)this).transform.parent != (Object)null && !Object.op_Implicit((Object)(object)((Component)((Component)this).transform.parent).gameObject)) { FireParticlePool.Return(this); return; } } catch (MissingReferenceException) { FireParticlePool.Return(this); return; } float num = Time.time - spawnTime; if (num >= duration) { FireParticlePool.Return(this); return; } float num2 = duration - num; float fadeMultiplier = ((num2 >= 0.5f) ? 1f : (num2 / 0.5f)); UpdateGlow(fadeMultiplier); UpdateFlames(fadeMultiplier); UpdateSparks(fadeMultiplier); if (Time.time >= lastDamageTime + damageInterval) { DealDamage(fadeMultiplier); lastDamageTime = Time.time; } } private void UpdateGlow(float fadeMultiplier) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)glowSprite == (Object)null)) { Color color = currentGlowColor; color.a = 0.6f * fadeMultiplier; glowSprite.color = color; float num = 1f + Mathf.Sin(Time.time * 15f) * 0.1f; float num2 = baseGlowSize * fadeMultiplier * num; glowTransform.localScale = new Vector3(num2, num2 * 0.25f, 1f); } } private void UpdateFlames(float fadeMultiplier) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) float num = (float)(activeFlameCount - 1) * 0.5f; for (int i = 0; i < activeFlameCount; i++) { LineRenderer val = flameLines[i]; if (!((Object)(object)val == (Object)null) && ((Renderer)val).enabled) { float num2 = Time.time * flameSpeeds[i] + flameOffsets[i]; float num3 = flameHeights[i] * fadeMultiplier; float num4 = ((float)i - num) * flameBaseOffsetMultiplier; num4 += Mathf.Sin(num2 * 0.5f) * 0.015f * sizeMultiplier; val.SetPosition(0, new Vector3(num4, 0.01f, 0f)); val.SetPosition(1, new Vector3(num4 + Mathf.Sin(num2) * 0.025f * sizeMultiplier, num3 * 0.25f, 0f)); val.SetPosition(2, new Vector3(num4 + Mathf.Sin(num2 * 1.3f + 0.5f) * 0.04f * sizeMultiplier, num3 * 0.5f, 0f)); val.SetPosition(3, new Vector3(num4 + Mathf.Sin(num2 * 1.1f + 1f) * 0.05f * sizeMultiplier, num3 * 0.75f, 0f)); val.SetPosition(4, new Vector3(num4 + Mathf.Sin(num2 * 0.9f + 1.5f) * 0.03f * sizeMultiplier, num3, 0f)); } } } private void UpdateSparks(float fadeMultiplier) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < activeSparkCount; i++) { SpriteRenderer val = sparkSprites[i]; if (!((Object)(object)val == (Object)null) && ((Renderer)val).enabled) { float num = Time.time * sparkSpeeds[i] + sparkPhases[i]; float num2 = num % 1.5f * 0.6667f; float num3 = num2 * 0.4f * fadeMultiplier * sizeMultiplier; float num4 = Mathf.Sin(num * 3f) * 0.12f * sizeMultiplier; sparkTransforms[i].localPosition = new Vector3(num4, num3 + 0.02f, 0f); Color color = currentSparkColor; color.a = (1f - num2) * fadeMultiplier * 0.8f; val.color = color; float num5 = 0.04f * sizeMultiplier * (1f - num2 * 0.5f); sparkTransforms[i].localScale = new Vector3(num5, num5, num5); } } } private void DealDamage(float fadeMultiplier) { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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_0178: 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_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: 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_0203: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GameManager.instance == (Object)null || !GameManager.instance.battleOngoing) { return; } if ((Object)(object)owner == (Object)null || (Object)(object)owner.data == (Object)null || owner.data.dead) { owner = FindPlayerByID(ownerID); if ((Object)(object)owner == (Object)null || (Object)(object)owner.data == (Object)null || owner.data.dead) { return; } } List players = PlayerManager.instance.players; Vector2 val = Vector2.op_Implicit(((Component)this).transform.position); for (int i = 0; i < players.Count; i++) { Player val2 = players[i]; if (!((Object)(object)val2 == (Object)null) && !((Object)(object)val2.data == (Object)null) && !val2.data.dead && ((Component)val2).gameObject.activeInHierarchy && val2.playerID != ownerID && val2.teamID != owner.teamID) { Vector2 playerFeetPosition = GetPlayerFeetPosition(val2); float num = playerFeetPosition.x - val.x; float num2 = playerFeetPosition.y - val.y; float num3 = num * num + num2 * num2; if (num3 <= damageRadiusSqr) { float maxHealth = val2.data.maxHealth; float num4 = maxHealth * damagePercent * fadeMultiplier; float num5 = Mathf.Sqrt(num3); Vector2 val3 = (Vector2)((num5 > 0.001f) ? new Vector2(num / num5, num2 / num5) : Vector2.up); ((Damagable)val2.data.healthHandler).CallTakeDamage(val3 * num4, val, (GameObject)null, owner, true); ApplyBurnEffect(val2); } } } } private static Player FindPlayerByID(int playerID) { if (playerID < 0) { return null; } List players = PlayerManager.instance.players; for (int i = 0; i < players.Count; i++) { if ((Object)(object)players[i] != (Object)null && players[i].playerID == playerID) { return players[i]; } } return null; } private void ApplyBurnEffect(Player victim) { if (!((Object)(object)victim == (Object)null) && !((Object)(object)owner == (Object)null)) { NetworkingManager.RPC(typeof(PooledFireParticle), "RPC_ApplyBurn", new object[2] { owner.playerID, victim.playerID }); } } [UnboundRPC] public static void RPC_ApplyBurn(int ownerID, int victimID) { List players = PlayerManager.instance.players; Player val = null; Player val2 = null; for (int i = 0; i < players.Count; i++) { if (!((Object)(object)players[i] == (Object)null)) { if (players[i].playerID == ownerID) { val = players[i]; } if (players[i].playerID == victimID) { val2 = players[i]; } } } if (!((Object)(object)val == (Object)null) && !((Object)(object)val2 == (Object)null)) { BurnEffect component = ((Component)val2).GetComponent(); if ((Object)(object)component != (Object)null) { component.RefreshDuration(); return; } BurnEffect burnEffect = ((Component)val2).gameObject.AddComponent(); burnEffect.Apply(val); } } private Vector2 GetPlayerFeetPosition(Player player) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_0085: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) Vector2 val = Vector2.op_Implicit(((Component)player).transform.position); float num = 1f; if ((Object)(object)player.data != (Object)null && (Object)(object)player.data.stats != (Object)null) { num = player.data.stats.sizeMultiplier; } float num2 = Mathf.Max(((Component)player).transform.localScale.x, ((Component)player).transform.localScale.y); if (num2 > num) { num = num2; } return new Vector2(val.x, val.y - 0.5f * num); } } public class BulletTeleporterCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = false; statModifiers.health = 0.75f; block.cdAdd = 0.5f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { gun.damage *= 0.75f; gun.projectileSpeed *= 0.75f; BulletTeleporterMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component == (Object)null) { ((Component)player).gameObject.AddComponent(); } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { BulletTeleporterMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Bullet Teleporter"; } protected override string GetDescription() { return "Block to charge next bullet. Teleport to impact location."; } protected override GameObject GetCardArt() { return Assets.BulletTeleporterArt; } protected override Rarity GetRarity() { 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_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 //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[4] { new CardInfoStat { positive = false, stat = "Health", amount = "-25%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Damage", amount = "-25%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Bullet Speed", amount = "-25%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Block Cooldown", amount = "+0.5s", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)8; } public override string GetModName() { return "DRON"; } } public class ComeToMeCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = false; statModifiers.health = 1.15f; statModifiers.jump = 1.1f; gun.reloadTime = 0.85f; block.cdAdd = 0.5f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ComeToMeMono orAddComponent = ExtensionMethods.GetOrAddComponent(((Component)player).gameObject, false); orAddComponent.Initialize(player, block); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ComeToMeMono component = ((Component)player).GetComponent(); if ((Object)(object)component != (Object)null) { component.Cleanup(); Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Come to me"; } protected override string GetDescription() { return "Teleports the nearest player to you after 2s delay."; } protected override GameObject GetCardArt() { return Assets.ComeToMeArt; } protected override Rarity GetRarity() { return (Rarity)0; } 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 //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[5] { new CardInfoStat { positive = true, stat = "Health", amount = "+15%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Jump Height", amount = "+10%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Reload Time", amount = "-15%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Block Cooldown", amount = "+0.5s", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Cooldown", amount = "4s", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)8; } public override string GetModName() { return "DRON"; } } public class DancerCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { DancerMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.AddStack(); return; } DancerMono dancerMono = ((Component)player).gameObject.AddComponent(); dancerMono.stackCount = 1; } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { DancerMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.RemoveStack(); if (component.stackCount <= 0) { Object.Destroy((Object)(object)component); } } } protected override string GetTitle() { return "Dancer"; } protected override string GetDescription() { return "Each stack increases your chance to dodge bullets (up to 60%)."; } 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)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_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 return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Dodge Chance", amount = "+20%", 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)2; } public override string GetModName() { return "BFRM"; } } public class DeathDefyCard : CustomCard { private static bool hooksRegistered; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = true; if (!hooksRegistered) { DeathDefyHandler.RegisterHooks(); hooksRegistered = true; } } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { DeathDefyMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.AddStack(); } else { ((Component)player).gameObject.AddComponent(); } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { DeathDefyMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.RemoveStack(); if (component.stackCount <= 0) { component.ClearTempRespawns(); Object.Destroy((Object)(object)component); } } } protected override string GetTitle() { return "Defy Death"; } protected override string GetDescription() { return "Chance to rise again when killed. Chance halves after each death. (Stacks up to 60%)"; } protected override GameObject? GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)1; } protected override CardInfoStat[] GetStats() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Revive Chance", amount = "+20%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "After Death", amount = "-50%", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)4; } public override string GetModName() { return "BFRM"; } } public class DestroyerCard : CustomCard { private const float BASE_MAX_SPAWN_DISTANCE = 2f; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = false; gun.reloadTimeAdd = 0.25f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { gun.damage *= 1.5f; gun.projectileSpeed *= 1.5f; gun.ShootPojectileAction = (Action)Delegate.Combine(gun.ShootPojectileAction, new Action(OnShoot)); } private void OnShoot(GameObject projectile) { //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) ProjectileHit projectileHit = projectile.GetComponent(); if ((Object)(object)projectileHit == (Object)null) { return; } Player ownPlayer = projectileHit.ownPlayer; if ((Object)(object)ownPlayer == (Object)null || (Object)(object)ownPlayer.data == (Object)null) { return; } GameObject ownWeapon = projectileHit.ownWeapon; Gun val = ((ownWeapon != null) ? ownWeapon.GetComponent() : null); if ((Object)(object)val == (Object)null) { return; } Gun val2 = ownPlayer.data.weaponHandler?.gun; if ((Object)(object)val2 == (Object)null || (Object)(object)val != (Object)(object)val2) { return; } if ((Object)(object)val2.shootPosition != (Object)null) { float playerSizeMultiplier = GetPlayerSizeMultiplier(ownPlayer); float num = 2f * playerSizeMultiplier; float num2 = Vector3.Distance(projectile.transform.position, val2.shootPosition.position); if (num2 > num) { return; } } projectileHit.AddHitActionWithData((Action)delegate(HitInfo hitInfo) { OnBulletHit(hitInfo, projectileHit); }); } private static float GetPlayerSizeMultiplier(Player player) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null || (Object)(object)player.data == (Object)null) { return 1f; } float num = 1f; if ((Object)(object)player.data.stats != (Object)null) { num = player.data.stats.sizeMultiplier; } float num2 = Mathf.Max(((Component)player).transform.localScale.x, ((Component)player).transform.localScale.y); if (num2 > num) { num = num2; } return Mathf.Max(1f, num); } private void OnBulletHit(HitInfo hitInfo, ProjectileHit projectileHit) { //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) Transform transform = hitInfo.transform; if ((Object)(object)((transform != null) ? ((Component)transform).GetComponent() : null) != (Object)null || (Object)(object)hitInfo.collider == (Object)null || (Object)(object)((Component)hitInfo.collider).gameObject == (Object)null) { return; } Player ownPlayer = projectileHit.ownPlayer; if ((Object)(object)ownPlayer == (Object)null || (Object)(object)ownPlayer.data == (Object)null) { return; } GameObject ownWeapon = projectileHit.ownWeapon; Gun val = ((ownWeapon != null) ? ownWeapon.GetComponent() : null); if (!((Object)(object)val == (Object)null)) { float num = val.damage * val.bulletDamageMultiplier * 55f; if (num > 400f) { val.projectileColor = Color.red; MapUtils.DestroyMapObject(((Component)hitInfo.collider).gameObject); } } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { gun.ShootPojectileAction = (Action)Delegate.Remove(gun.ShootPojectileAction, new Action(OnShoot)); } protected override string GetTitle() { return "Destroyer"; } protected override string GetDescription() { return "If you have more than 400 damage (727%) you will gain the ability to destroy objects with your bullets"; } protected override GameObject GetCardArt() { return Assets.DestroyerArt; } 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_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 = true, stat = "Damage", amount = "+50%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Bullet Speed", amount = "+50%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Reload Time", amount = "+0.25s", 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)0; } public override string GetModName() { return "DRON"; } } internal class DominionCard : CustomCard { [CompilerGenerated] private sealed class <>c__DisplayClass10_0 { public Player player; internal IEnumerator b__1(IGameModeHandler gm) { return EndBalancePick(player); } internal IEnumerator b__0(IGameModeHandler gm) { ((MonoBehaviour)MrFuntikMod.instance).StartCoroutine(BalancePick(player)); return new List().GetEnumerator(); } } [CompilerGenerated] private sealed class <>c__DisplayClass11_0 { public Player player; public Func <>9__0; internal bool b__0(int i) { return PlayerManager.instance.players[i].playerID == player.playerID; } } [CompilerGenerated] private sealed class d__10 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Player player; private <>c__DisplayClass10_0 <>8__1; private List 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass10_0(); <>8__1.player = player; break; case 1: <>1__state = -1; break; } if (!CardChoice.instance.IsPicking) { <>2__current = null; <>1__state = 1; return true; } if (CardChoice.instance.pickrID == <>8__1.player.playerID) { 5__2 = CharacterStatModifiersExtension.GetAdditionalData(<>8__1.player.data.stats).blacklistedCategories; if (5__2.Contains(MrFuntikMod.AuraCards)) { 5__2.Add(MrFuntikMod.NonAuraCards); 5__2.Remove(MrFuntikMod.AuraCards); } GameModeManager.AddOnceHook("PlayerPickEnd", (Func)((IGameModeHandler gm) => EndBalancePick(<>8__1.player))); 5__2 = null; } else { GameModeManager.AddOnceHook("PlayerPickStart", (Func)delegate { ((MonoBehaviour)MrFuntikMod.instance).StartCoroutine(BalancePick(<>8__1.player)); return new List().GetEnumerator(); }); } 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 d__12 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Player player; private List 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; 5__1 = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; if (!5__1.Contains(MrFuntikMod.AuraCards)) { 5__1.Add(MrFuntikMod.AuraCards); 5__1.Remove(MrFuntikMod.NonAuraCards); } 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 d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private Player[] 5__1; private int 5__2; private <>c__DisplayClass11_0 <>8__3; private int 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>8__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Expected O, but got Unknown //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Expected O, but got Unknown int num; switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = PlayerManager.instance.players.ToArray(); 5__2 = 0; goto IL_0217; case 1: <>1__state = -1; 5__4 = (from i in Enumerable.Range(0, PlayerManager.instance.players.Count) where PlayerManager.instance.players[i].playerID == <>8__3.player.playerID select i).First(); CardChoiceVisuals.instance.Show(5__4, 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_01d6; } IL_01d6: 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; num = 5__2 + 1; 5__2 = num; goto IL_0217; IL_0217: if (5__2 < 5__1.Length) { <>8__3 = new <>c__DisplayClass11_0(); <>8__3.player = 5__1[5__2]; goto IL_01d6; } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { Player player2 = player; characterStats.GetAdditionalData().shuffles++; GameModeManager.AddOnceHook("PlayerPickStart", (Func)delegate { ((MonoBehaviour)MrFuntikMod.instance).StartCoroutine(BalancePick(player2)); return new List().GetEnumerator(); }); } 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 "Dominion"; } protected override string GetDescription() { return "Pick a dominion aura to debuff enemies."; } 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)0; } protected override CardInfoStat[] GetStats() { return (CardInfoStat[])(object)new CardInfoStat[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)4; } public override string GetModName() { return "BFRM"; } [IteratorStateMachine(typeof(d__10))] public static IEnumerator BalancePick(Player player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0) { player = player }; } [IteratorStateMachine(typeof(d__11))] internal static IEnumerator ExtraPicks() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0); } [IteratorStateMachine(typeof(d__12))] public static IEnumerator EndBalancePick(Player player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0) { player = player }; } } public class EarthspearsCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { block.cdMultiplier += 0.75f; statModifiers.health = 1.4f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { EarthspearsEffect component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.stackCount++; return; } EarthspearsEffect earthspearsEffect = ((Component)player).gameObject.AddComponent(); earthspearsEffect.stackCount = 1; earthspearsEffect.owner = player; } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { EarthspearsEffect component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Earthspears"; } protected override string GetDescription() { return "Landing from heights creates damaging spikes; damage and radius increase by 20% per stack."; } protected override GameObject? GetCardArt() { return null; } protected override Rarity GetRarity() { 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_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 return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = false, stat = "Block Cooldown", amount = "+0.25s", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Health", amount = "+40%", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)0; } public override string GetModName() { return "BFRM"; } } public class EarthspearsEffect : MonoBehaviour { [CompilerGenerated] private sealed class d__29 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public EarthspearsEffect <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__29(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.effectWarmup = false; <>4__this.effectEnabled = true; <>4__this.hooksTriggered = true; <>4__this.maxFallSpeed = 0f; 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 d__30 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public EarthspearsEffect <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__30(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.effectEnabled = false; <>4__this.effectWarmup = true; <>4__this.maxFallSpeed = 0f; 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 d__28 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public EarthspearsEffect <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__28(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.effectEnabled = false; <>4__this.effectWarmup = true; <>4__this.hooksTriggered = true; <>4__this.maxFallSpeed = 0f; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public int stackCount = 1; public Player owner; private const float MIN_FALL_SPEED = 8f; private const float BASE_DAMAGE = 1f; private const float DAMAGE_PER_SPEED = 0.7f; private const float BASE_RADIUS = 1.7f; private const float RADIUS_PER_SPEED = 0.11f; private const float DAMAGE_MULT_PER_STACK = 1.2f; private const float RADIUS_MULT_PER_STACK = 1.2f; private const float MIN_AIR_TIME = 0.2f; private const float IMPACT_COOLDOWN = 0.5f; private static Dictionary lastImpactTimeByPlayer = new Dictionary(); private float maxFallSpeed = 0f; private bool isSubscribed = false; private bool effectEnabled = false; private bool effectWarmup = true; private bool hooksTriggered = false; private CharacterData data; private PlayerVelocity playerVel; private int playerId = -1; private static FieldInfo velocityField; private static Material sharedMaterial; private static Sprite cachedCircleSprite; private static Sprite cachedSpikeSprite; private static bool spritesInitialized = false; private void Awake() { GameModeManager.AddHook("PointStart", (Func)OnPointStart); GameModeManager.AddHook("BattleStart", (Func)OnBattleStart); GameModeManager.AddHook("PointEnd", (Func)OnPointEnd); } private void Start() { data = owner?.data; playerVel = data?.playerVel; playerId = owner?.playerID ?? (-1); if (velocityField == null) { velocityField = typeof(PlayerVelocity).GetField("velocity", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } InitializeSprites(); if ((Object)(object)data != (Object)null && !isSubscribed) { CharacterData obj = data; obj.TouchGroundAction = (Action)Delegate.Combine(obj.TouchGroundAction, new Action(OnTouchGround)); isSubscribed = true; } if (!lastImpactTimeByPlayer.ContainsKey(playerId)) { lastImpactTimeByPlayer[playerId] = -10f; } } private void OnDestroy() { GameModeManager.RemoveHook("PointStart", (Func)OnPointStart); GameModeManager.RemoveHook("BattleStart", (Func)OnBattleStart); GameModeManager.RemoveHook("PointEnd", (Func)OnPointEnd); if ((Object)(object)data != (Object)null && isSubscribed) { CharacterData obj = data; obj.TouchGroundAction = (Action)Delegate.Remove(obj.TouchGroundAction, new Action(OnTouchGround)); isSubscribed = false; } } [IteratorStateMachine(typeof(d__28))] private IEnumerator OnPointStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__28(0) { <>4__this = this, gm = gm }; } [IteratorStateMachine(typeof(d__29))] private IEnumerator OnBattleStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__29(0) { <>4__this = this, gm = gm }; } [IteratorStateMachine(typeof(d__30))] private IEnumerator OnPointEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__30(0) { <>4__this = this, gm = gm }; } private void InitializeSprites() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown if (!spritesInitialized) { if ((Object)(object)sharedMaterial == (Object)null) { sharedMaterial = new Material(Shader.Find("Sprites/Default")); } if ((Object)(object)cachedCircleSprite == (Object)null) { cachedCircleSprite = CreateCircleSprite(); } if ((Object)(object)cachedSpikeSprite == (Object)null) { cachedSpikeSprite = CreateSpikeSprite(); } spritesInitialized = true; } } private Vector2 GetVelocity() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)playerVel == (Object)null || velocityField == null) { return Vector2.zero; } return (Vector2)velocityField.GetValue(playerVel); } private void Update() { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) if (!hooksTriggered && (Object)(object)GameManager.instance != (Object)null && GameManager.instance.battleOngoing && !effectEnabled) { effectEnabled = true; effectWarmup = false; maxFallSpeed = 0f; } if (!effectEnabled || effectWarmup || (Object)(object)owner == (Object)null || (Object)(object)data == (Object)null || (Object)(object)playerVel == (Object)null || data.dead) { return; } Vector2 velocity = GetVelocity(); if (!data.isGrounded && velocity.y < -1f) { float num = Mathf.Abs(velocity.y); if (num > maxFallSpeed) { maxFallSpeed = num; } } } private void OnTouchGround(float sinceGrounded, Vector3 groundPos, Vector3 groundNormal, Transform groundTransform) { //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Expected O, but got Unknown //IL_01f4: Unknown result type (might be due to invalid IL or missing references) if (!effectEnabled || effectWarmup || (Object)(object)owner == (Object)null || (Object)(object)data == (Object)null || data.dead || sinceGrounded < 0.2f) { return; } float num = (lastImpactTimeByPlayer.ContainsKey(playerId) ? lastImpactTimeByPlayer[playerId] : (-10f)); if (Time.time < num + 0.5f) { return; } if (maxFallSpeed < 8f) { maxFallSpeed = 0f; return; } float num2 = maxFallSpeed; maxFallSpeed = 0f; lastImpactTimeByPlayer[playerId] = Time.time; float playerSizeMultiplier = GetPlayerSizeMultiplier(); Vector3 val = CorrectGroundPosition(groundPos, playerSizeMultiplier); Collider2D groundCollider = null; FindPlatformBounds(val, groundTransform, playerSizeMultiplier, out float leftBound, out float rightBound, out groundCollider); if (!((Object)(object)groundCollider == (Object)null)) { float num3 = Mathf.Pow(1.2f, (float)(stackCount - 1)); float num4 = Mathf.Pow(1.2f, (float)(stackCount - 1)); float num5 = num2 - 8f; float damage = (1f + num5 * 0.7f) * num3; float num6 = (1.7f + num5 * 0.11f) * num4; float num7 = val.x - leftBound; float num8 = rightBound - val.x; float num9 = Mathf.Min(num6, num7); float num10 = Mathf.Min(num6, num8); if (num9 < 0.3f) { num9 = 0.3f; } if (num10 < 0.3f) { num10 = 0.3f; } GameObject val2 = new GameObject("EarthspearsEffect"); EarthspearsEffectRunner earthspearsEffectRunner = val2.AddComponent(); earthspearsEffectRunner.StartEffect(val, num9, num10, num2, leftBound, rightBound, owner, damage, stackCount, cachedCircleSprite, cachedSpikeSprite, sharedMaterial, playerSizeMultiplier, groundCollider); } } private float GetPlayerSizeMultiplier() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)owner == (Object)null || (Object)(object)data == (Object)null) { return 1f; } float num = 1f; CharacterStatModifiers stats = data.stats; if ((Object)(object)stats != (Object)null) { num = stats.sizeMultiplier; } float num2 = Mathf.Max(((Component)owner).transform.localScale.x, ((Component)owner).transform.localScale.y); if (num2 > num) { num = num2; } return Mathf.Max(1f, num); } private Vector3 CorrectGroundPosition(Vector3 groundPos, float playerSize) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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) float num = 0.5f + playerSize * 0.5f; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(groundPos.x, groundPos.y + 0.2f); RaycastHit2D[] array = Physics2D.RaycastAll(val, Vector2.down, num); RaycastHit2D[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit2D hit = array2[i]; if (!((Object)(object)((RaycastHit2D)(ref hit)).collider == (Object)null) && !((RaycastHit2D)(ref hit)).collider.isTrigger && !((Object)(object)((Component)((RaycastHit2D)(ref hit)).collider).GetComponentInParent() != (Object)null) && IsValidSurface(hit)) { return new Vector3(groundPos.x, ((RaycastHit2D)(ref hit)).point.y, groundPos.z); } } return groundPos; } private void FindPlatformBounds(Vector3 groundPos, Transform groundTransform, float playerSize, out float leftBound, out float rightBound, out Collider2D groundCollider) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: 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_0158: 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) leftBound = groundPos.x - 20f; rightBound = groundPos.x + 20f; groundCollider = null; if ((Object)(object)groundTransform != (Object)null) { Collider2D component = ((Component)groundTransform).GetComponent(); if ((Object)(object)component != (Object)null && !component.isTrigger && IsValidSurfaceCollider(component)) { Bounds bounds = component.bounds; leftBound = ((Bounds)(ref bounds)).min.x; rightBound = ((Bounds)(ref bounds)).max.x; groundCollider = component; return; } } float num = 0.1f + (playerSize - 1f) * 0.2f; float num2 = 0.5f + (playerSize - 1f) * 0.3f; Vector2 val = Vector2.op_Implicit(groundPos + Vector3.up * num); RaycastHit2D[] array = Physics2D.RaycastAll(val, Vector2.down, num2); RaycastHit2D[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit2D hit = array2[i]; if (!((Object)(object)((RaycastHit2D)(ref hit)).collider == (Object)null) && !((RaycastHit2D)(ref hit)).collider.isTrigger && !((Object)(object)((Component)((RaycastHit2D)(ref hit)).collider).GetComponentInParent() != (Object)null) && IsValidSurface(hit)) { Bounds bounds2 = ((RaycastHit2D)(ref hit)).collider.bounds; leftBound = ((Bounds)(ref bounds2)).min.x; rightBound = ((Bounds)(ref bounds2)).max.x; groundCollider = ((RaycastHit2D)(ref hit)).collider; break; } } } private bool IsValidSurfaceCollider(Collider2D collider) { if ((Object)(object)collider == (Object)null || collider.isTrigger) { return false; } GameObject gameObject = ((Component)collider).gameObject; string text = LayerMask.LayerToName(gameObject.layer); if (text == "BackgroundObject") { return false; } if (((Object)gameObject).name.Contains("_BG")) { return false; } if ((Object)(object)((Component)collider).GetComponent() != (Object)null) { return false; } if ((Object)(object)((Component)collider).GetComponentInParent() != (Object)null) { return false; } if ((Object)(object)((Component)collider).GetComponent() != (Object)null) { return false; } if ((Object)(object)((Component)collider).GetComponentInParent() != (Object)null) { return false; } if (text == "Projectile") { return false; } return true; } public static bool IsValidSurface(RaycastHit2D hit) { //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) Collider2D collider = ((RaycastHit2D)(ref hit)).collider; if ((Object)(object)collider == (Object)null || collider.isTrigger) { return false; } GameObject gameObject = ((Component)collider).gameObject; int layer = gameObject.layer; string text = LayerMask.LayerToName(layer); if (text == "BackgroundObject") { return false; } if (((Object)gameObject).name.Contains("_BG")) { return false; } if ((Object)(object)((Component)collider).GetComponent() != (Object)null) { return false; } if ((Object)(object)((Component)collider).GetComponentInParent() != (Object)null) { return false; } if ((Object)(object)((Component)collider).GetComponent() != (Object)null) { return false; } if ((Object)(object)((Component)collider).GetComponentInParent() != (Object)null) { return false; } if (text == "Projectile") { return false; } string text2 = ((Object)gameObject).name.ToLower(); if (text2.Contains("bullet") || text2.Contains("projectile") || text2.Contains("shot")) { return false; } Rigidbody2D attachedRigidbody = collider.attachedRigidbody; if ((Object)(object)attachedRigidbody != (Object)null) { Vector2 velocity = attachedRigidbody.velocity; if (((Vector2)(ref velocity)).sqrMagnitude > 100f) { return false; } } if ((Object)(object)((Component)collider).GetComponent() != (Object)null) { return false; } if ((Object)(object)((Component)collider).GetComponentInParent() != (Object)null) { return false; } return true; } private static Sprite CreateCircleSprite() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_00e1: 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_0082: 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) Texture2D val = new Texture2D(64, 64, (TextureFormat)4, false); Color[] array = (Color[])(object)new Color[4096]; float num = 32f; float num2 = 32f; for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { float num3 = (float)j - num; float num4 = (float)i - num; float num5 = Mathf.Sqrt(num3 * num3 + num4 * num4); float num6 = Mathf.Clamp01(1f - num5 / num2); num6 *= num6; array[i * 64 + j] = new Color(1f, 1f, 1f, num6); } } val.SetPixels(array); val.Apply(); ((Texture)val).filterMode = (FilterMode)1; return Sprite.Create(val, new Rect(0f, 0f, 64f, 64f), new Vector2(0.5f, 0.5f), 64f); } private static Sprite CreateSpikeSprite() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(32, 64, (TextureFormat)4, false); Color[] array = (Color[])(object)new Color[2048]; for (int i = 0; i < array.Length; i++) { array[i] = Color.clear; } float num = 16f; for (int j = 0; j < 64; j++) { float num2 = (float)j / 64f; float num3 = 16f * (1f - num2); for (int k = 0; k < 32; k++) { float num4 = Mathf.Abs((float)k - num); if (num4 <= num3) { float num5 = 1f - num4 / Mathf.Max(1f, num3); float num6 = 0.7f + num5 * 0.3f; num6 *= 0.6f + num2 * 0.4f; float num7 = Mathf.Clamp01((num3 - num4) * 2f); array[j * 32 + k] = new Color(num6, num6, num6, num7); } } } val.SetPixels(array); val.Apply(); ((Texture)val).filterMode = (FilterMode)1; return Sprite.Create(val, new Rect(0f, 0f, 32f, 64f), new Vector2(0.5f, 0f), 64f); } } public class EarthspearsEffectRunner : MonoBehaviour { private class SpikeInfo { public GameObject obj; public SpriteRenderer sprite; public float targetHeight; public float width; public float delay; } private class ParticleInfo { public GameObject obj; public SpriteRenderer sprite; public Vector2 velocity; } [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Vector3 impactPos; public float leftRadius; public float rightRadius; public float fallSpeed; public float leftBound; public float rightBound; public Player owner; public float damage; public int stackCount; public Sprite circleSprite; public Sprite spikeSprite; public Material material; public Collider2D groundCollider; public EarthspearsEffectRunner <>4__this; private float 5__1; private Vector3 5__2; private float 5__3; private List 5__4; private GameObject 5__5; private SpriteRenderer 5__6; private List 5__7; private int 5__8; private int 5__9; private float 5__10; private float 5__11; private Vector2 5__12; private Vector2 5__13; private float 5__14; private float 5__15; private List 5__16; private int 5__17; private float 5__18; private float 5__19; private float 5__20; private float 5__21; private float 5__22; private float 5__23; private int 5__24; private float 5__25; private float 5__26; private float 5__27; private Vector2 5__28; private Vector2 5__29; private float 5__30; private float 5__31; private float 5__32; private int 5__33; private float 5__34; private float 5__35; private float 5__36; private Vector2 5__37; private Vector2 5__38; private float 5__39; private float 5__40; private float 5__41; private int 5__42; private GameObject 5__43; private SpriteRenderer 5__44; private float 5__45; private float 5__46; private float 5__47; private float 5__48; private float 5__49; private Color 5__50; private List.Enumerator <>s__51; private SpikeInfo 5__52; private float 5__53; private float 5__54; private float 5__55; private Color 5__56; private float

5__57; private float

5__58; private List.Enumerator <>s__59; private ParticleInfo

5__60; private float 5__61; private Color 5__62; private List.Enumerator <>s__63; private GameObject 5__64; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__4 = null; 5__5 = null; 5__6 = null; 5__7 = null; 5__16 = null; 5__43 = null; 5__44 = null; <>s__51 = default(List.Enumerator); 5__52 = null; <>s__59 = default(List.Enumerator);

5__60 = null; <>s__63 = default(List.Enumerator); 5__64 = null; <>1__state = -2; } private bool MoveNext() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_0932: Unknown result type (might be due to invalid IL or missing references) //IL_0944: Unknown result type (might be due to invalid IL or missing references) //IL_0949: Unknown result type (might be due to invalid IL or missing references) //IL_096c: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_063e: Unknown result type (might be due to invalid IL or missing references) //IL_0648: Expected O, but got Unknown //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_0672: Unknown result type (might be due to invalid IL or missing references) //IL_0677: Unknown result type (might be due to invalid IL or missing references) //IL_06d1: Unknown result type (might be due to invalid IL or missing references) //IL_070a: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Unknown result type (might be due to invalid IL or missing references) //IL_07af: Unknown result type (might be due to invalid IL or missing references) //IL_07ba: Unknown result type (might be due to invalid IL or missing references) //IL_07bf: Unknown result type (might be due to invalid IL or missing references) //IL_0809: Unknown result type (might be due to invalid IL or missing references) //IL_0584: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_0a0e: Unknown result type (might be due to invalid IL or missing references) //IL_0b6e: Unknown result type (might be due to invalid IL or missing references) //IL_0b85: Unknown result type (might be due to invalid IL or missing references) //IL_0b8a: Unknown result type (might be due to invalid IL or missing references) //IL_0bac: Unknown result type (might be due to invalid IL or missing references) //IL_0c3c: Unknown result type (might be due to invalid IL or missing references) //IL_0c41: Unknown result type (might be due to invalid IL or missing references) //IL_0c4b: Unknown result type (might be due to invalid IL or missing references) //IL_0c55: Unknown result type (might be due to invalid IL or missing references) //IL_0c5a: Unknown result type (might be due to invalid IL or missing references) //IL_0c5f: Unknown result type (might be due to invalid IL or missing references) //IL_0c75: Unknown result type (might be due to invalid IL or missing references) //IL_0c80: Unknown result type (might be due to invalid IL or missing references) //IL_0c85: Unknown result type (might be due to invalid IL or missing references) //IL_0c8f: Unknown result type (might be due to invalid IL or missing references) //IL_0c94: Unknown result type (might be due to invalid IL or missing references) //IL_0cc4: Unknown result type (might be due to invalid IL or missing references) //IL_0cc9: Unknown result type (might be due to invalid IL or missing references) //IL_0ceb: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = (fallSpeed - 8f) / 20f; 5__2 = impactPos + Vector3.up * 0.05f; 5__3 = Mathf.Max(leftRadius, rightRadius); 5__4 = new List(); 5__5 = new GameObject("EarthspearsFlash"); 5__5.transform.position = 5__2; 5__6 = 5__5.AddComponent(); 5__6.sprite = circleSprite; ((Renderer)5__6).material = material; 5__6.color = new Color(1f, 0.6f, 0.2f, 1f); ((Renderer)5__6).sortingOrder = 110; 5__5.transform.localScale = Vector3.one * 0.1f; 5__4.Add(5__5); 5__7 = new List(); 5__8 = Mathf.Max(2, (int)(leftRadius * 4f)); 5__9 = Mathf.Max(2, (int)(rightRadius * 4f)); 5__10 = 0.6f + 5__1 * 1f; 5__11 = -9999f; if (<>4__this.TryFindSurfaceAt(impactPos.x, impactPos.y, -9999f, groundCollider, out 5__12, out 5__13)) { 5__23 = 5__10 * Random.Range(0.9f, 1.1f); <>4__this.CreateSpike(5__12, 5__13, 5__23, 5__1, 0f, spikeSprite, material, 5__4, 5__7); 5__11 = 5__12.y; } 5__14 = ((5__11 > -9999f) ? 5__11 : impactPos.y); 5__24 = 0; while (5__24 < 5__8) { 5__25 = (float)(5__24 + 1) / (float)5__8; 5__26 = (0f - leftRadius) * 5__25; 5__27 = impactPos.x + 5__26; if (!(5__27 < leftBound + 0.1f) && !<>4__this.HasObstacleBetween(impactPos, 5__27) && <>4__this.TryFindSurfaceAt(5__27, impactPos.y, 5__14, groundCollider, out 5__28, out 5__29)) { 5__30 = Mathf.Abs(5__26) / Mathf.Max(0.1f, leftRadius); 5__31 = 1f - 5__30 * 5__30; 5__32 = 5__10 * Mathf.Max(0.15f, 5__31) * Random.Range(0.85f, 1.15f); <>4__this.CreateSpike(5__28, 5__29, 5__32, 5__1, 5__30, spikeSprite, material, 5__4, 5__7); 5__14 = 5__28.y; } 5__24++; } 5__15 = ((5__11 > -9999f) ? 5__11 : impactPos.y); 5__33 = 0; while (5__33 < 5__9) { 5__34 = (float)(5__33 + 1) / (float)5__9; 5__35 = rightRadius * 5__34; 5__36 = impactPos.x + 5__35; if (!(5__36 > rightBound - 0.1f) && !<>4__this.HasObstacleBetween(impactPos, 5__36) && <>4__this.TryFindSurfaceAt(5__36, impactPos.y, 5__15, groundCollider, out 5__37, out 5__38)) { 5__39 = Mathf.Abs(5__35) / Mathf.Max(0.1f, rightRadius); 5__40 = 1f - 5__39 * 5__39; 5__41 = 5__10 * Mathf.Max(0.15f, 5__40) * Random.Range(0.85f, 1.15f); <>4__this.CreateSpike(5__37, 5__38, 5__41, 5__1, 5__39, spikeSprite, material, 5__4, 5__7); 5__15 = 5__37.y; } 5__33++; } 5__16 = new List(); 5__17 = 8 + (int)(5__1 * 10f); 5__42 = 0; while (5__42 < 5__17) { 5__43 = new GameObject($"Debris_{5__42}"); 5__43.transform.position = 5__2 + new Vector3(Random.Range(-0.5f, 0.5f), 0.1f, 0f); 5__44 = 5__43.AddComponent(); 5__44.sprite = circleSprite; ((Renderer)5__44).material = material; 5__44.color = new Color(0.6f, 0.5f, 0.4f, 1f); ((Renderer)5__44).sortingOrder = 115; 5__45 = Random.Range(0.04f, 0.1f); 5__43.transform.localScale = Vector3.one * 5__45; 5__46 = Random.Range(30f, 150f) * (MathF.PI / 180f); 5__47 = Random.Range(2f, 5f) * (1f + 5__1 * 0.5f); 5__4.Add(5__43); 5__16.Add(new ParticleInfo { obj = 5__43, sprite = 5__44, velocity = new Vector2(Mathf.Cos(5__46), Mathf.Sin(5__46)) * 5__47 }); 5__43 = null; 5__44 = null; 5__42++; } <>4__this.DealDamage(impactPos, damage, 5__3, owner); 5__18 = 0.08f; 5__19 = 0.35f; 5__20 = 0.15f; 5__21 = 5__18 + 5__19 + 5__20 + 0.05f; 5__22 = 0f; break; case 1: <>1__state = -1; break; } if (5__22 < 5__21 && !((Object)(object)GameManager.instance == (Object)null) && GameManager.instance.battleOngoing) { 5__22 += Time.deltaTime; if ((Object)(object)5__5 != (Object)null) { 5__48 = Mathf.Clamp01(5__22 / 0.15f); 5__49 = Mathf.Sin(5__48 * MathF.PI) * (0.8f + 5__1 * 0.6f); 5__5.transform.localScale = new Vector3(5__49 * 2f, 5__49 * 0.5f, 1f); 5__50 = 5__6.color; 5__50.a = 1f - 5__48; 5__6.color = 5__50; } <>s__51 = 5__7.GetEnumerator(); try { while (<>s__51.MoveNext()) { 5__52 = <>s__51.Current; if ((Object)(object)5__52.obj == (Object)null) { continue; } 5__53 = 5__22 - 5__52.delay; if (5__53 < 0f) { 5__52.obj.transform.localScale = new Vector3(5__52.width, 0.01f, 1f); continue; } 5__55 = 1f; if (5__53 < 5__18) {

5__57 = 5__53 / 5__18;

5__57 = 1f - Mathf.Pow(1f -

5__57, 3f); 5__54 = 5__52.targetHeight *

5__57; } else if (5__53 < 5__18 + 5__19) { 5__54 = 5__52.targetHeight; } else {

5__58 = (5__53 - 5__18 - 5__19) / 5__20;

5__58 = Mathf.Clamp01(

5__58);

5__58 *=

5__58; 5__54 = 5__52.targetHeight * (1f -

5__58); 5__55 = 1f -

5__58 * 0.5f; } 5__52.obj.transform.localScale = new Vector3(5__52.width, Mathf.Max(0.01f, 5__54), 1f); 5__56 = 5__52.sprite.color; 5__56.a = 5__55; 5__52.sprite.color = 5__56; 5__52 = null; } } finally { ((IDisposable)<>s__51).Dispose(); } <>s__51 = default(List.Enumerator); <>s__59 = 5__16.GetEnumerator(); try { while (<>s__59.MoveNext()) {

5__60 = <>s__59.Current; if (!((Object)(object)

5__60.obj == (Object)null)) { ParticleInfo particleInfo =

5__60; particleInfo.velocity += Vector2.down * 15f * Time.deltaTime; Transform transform =

5__60.obj.transform; transform.position += Vector2.op_Implicit(

5__60.velocity) * Time.deltaTime; 5__61 = 1f - 5__22 / 5__21; 5__62 =

5__60.sprite.color; 5__62.a = 5__61;

5__60.sprite.color = 5__62;

5__60 = null; } } } finally { ((IDisposable)<>s__59).Dispose(); } <>s__59 = default(List.Enumerator); <>2__current = null; <>1__state = 1; return true; } <>s__63 = 5__4.GetEnumerator(); try { while (<>s__63.MoveNext()) { 5__64 = <>s__63.Current; if ((Object)(object)5__64 != (Object)null) { Object.Destroy((Object)(object)5__64); } 5__64 = null; } } finally { ((IDisposable)<>s__63).Dispose(); } <>s__63 = default(List.Enumerator); Object.Destroy((Object)(object)((Component)<>4__this).gameObject); 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 float playerSize = 1f; public void StartEffect(Vector3 impactPos, float leftRadius, float rightRadius, float fallSpeed, float leftBound, float rightBound, Player owner, float damage, int stackCount, Sprite circleSprite, Sprite spikeSprite, Material material, float playerSize, Collider2D groundCollider) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) this.playerSize = playerSize; ((MonoBehaviour)this).StartCoroutine(RunEffect(impactPos, leftRadius, rightRadius, fallSpeed, leftBound, rightBound, owner, damage, stackCount, circleSprite, spikeSprite, material, groundCollider)); } private bool HasObstacleBetween(Vector3 impactPos, float spikeX) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_012e: Unknown result type (might be due to invalid IL or missing references) float num = 0.5f + (playerSize - 1f) * 0.2f; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(impactPos.x, impactPos.y + num); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(spikeX, impactPos.y + num); Vector2 val3 = val2 - val; Vector2 normalized = ((Vector2)(ref val3)).normalized; float num2 = Mathf.Abs(spikeX - impactPos.x); if (num2 < 0.1f) { return false; } RaycastHit2D[] array = Physics2D.RaycastAll(val, normalized, num2); RaycastHit2D[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit2D val4 = array2[i]; if (!((Object)(object)((RaycastHit2D)(ref val4)).collider == (Object)null) && !((RaycastHit2D)(ref val4)).collider.isTrigger && !((Object)(object)((Component)((RaycastHit2D)(ref val4)).collider).GetComponentInParent() != (Object)null)) { string text = LayerMask.LayerToName(((Component)((RaycastHit2D)(ref val4)).collider).gameObject.layer); if (!(text == "BackgroundObject") && !((Object)((Component)((RaycastHit2D)(ref val4)).collider).gameObject).name.Contains("_BG") && !(Mathf.Abs(((RaycastHit2D)(ref val4)).normal.x) < 0.7f)) { return true; } } } return false; } private bool TryFindSurfaceAt(float spikeX, float groundY, float lastFoundY, Collider2D targetCollider, out Vector2 surfacePoint, out Vector2 surfaceNormal) { //IL_0003: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0163: 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_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) surfacePoint = Vector2.zero; surfaceNormal = Vector2.up; if ((Object)(object)targetCollider == (Object)null) { return false; } float num = ((lastFoundY > -9999f) ? lastFoundY : groundY); float num2 = 1.5f + (playerSize - 1f) * 0.5f; float num3 = 3f + (playerSize - 1f) * 0.5f; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(spikeX, num + num2); Vector2[] obj = new Vector2[3] { Vector2.down, default(Vector2), default(Vector2) }; Vector2 val2 = new Vector2(-0.3f, -1f); obj[1] = ((Vector2)(ref val2)).normalized; val2 = new Vector2(0.3f, -1f); obj[2] = ((Vector2)(ref val2)).normalized; Vector2[] array = (Vector2[])(object)obj; Vector2[] array2 = array; foreach (Vector2 val3 in array2) { RaycastHit2D[] array3 = Physics2D.RaycastAll(val, val3, num3); RaycastHit2D[] array4 = array3; for (int j = 0; j < array4.Length; j++) { RaycastHit2D val4 = array4[j]; if (!((Object)(object)((RaycastHit2D)(ref val4)).collider == (Object)null) && !((RaycastHit2D)(ref val4)).collider.isTrigger && !((Object)(object)((RaycastHit2D)(ref val4)).collider != (Object)(object)targetCollider) && !(((RaycastHit2D)(ref val4)).normal.y < 0.25f)) { surfacePoint = ((RaycastHit2D)(ref val4)).point; surfaceNormal = ((RaycastHit2D)(ref val4)).normal; return true; } } } return false; } [IteratorStateMachine(typeof(d__4))] private IEnumerator RunEffect(Vector3 impactPos, float leftRadius, float rightRadius, float fallSpeed, float leftBound, float rightBound, Player owner, float damage, int stackCount, Sprite circleSprite, Sprite spikeSprite, Material material, Collider2D groundCollider) { //IL_000e: 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) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this, impactPos = impactPos, leftRadius = leftRadius, rightRadius = rightRadius, fallSpeed = fallSpeed, leftBound = leftBound, rightBound = rightBound, owner = owner, damage = damage, stackCount = stackCount, circleSprite = circleSprite, spikeSprite = spikeSprite, material = material, groundCollider = groundCollider }; } private float GetMaxAllowedHeight(Vector2 position, Vector2 normal, float desiredHeight) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) Vector2 val = position + normal * 0.05f; RaycastHit2D[] array = Physics2D.RaycastAll(val, normal, desiredHeight + 0.1f); float num = desiredHeight; RaycastHit2D[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit2D val2 = array2[i]; if ((Object)(object)((RaycastHit2D)(ref val2)).collider == (Object)null || ((RaycastHit2D)(ref val2)).collider.isTrigger || (Object)(object)((Component)((RaycastHit2D)(ref val2)).collider).GetComponentInParent() != (Object)null) { continue; } string text = LayerMask.LayerToName(((Component)((RaycastHit2D)(ref val2)).collider).gameObject.layer); if (!(text == "BackgroundObject") && !((Object)((Component)((RaycastHit2D)(ref val2)).collider).gameObject).name.Contains("_BG") && !((Object)(object)((Component)((RaycastHit2D)(ref val2)).collider).GetComponent() != (Object)null) && !((Object)(object)((Component)((RaycastHit2D)(ref val2)).collider).GetComponentInParent() != (Object)null) && !(text == "Projectile")) { float num2 = ((RaycastHit2D)(ref val2)).distance - 0.05f; if (num2 < num) { num = num2; } } } return Mathf.Max(0.1f, num); } private void CreateSpike(Vector2 position, Vector2 normal, float targetHeight, float intensity, float distFromCenter, Sprite spikeSprite, Material material, List allObjects, List spikes) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0038: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_0129: Unknown result type (might be due to invalid IL or missing references) float maxAllowedHeight = GetMaxAllowedHeight(position, normal, targetHeight); float num = Mathf.Min(targetHeight, maxAllowedHeight); if (!(num < 0.15f)) { GameObject val = new GameObject("Spike"); val.transform.position = new Vector3(position.x, position.y + 0.01f, 0f); float num2 = Mathf.Atan2(normal.y, normal.x) * 57.29578f - 90f; num2 += Random.Range(-6f, 6f); val.transform.rotation = Quaternion.Euler(0f, 0f, num2); SpriteRenderer val2 = val.AddComponent(); val2.sprite = spikeSprite; ((Renderer)val2).material = material; ((Renderer)val2).sortingOrder = 105; float num3 = Random.Range(-0.1f, 0.1f); val2.color = new Color(0.55f + num3, 0.45f + num3, 0.35f + num3, 1f); float num4 = 0.18f + intensity * 0.08f; val.transform.localScale = new Vector3(num4, 0.01f, 1f); allObjects.Add(val); spikes.Add(new SpikeInfo { obj = val, sprite = val2, targetHeight = num, width = num4, delay = distFromCenter * 0.04f }); } } private void DealDamage(Vector3 impactPos, float damage, float radius, Player owner) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) List players = PlayerManager.instance.players; for (int i = 0; i < players.Count; i++) { Player val = players[i]; if (!((Object)(object)val == (Object)null) && !((Object)(object)val == (Object)(object)owner) && !val.data.dead && ((Component)val).gameObject.activeInHierarchy) { Vector2 playerFeetPosition = GetPlayerFeetPosition(val); float num = Vector2.Distance(Vector2.op_Implicit(impactPos), playerFeetPosition); if (num <= radius) { float num2 = 1f - num / radius; float num3 = damage * num2; Vector2 val2 = playerFeetPosition - Vector2.op_Implicit(impactPos); Vector2 normalized = ((Vector2)(ref val2)).normalized; ((Damagable)val.data.healthHandler).CallTakeDamage(normalized * num3, Vector2.op_Implicit(impactPos), (GameObject)null, owner, true); } } } } private Vector2 GetPlayerFeetPosition(Player player) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_009d: 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) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) Vector2 val = Vector2.op_Implicit(((Component)player).transform.position); float num = 1f; if ((Object)(object)player.data != (Object)null && (Object)(object)player.data.stats != (Object)null) { num = player.data.stats.sizeMultiplier; } float num2 = Mathf.Max(((Component)player).transform.localScale.x, ((Component)player).transform.localScale.y); if (num2 > num) { num = num2; } float num3 = 0.5f * num; return new Vector2(val.x, val.y - num3); } } public class ExecutionerCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ExecutionerMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.AddStack(); return; } ExecutionerMono executionerMono = ((Component)player).gameObject.AddComponent(); executionerMono.stackCount = 1; } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ExecutionerMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.RemoveStack(); if (component.stackCount <= 0) { Object.Destroy((Object)(object)component); } } } protected override string GetTitle() { return "Executioner"; } protected override string GetDescription() { return "Your bullets have a small chance to instantly execute enemies."; } 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)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_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 return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Execute Chance", amount = "+2%", 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)4; } public override string GetModName() { return "BFRM"; } } public class ExtendedGuardCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ExtendedGuardMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.AddStack(); return; } ExtendedGuardMono extendedGuardMono = ((Component)player).gameObject.AddComponent(); extendedGuardMono.stackCount = 1; } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ExtendedGuardMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.RemoveStack(); if (component.stackCount <= 0) { Object.Destroy((Object)(object)component); } } } protected override string GetTitle() { return "Extended Guard"; } protected override string GetDescription() { return "Your blocks have a chance to last twice as long."; } 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)0; } 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 return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Crit Block Chance", amount = "25%", 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)2; } public override string GetModName() { return "BFRM"; } } public class FadeoutCard : CustomCard { public static GameObject objectToSpawn; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown if ((Object)(object)objectToSpawn == (Object)null) { objectToSpawn = new GameObject("FadeoutBulletModifier", new Type[1] { typeof(FadeoutBulletModifier) }); Object.DontDestroyOnLoad((Object)(object)objectToSpawn); } List list = gun.objectsToSpawn.ToList(); list.Add(new ObjectsToSpawn { AddToProjectile = objectToSpawn }); gun.objectsToSpawn = list.ToArray(); } 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 "Fadeout"; } protected override string GetDescription() { return "Your shots can plunge enemies into darkness."; } 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)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_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 return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Vision Obscure", amount = "50%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Effect Duration", amount = "3s", 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)4; } public override string GetModName() { return "BFRM"; } } public class FadeoutBulletModifier : RayHitEffect { private const float TRIGGER_CHANCE = 0.5f; private const float EFFECT_DURATION = 3f; private ProjectileHit projectileHit = null; private bool chanceRolled = false; private bool willTrigger = false; private SpriteRenderer bulletSprite = null; private TrailRenderer bulletTrail = null; private static readonly Color FADEOUT_COLOR = new Color(0.6f, 0.2f, 0.8f, 1f); private void Awake() { } private void Start() { projectileHit = ((Component)this).GetComponentInParent(); RollChance(); } private void RollChance() { if (chanceRolled) { return; } chanceRolled = true; PhotonView componentInParent = ((Component)this).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null && !componentInParent.IsMine) { return; } float value = Random.value; willTrigger = value <= 0.5f; if (willTrigger) { ApplyBulletColor(); if ((Object)(object)componentInParent != (Object)null) { NetworkingManager.RPC(typeof(FadeoutBulletModifier), "RPC_ColorBullet", new object[1] { componentInParent.ViewID }); } } } [UnboundRPC] public static void RPC_ColorBullet(int viewId) { if (viewId < 0) { return; } PhotonView val = PhotonView.Find(viewId); if (!((Object)(object)val == (Object)null)) { FadeoutBulletModifier componentInChildren = ((Component)val).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.willTrigger = true; componentInChildren.ApplyBulletColor(); } } } private void ApplyBulletColor() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) bulletSprite = ((Component)this).GetComponentInParent(); if ((Object)(object)bulletSprite == (Object)null) { Transform parent = ((Component)this).transform.parent; bulletSprite = ((parent != null) ? ((Component)parent).GetComponentInChildren() : null); } if ((Object)(object)bulletSprite != (Object)null) { bulletSprite.color = FADEOUT_COLOR; } bulletTrail = ((Component)this).GetComponentInParent(); if ((Object)(object)bulletTrail == (Object)null) { Transform parent2 = ((Component)this).transform.parent; bulletTrail = ((parent2 != null) ? ((Component)parent2).GetComponentInChildren() : null); } if ((Object)(object)bulletTrail != (Object)null) { bulletTrail.startColor = FADEOUT_COLOR; bulletTrail.endColor = new Color(FADEOUT_COLOR.r, FADEOUT_COLOR.g, FADEOUT_COLOR.b, 0f); } } public override HasToReturn DoHitEffect(HitInfo hit) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)hit.transform == (Object)null) { return (HasToReturn)1; } string tag = ((Component)hit.transform).gameObject.tag; if (tag.Contains("Bullet")) { return (HasToReturn)1; } Player val = ((Component)hit.transform).GetComponent(); if ((Object)(object)val == (Object)null) { val = ((Component)hit.transform).GetComponentInParent(); } if ((Object)(object)val == (Object)null) { return (HasToReturn)1; } if ((Object)(object)projectileHit == (Object)null) { projectileHit = ((Component)this).GetComponentInParent(); } if ((Object)(object)projectileHit == (Object)null || (Object)(object)projectileHit.ownPlayer == (Object)null) { return (HasToReturn)1; } PhotonView componentInParent = ((Component)this).GetComponentInParent(); if ((!((Object)(object)componentInParent != (Object)null) || componentInParent.IsMine) && willTrigger) { ApplyFadeoutEffectSynced(val.playerID, 3f); } return (HasToReturn)1; } private void ApplyFadeoutEffectSynced(int targetPlayerId, float duration) { NetworkingManager.RPC(typeof(FadeoutBulletModifier), "RPCA_ApplyFadeoutEffect", new object[2] { targetPlayerId, duration }); } private static Player GetPlayerByID(int playerID) { foreach (Player player in PlayerManager.instance.players) { if ((Object)(object)player != (Object)null && player.playerID == playerID) { return player; } } return null; } [UnboundRPC] public static void RPCA_ApplyFadeoutEffect(int targetPlayerId, float duration) { Player playerByID = GetPlayerByID(targetPlayerId); if (!((Object)(object)playerByID == (Object)null)) { FadeoutVisionEffect orAddComponent = ExtensionMethods.GetOrAddComponent(((Component)playerByID).gameObject, false); if (!((Object)(object)orAddComponent == (Object)null)) { orAddComponent.ApplyEffect(duration); } } } public void Destroy() { Object.Destroy((Object)(object)this); } } public class FadeoutStatusEffect : MonoBehaviour { [CompilerGenerated] private sealed class d__31 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public FadeoutStatusEffect <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__31(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ClearEffect(); 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 d__30 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public FadeoutStatusEffect <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__30(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ClearEffect(); 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 d__29 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public FadeoutStatusEffect <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__29(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ClearEffect(); 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 float EFFECT_HEIGHT = 0f; private const float EFFECT_BASE_SIZE = 0.45f; private const float EFFECT_SCALE_MULTIPLIER = 3f; private const float EFFECT_SIZE = 1.3499999f; private const float SCALE_IN_TIME = 0.15f; private const float SCALE_OUT_TIME = 0.2f; private static readonly Color ICON_COLOR = new Color(0.85f, 0.3f, 1f, 1f); private static readonly Color OUTLINE_COLOR = new Color(0.05f, 0f, 0.1f, 1f); private Player player; private CharacterData data; private GameObject effectRoot; private SpriteRenderer iconRenderer; private SpriteRenderer outlineRenderer; private static Texture2D eyeTexture; private static Sprite eyeSprite; private float effectTimer = 0f; private float currentScale = 0f; private float targetScale = 0f; private bool effectActive = false; private void Awake() { player = ((Component)this).GetComponent(); data = ((Component)this).GetComponent(); GameModeManager.AddHook("PointStart", (Func)OnPointStart); GameModeManager.AddHook("PointEnd", (Func)OnPointEnd); GameModeManager.AddHook("GameStart", (Func)OnGameStart); } private void Start() { CreateVisual(); } private static void CreateSharedTexture() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)eyeTexture != (Object)null) { return; } int num = 64; eyeTexture = new Texture2D(num, num, (TextureFormat)4, false); Color val = default(Color); ((Color)(ref val))..ctor(0f, 0f, 0f, 0f); for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { eyeTexture.SetPixel(j, i, val); } } float num2 = (float)num / 2f; float num3 = (float)num / 2f; float num4 = (float)num * 0.4f; float num5 = (float)num * 0.2f; float num6 = (float)num * 0.12f; float num7 = (float)num * 0.06f; for (int k = 0; k < num; k++) { for (int l = 0; l < num; l++) { float num8 = ((float)l - num2) / num4; float num9 = ((float)k - num3) / num5; float num10 = Mathf.Abs(num8) + num9 * num9; if (num10 > 0.7f && num10 < 1f) { float num11 = 1f - Mathf.Abs(num10 - 0.85f) / 0.15f; SetPixelBlend(l, k, Mathf.Clamp01(num11)); } float num12 = Mathf.Sqrt(((float)l - num2) * ((float)l - num2) + ((float)k - num3) * ((float)k - num3)); if (num12 < num6) { float alpha = 1f - num12 / num6 * 0.3f; SetPixelBlend(l, k, alpha); } } } float num13 = -MathF.PI / 4f; float num14 = Mathf.Cos(num13); float num15 = Mathf.Sin(num13); for (int m = 0; m < num; m++) { for (int n = 0; n < num; n++) { float num16 = (float)n - num2; float num17 = (float)m - num3; float num18 = (0f - num16) * num15 + num17 * num14; float num19 = Mathf.Abs(num18); if (num19 < num7) { float num20 = num16 * num14 + num17 * num15; if (Mathf.Abs(num20) < (float)num * 0.38f) { float num21 = 1f - num19 / num7; num21 = Mathf.Pow(num21, 0.5f); SetPixelBlend(n, m, num21); } } } } eyeTexture.Apply(); ((Texture)eyeTexture).filterMode = (FilterMode)1; ((Texture)eyeTexture).wrapMode = (TextureWrapMode)1; eyeSprite = Sprite.Create(eyeTexture, new Rect(0f, 0f, (float)num, (float)num), new Vector2(0.5f, 0.5f), (float)num); } private static void SetPixelBlend(int x, int y, float alpha) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) Color pixel = eyeTexture.GetPixel(x, y); float num = Mathf.Max(pixel.a, alpha); eyeTexture.SetPixel(x, y, new Color(1f, 1f, 1f, num)); } private void CreateVisual() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Expected O, but got Unknown //IL_0184: 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_019f: 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) if (!((Object)(object)effectRoot != (Object)null) && !((Object)(object)player == (Object)null)) { CreateSharedTexture(); if (!((Object)(object)eyeSprite == (Object)null)) { effectRoot = new GameObject($"FadeoutEffect_P{player.playerID}"); effectRoot.transform.SetParent(((Component)this).transform); effectRoot.transform.localPosition = new Vector3(0f, 0f, 0f); effectRoot.transform.localScale = Vector3.zero; GameObject val = new GameObject("Outline"); val.transform.SetParent(effectRoot.transform); val.transform.localPosition = Vector3.zero; val.transform.localScale = Vector3.one * 1.62f; outlineRenderer = val.AddComponent(); outlineRenderer.sprite = eyeSprite; outlineRenderer.color = OUTLINE_COLOR; ((Renderer)outlineRenderer).sortingLayerName = "MostFront"; ((Renderer)outlineRenderer).sortingOrder = 999; GameObject val2 = new GameObject("Icon"); val2.transform.SetParent(effectRoot.transform); val2.transform.localPosition = Vector3.zero; val2.transform.localScale = Vector3.one * 1.3499999f; iconRenderer = val2.AddComponent(); iconRenderer.sprite = eyeSprite; iconRenderer.color = ICON_COLOR; ((Renderer)iconRenderer).sortingLayerName = "MostFront"; ((Renderer)iconRenderer).sortingOrder = 1000; effectRoot.SetActive(false); } } } public void ApplyEffect(float duration) { if ((Object)(object)player == (Object)null) { player = ((Component)this).GetComponent(); } if ((Object)(object)data == (Object)null) { data = ((Component)this).GetComponent(); } if ((Object)(object)player == (Object)null || ((Object)(object)data != (Object)null && data.dead)) { return; } if ((Object)(object)effectRoot == (Object)null) { CreateVisual(); } if (!((Object)(object)effectRoot == (Object)null)) { effectTimer = Mathf.Max(effectTimer, duration); targetScale = 1f; if (!effectActive) { effectActive = true; effectRoot.SetActive(true); } } } private void Update() { //IL_00f1: 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) if ((Object)(object)effectRoot == (Object)null) { return; } if ((Object)(object)data != (Object)null && data.dead) { if (effectActive) { ClearEffect(); } return; } if (effectActive && effectTimer > 0f) { effectTimer -= Time.deltaTime; if (effectTimer <= 0f) { effectTimer = 0f; targetScale = 0f; } } float num = ((targetScale > currentScale) ? 6.6666665f : 5f); currentScale = Mathf.MoveTowards(currentScale, targetScale, num * Time.deltaTime); effectRoot.transform.localScale = Vector3.one * currentScale; if (currentScale <= 0.01f && targetScale <= 0f) { effectActive = false; effectRoot.SetActive(false); currentScale = 0f; } } public void ClearEffect() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) effectTimer = 0f; targetScale = 0f; currentScale = 0f; effectActive = false; if ((Object)(object)effectRoot != (Object)null) { effectRoot.transform.localScale = Vector3.zero; effectRoot.SetActive(false); } } public bool IsActive() { return effectActive; } public float GetRemainingTime() { return effectTimer; } [IteratorStateMachine(typeof(d__29))] private IEnumerator OnPointStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__29(0) { <>4__this = this, gm = gm }; } [IteratorStateMachine(typeof(d__30))] private IEnumerator OnPointEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__30(0) { <>4__this = this, gm = gm }; } [IteratorStateMachine(typeof(d__31))] private IEnumerator OnGameStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__31(0) { <>4__this = this, gm = gm }; } private void OnDisable() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)effectRoot != (Object)null) { effectRoot.transform.localScale = Vector3.zero; } ClearEffect(); } private void OnDestroy() { GameModeManager.RemoveHook("PointStart", (Func)OnPointStart); GameModeManager.RemoveHook("PointEnd", (Func)OnPointEnd); GameModeManager.RemoveHook("GameStart", (Func)OnGameStart); if ((Object)(object)effectRoot != (Object)null) { Object.Destroy((Object)(object)effectRoot); } } } public class FadeoutVisionEffect : MonoBehaviour { [CompilerGenerated] private sealed class d__30 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public FadeoutVisionEffect <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__30(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ClearEffect(); 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 d__29 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public FadeoutVisionEffect <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__29(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ClearEffect(); 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 d__28 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public FadeoutVisionEffect <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__28(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ClearEffect(); 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 float CLEAR_RADIUS = 5f; private const float FADE_WIDTH = 3f; private const float SPRITE_SIZE = 500f; private const float FADE_IN_TIME = 0.3f; private const float FADE_OUT_TIME = 0.5f; private const float MAX_OPACITY = 1f; private Player player; private CharacterData data; private GameObject vignetteObject; private SpriteRenderer vignetteRenderer; private Texture2D vignetteTexture; private FadeoutStatusEffect statusEffect; private float effectTimer = 0f; private float currentIntensity = 0f; private float targetIntensity = 0f; private bool effectActive = false; private bool isInitialized = false; private void Awake() { player = ((Component)this).GetComponent(); data = ((Component)this).GetComponent(); GameModeManager.AddHook("PointStart", (Func)OnPointStart); GameModeManager.AddHook("PointEnd", (Func)OnPointEnd); GameModeManager.AddHook("GameStart", (Func)OnGameStart); if ((Object)(object)data != (Object)null && (Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive)); } statusEffect = ExtensionMethods.GetOrAddComponent(((Component)this).gameObject, false); } private void OnRevive() { ClearEffect(); } private void Start() { if ((Object)(object)player != (Object)null && (Object)(object)player.data != (Object)null && (Object)(object)player.data.view != (Object)null && player.data.view.IsMine) { CreateVignetteVisual(); } else { isInitialized = true; } } private void CreateVignetteVisual() { //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)vignetteObject != (Object)null) && !((Object)(object)player == (Object)null)) { if ((Object)(object)player.data == (Object)null || (Object)(object)player.data.view == (Object)null || !player.data.view.IsMine) { isInitialized = true; return; } vignetteObject = new GameObject($"FadeoutVignette_Player{player.playerID}"); vignetteRenderer = vignetteObject.AddComponent(); int num = 256; vignetteTexture = CreateVignetteTexture(num); float num2 = (float)num / 500f; Sprite sprite = Sprite.Create(vignetteTexture, new Rect(0f, 0f, (float)num, (float)num), new Vector2(0.5f, 0.5f), num2); vignetteRenderer.sprite = sprite; ((Renderer)vignetteRenderer).sortingLayerName = "MostFront"; ((Renderer)vignetteRenderer).sortingOrder = 30000; Color color = vignetteRenderer.color; color.a = 0f; vignetteRenderer.color = color; vignetteObject.SetActive(false); isInitialized = true; } } private Texture2D CreateVignetteTexture(int size) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(size, size, (TextureFormat)4, false); float num = (float)size / 2f; float num2 = (float)size / 500f; float num3 = 5f * num2; float num4 = 8f * num2; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num5 = (float)j - num; float num6 = (float)i - num; float num7 = Mathf.Sqrt(num5 * num5 + num6 * num6); float num8; if (num7 <= num3) { num8 = 0f; } else if (num7 <= num4) { float num9 = (num7 - num3) / (num4 - num3); num8 = num9 * num9 * (3f - 2f * num9); } else { num8 = 1f; } val.SetPixel(j, i, new Color(0.01f, 0.01f, 0.03f, num8)); } } val.Apply(); ((Texture)val).filterMode = (FilterMode)1; ((Texture)val).wrapMode = (TextureWrapMode)1; return val; } public void ApplyEffect(float duration) { //IL_0175: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { player = ((Component)this).GetComponent(); } if ((Object)(object)data == (Object)null) { data = ((Component)this).GetComponent(); } if ((Object)(object)player == (Object)null || (Object)(object)player.data == (Object)null || (Object)(object)player.data.view == (Object)null || ((Object)(object)data != (Object)null && data.dead)) { return; } effectTimer = Mathf.Max(effectTimer, duration); targetIntensity = 1f; effectActive = true; if ((Object)(object)statusEffect == (Object)null) { statusEffect = ExtensionMethods.GetOrAddComponent(((Component)this).gameObject, false); } if ((Object)(object)statusEffect != (Object)null) { statusEffect.ApplyEffect(duration); } if (player.data.view.IsMine) { if (!isInitialized) { CreateVignetteVisual(); } if ((Object)(object)vignetteObject != (Object)null) { vignetteObject.SetActive(true); vignetteObject.transform.position = ((Component)this).transform.position; } } } private void Update() { //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: 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) if ((Object)(object)player == (Object)null || (Object)(object)player.data == (Object)null || (Object)(object)player.data.view == (Object)null || !player.data.view.IsMine || !isInitialized || (Object)(object)vignetteRenderer == (Object)null) { return; } if ((Object)(object)data != (Object)null && data.dead) { HideVignette(); } else { if (!effectActive && currentIntensity <= 0.01f) { return; } if (effectActive && effectTimer > 0f) { effectTimer -= Time.deltaTime; if (effectTimer <= 0f) { effectTimer = 0f; targetIntensity = 0f; effectActive = false; } } float num = ((targetIntensity > currentIntensity) ? 3.3333333f : 2f); currentIntensity = Mathf.MoveTowards(currentIntensity, targetIntensity, num * Time.deltaTime); if ((Object)(object)vignetteRenderer != (Object)null) { Color color = vignetteRenderer.color; color.a = currentIntensity * 1f; vignetteRenderer.color = color; } if (currentIntensity <= 0.01f && !effectActive) { HideVignette(); } if ((Object)(object)vignetteObject != (Object)null && vignetteObject.activeSelf) { vignetteObject.transform.position = ((Component)this).transform.position; } } } private void HideVignette() { if ((Object)(object)vignetteObject != (Object)null && vignetteObject.activeSelf) { vignetteObject.SetActive(false); } } public void ClearEffect() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) effectTimer = 0f; targetIntensity = 0f; effectActive = false; currentIntensity = 0f; if ((Object)(object)vignetteRenderer != (Object)null) { Color color = vignetteRenderer.color; color.a = 0f; vignetteRenderer.color = color; } HideVignette(); if ((Object)(object)statusEffect != (Object)null) { statusEffect.ClearEffect(); } } public bool IsActive() { return effectActive && currentIntensity > 0.1f; } public float GetRemainingTime() { return effectTimer; } [IteratorStateMachine(typeof(d__28))] private IEnumerator OnPointStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__28(0) { <>4__this = this, gm = gm }; } [IteratorStateMachine(typeof(d__29))] private IEnumerator OnPointEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__29(0) { <>4__this = this, gm = gm }; } [IteratorStateMachine(typeof(d__30))] private IEnumerator OnGameStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__30(0) { <>4__this = this, gm = gm }; } private void OnDestroy() { if ((Object)(object)data != (Object)null && (Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive)); } GameModeManager.RemoveHook("PointStart", (Func)OnPointStart); GameModeManager.RemoveHook("PointEnd", (Func)OnPointEnd); GameModeManager.RemoveHook("GameStart", (Func)OnGameStart); if ((Object)(object)vignetteObject != (Object)null) { Object.Destroy((Object)(object)vignetteObject); } if ((Object)(object)vignetteTexture != (Object)null) { Object.Destroy((Object)(object)vignetteTexture); } } private void OnDisable() { ClearEffect(); } } internal class FinisherCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { FinisherEffect.AddStack(player); if ((Object)(object)((Component)player).gameObject.GetComponent() == (Object)null) { ((Component)player).gameObject.AddComponent(); } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { FinisherEffect.RemoveStack(player); } protected override string GetTitle() { return "Finisher"; } protected override string GetDescription() { return "Gives buffs when there is an enemy with 30% HP or lower."; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { 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_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 //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[4] { new CardInfoStat { positive = true, stat = "Life steal", amount = "+100%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Move Speed", amount = "+50%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Bullet Speed", amount = "+50%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Ammo", amount = "+100%", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)0; } public override string GetModName() { return "BFRM"; } } public class FinisherEffect : ReversibleEffect { [CompilerGenerated] private sealed class d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public FinisherEffect <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; ClearAllStacks(); 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 static Dictionary playerStacks = new Dictionary(); private bool visualActive; private ColorEffect colorEffect; private readonly Color effectColor = new Color(1f, 0.15f, 0.1f, 0.35f); private ParticleSystem bloodParticles; private GameObject bloodParticlesObj; private float checkTimer; private const float CHECK_INTERVAL = 0.1f; private bool anyEnemyLowHP; private bool firstCheckDone; private int CurrentStacks => GetStacks(base.player); public static void AddStack(Player player) { if (!((Object)(object)player == (Object)null)) { if (!playerStacks.ContainsKey(player.playerID)) { playerStacks[player.playerID] = 0; } playerStacks[player.playerID]++; } } public static void RemoveStack(Player player) { if (!((Object)(object)player == (Object)null) && playerStacks.ContainsKey(player.playerID)) { playerStacks[player.playerID]--; if (playerStacks[player.playerID] <= 0) { playerStacks.Remove(player.playerID); } } } public static int GetStacks(Player player) { if ((Object)(object)player == (Object)null) { return 0; } int value; return playerStacks.TryGetValue(player.playerID, out value) ? value : 0; } public static void ClearAllStacks() { playerStacks.Clear(); } public override void OnAwake() { ((ReversibleEffect)this).SetLivesToEffect(int.MaxValue); GameModeManager.AddHook("GameEnd", (Func)OnGameEnd); } [IteratorStateMachine(typeof(d__17))] private IEnumerator OnGameEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0) { <>4__this = this, gm = gm }; } public override void OnStart() { base.applyImmediately = false; visualActive = false; anyEnemyLowHP = false; firstCheckDone = false; checkTimer = 0f; CreateBloodParticles(); } public override void OnOnEnable() { if (((ReversibleEffect)this).modifiersActive) { ((ReversibleEffect)this).ClearModifiers(true); } RemoveVisuals(); visualActive = false; anyEnemyLowHP = false; firstCheckDone = false; checkTimer = 0f; } public override void OnUpdate() { if ((Object)(object)base.data == (Object)null || CurrentStacks <= 0) { return; } checkTimer += TimeHandler.deltaTime; if (checkTimer >= 0.1f) { checkTimer = 0f; anyEnemyLowHP = CheckAnyEnemyLowHP(); firstCheckDone = true; } if (!firstCheckDone) { return; } if (anyEnemyLowHP) { if (!((ReversibleEffect)this).modifiersActive) { SetupModifiers(); ((ReversibleEffect)this).ApplyModifiers(); } if (!visualActive) { ApplyVisuals(); visualActive = true; } } else { if (((ReversibleEffect)this).modifiersActive) { ((ReversibleEffect)this).ClearModifiers(true); } if (visualActive) { RemoveVisuals(); visualActive = false; } } } private bool CheckAnyEnemyLowHP() { if ((Object)(object)base.player == (Object)null || (Object)(object)PlayerManager.instance == (Object)null) { return false; } for (int i = 0; i < PlayerManager.instance.players.Count; i++) { Player val = PlayerManager.instance.players[i]; if (!((Object)(object)val == (Object)null) && val.teamID != base.player.teamID && !((Object)(object)val.data == (Object)null) && !val.data.dead && ((Component)val).gameObject.activeInHierarchy && val.data.maxHealth > 0f && val.data.health > 0f) { float num = val.data.health / val.data.maxHealth; if (num < 0.3f) { return true; } } } return false; } private void SetupModifiers() { int currentStacks = CurrentStacks; if (currentStacks > 0) { base.characterStatModifiersModifier.lifeSteal_add = 1f * (float)currentStacks; base.characterStatModifiersModifier.movementSpeed_mult = 1f + 0.5f * (float)currentStacks; base.gunStatModifier.projectileSpeed_mult = 1f + 0.5f * (float)currentStacks; base.gunAmmoStatModifier.maxAmmo_mult = 1 + currentStacks; } } private void CreateBloodParticles() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_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_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Expected O, but got Unknown //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Expected O, but got Unknown //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: 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_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)bloodParticlesObj != (Object)null)) { bloodParticlesObj = new GameObject("FinisherBloodParticles"); bloodParticlesObj.transform.SetParent(((Component)base.player).transform); bloodParticlesObj.transform.localPosition = Vector3.zero; bloodParticles = bloodParticlesObj.AddComponent(); MainModule main = bloodParticles.main; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.4f, 0.8f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(1.5f, 3f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.05f, 0.15f); ((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(0.8f, 0.05f, 0.05f, 1f), new Color(1f, 0.2f, 0.1f, 1f)); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).maxParticles = 100; ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(-0.3f); EmissionModule emission = bloodParticles.emission; ((EmissionModule)(ref emission)).enabled = true; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(25f); ShapeModule shape = bloodParticles.shape; ((ShapeModule)(ref shape)).enabled = true; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)10; ((ShapeModule)(ref shape)).radius = 0.4f; SizeOverLifetimeModule sizeOverLifetime = bloodParticles.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true; AnimationCurve val = new AnimationCurve(); val.AddKey(0f, 0.5f); val.AddKey(0.3f, 1f); val.AddKey(1f, 0f); ((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, val); ColorOverLifetimeModule colorOverLifetime = bloodParticles.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val2 = new Gradient(); val2.SetKeys((GradientColorKey[])(object)new GradientColorKey[3] { new GradientColorKey(new Color(1f, 0.2f, 0.1f), 0f), new GradientColorKey(new Color(0.8f, 0.05f, 0f), 0.5f), new GradientColorKey(new Color(0.4f, 0f, 0f), 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(0.9f, 0f), new GradientAlphaKey(0.6f, 0.5f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val2); ParticleSystemRenderer component = bloodParticlesObj.GetComponent(); ((Renderer)component).sortingLayerName = "MostFront"; ((Renderer)component).sortingOrder = 100; ((Renderer)component).material = GetParticleMaterial(); bloodParticlesObj.SetActive(false); } } private Material GetParticleMaterial() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) Material val = new Material(Shader.Find("Sprites/Default")); val.color = new Color(1f, 0.15f, 0.1f, 1f); return val; } private void ApplyVisuals() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)colorEffect == (Object)null) { colorEffect = ((Component)base.player).gameObject.AddComponent(); colorEffect.SetColor(effectColor); } if ((Object)(object)bloodParticlesObj != (Object)null) { bloodParticlesObj.SetActive(true); } if ((Object)(object)bloodParticles != (Object)null && !bloodParticles.isPlaying) { bloodParticles.Play(true); } } private void RemoveVisuals() { if ((Object)(object)colorEffect != (Object)null) { Object.Destroy((Object)(object)colorEffect); colorEffect = null; } if ((Object)(object)bloodParticles != (Object)null) { bloodParticles.Stop(true, (ParticleSystemStopBehavior)0); bloodParticles.Clear(true); } if ((Object)(object)bloodParticlesObj != (Object)null) { bloodParticlesObj.SetActive(false); } } public override void OnOnDisable() { if (((ReversibleEffect)this).modifiersActive) { ((ReversibleEffect)this).ClearModifiers(true); } RemoveVisuals(); visualActive = false; anyEnemyLowHP = false; } public override void OnOnDestroy() { RemoveVisuals(); if ((Object)(object)bloodParticlesObj != (Object)null) { Object.Destroy((Object)(object)bloodParticlesObj); bloodParticlesObj = null; bloodParticles = null; } GameModeManager.RemoveHook("GameEnd", (Func)OnGameEnd); } } internal class FragileStrengthCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { MaxHealthEffect.AddStack(player); if ((Object)(object)((Component)player).gameObject.GetComponent() == (Object)null) { ((Component)player).gameObject.AddComponent(); } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { MaxHealthEffect.RemoveStack(player); } protected override string GetTitle() { return "Fragile Strength"; } protected override string GetDescription() { return "Gives you great strength, but if you get hit, it's gone.\nAt full hp:"; } protected override GameObject GetCardArt() { return Assets.FragileStrengthArt; } protected override Rarity GetRarity() { 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_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 //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[4] { new CardInfoStat { positive = true, stat = "Damage", amount = "+75%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Attack Speed", amount = "+50%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Bullet Speed", amount = "+75%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Ammo", amount = "+100%", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)7; } public override string GetModName() { return "IS"; } } public class MaxHealthEffect : ReversibleEffect { [CompilerGenerated] private sealed class d__13 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public MaxHealthEffect <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; ClearAllStacks(); 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 static Dictionary playerStacks = new Dictionary(); private int framesAfterRespawn; private const int PROTECTION_FRAMES = 3; private bool visualActive; private ColorEffect colorEffect; private readonly Color effectColor = new Color(1f, 1f, 1f, 0.3f); private int CurrentStacks => GetStacks(base.player); public static void AddStack(Player player) { if (!((Object)(object)player == (Object)null)) { if (!playerStacks.ContainsKey(player.playerID)) { playerStacks[player.playerID] = 0; } playerStacks[player.playerID]++; } } public static void RemoveStack(Player player) { if (!((Object)(object)player == (Object)null) && playerStacks.ContainsKey(player.playerID)) { playerStacks[player.playerID]--; if (playerStacks[player.playerID] <= 0) { playerStacks.Remove(player.playerID); } } } public static int GetStacks(Player player) { if ((Object)(object)player == (Object)null) { return 0; } int value; return playerStacks.TryGetValue(player.playerID, out value) ? value : 0; } public static void ClearAllStacks() { playerStacks.Clear(); } public override void OnAwake() { ((ReversibleEffect)this).SetLivesToEffect(int.MaxValue); GameModeManager.AddHook("GameEnd", (Func)OnGameEnd); } [IteratorStateMachine(typeof(d__13))] private IEnumerator OnGameEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0) { <>4__this = this, gm = gm }; } public override void OnStart() { base.applyImmediately = false; visualActive = false; framesAfterRespawn = 0; } public override void OnOnEnable() { visualActive = false; framesAfterRespawn = 0; } public override void OnUpdate() { if ((Object)(object)base.data == (Object)null || CurrentStacks <= 0) { return; } if (framesAfterRespawn < 3) { framesAfterRespawn++; if (!((ReversibleEffect)this).modifiersActive) { SetupModifiers(); ((ReversibleEffect)this).ApplyModifiers(); } if (!visualActive) { ApplyColorEffect(); visualActive = true; } } else if (HealthIsFull()) { if (!((ReversibleEffect)this).modifiersActive) { SetupModifiers(); ((ReversibleEffect)this).ApplyModifiers(); } if (!visualActive) { ApplyColorEffect(); visualActive = true; } } else { if (((ReversibleEffect)this).modifiersActive) { ((ReversibleEffect)this).ClearModifiers(true); } if (visualActive) { RemoveColorEffect(); visualActive = false; } } } private void SetupModifiers() { int currentStacks = CurrentStacks; if (currentStacks > 0) { base.gunStatModifier.damage_mult = 1f + 0.75f * (float)currentStacks; base.gunStatModifier.attackSpeed_mult = 1f / (1f + 0.5f * (float)currentStacks); base.gunStatModifier.projectileSpeed_mult = 1f + 0.75f * (float)currentStacks; base.gunAmmoStatModifier.maxAmmo_mult = 1 + currentStacks; } } private bool HealthIsFull() { return (Object)(object)base.data != (Object)null && base.data.health >= base.data.maxHealth * 0.999f; } private void ApplyColorEffect() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)colorEffect == (Object)null) { colorEffect = ((Component)base.player).gameObject.AddComponent(); colorEffect.SetColor(effectColor); } } private void RemoveColorEffect() { if ((Object)(object)colorEffect != (Object)null) { Object.Destroy((Object)(object)colorEffect); colorEffect = null; } } public override void OnOnDisable() { if (((ReversibleEffect)this).modifiersActive) { ((ReversibleEffect)this).ClearModifiers(true); } RemoveColorEffect(); visualActive = false; } public override void OnOnDestroy() { RemoveColorEffect(); GameModeManager.RemoveHook("GameEnd", (Func)OnGameEnd); } } public class FriendlyBounceCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { statModifiers.health = 1.2f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { gun.reflects++; FriendlyBulletsDealtDamageEffect orAddComponent = ExtensionMethods.GetOrAddComponent(((Component)player).gameObject, false); orAddComponent.multiplier *= 0.6f; characterStats.WasUpdated(); } 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 "Friendly Bounce"; } protected override string GetDescription() { return null; } protected override GameObject GetCardArt() { return Assets.FriendlyBounceArt; } 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)0; } 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 = true, stat = "Health", amount = "+20%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Friendly Fire", amount = "-40%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Bounce", amount = "+1", 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)5; } public override string GetModName() { return "DRON"; } } public class GravitySurgeCard : CustomCard { public static CardInfo cardInfoSelf; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { MrFuntikMod.GravitySurgeCategory }; cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { if ((Object)(object)((Component)player).gameObject.GetComponent() == (Object)null) { ((Component)player).gameObject.AddComponent(); } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { GravitySurgeMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Gravity Surge"; } protected override string GetDescription() { return "Requires Planet\nBlock to unleash a massive gravitational pull."; } protected override GameObject GetCardArt() { return null; } 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("Hidden"); } 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 return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Duration", amount = "0.5s", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Cooldown", amount = "20s", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) return CardThemeLib.instance.CreateOrGetType("Hidden", (CardThemeColor)null); } public override string GetModName() { return "BFRM"; } } internal class GymBossCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = false; gun.damage = 1.5f; gun.projectileSpeed = 2f; gun.reloadTimeAdd = 3f; statModifiers.health = 1.75f; statModifiers.movementSpeed = 0.5f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { block.cdAdd += 3f; } 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 "Gym Boss"; } protected override string GetDescription() { return "You become the boss of this gym."; } protected override GameObject GetCardArt() { return Assets.GymBossArt; } 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 //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_00e5: 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_00f1: 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_0107: 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_010f: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[6] { new CardInfoStat { positive = true, stat = "Damage", amount = "+50%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Health", amount = "+75%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Bullet Speed", amount = "+100%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Reload Time", amount = "+3s", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Block Cooldawn", amount = "+3s", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Move Speed", amount = "-50%", 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)0; } public override string GetModName() { return "IS"; } } internal class HealMeCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { statModifiers.health = 0.4f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ((Component)player).gameObject.AddComponent(); } 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 "Heal me"; } protected override string GetDescription() { return null; } protected override GameObject GetCardArt() { return Assets.HealMeArt; } 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)0; } 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 return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Life Regen", amount = "+20", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Health", amount = "-60%", 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)5; } public override string GetModName() { return "DRON"; } } public class ImmunityAntiRadarCard : CustomCard { private static readonly Dictionary _immunityCache = new Dictionary(); public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { CardCategory val = CustomCardCategories.instance.CardCategory("ImmunityCards"); cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { val }; cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { _immunityCache[player.playerID] = true; ImmunityHelper.CheckUnlockImmunityMaster(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { _immunityCache.Remove(player.playerID); ImmunityHelper.CheckLockImmunityMaster(player); } protected override string GetTitle() { return "Immunity: Anti Radar"; } protected override string GetDescription() { return "Ignored by homing and tracking.\nAuto-Targeting Immunity"; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)0; } protected override CardInfoStat[] GetStats() { return (CardInfoStat[])(object)new CardInfoStat[0]; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)2; } public override string GetModName() { return "BFRM"; } public static bool HasImmunity(Player player) { if ((Object)(object)player == (Object)null) { return false; } if (_immunityCache.TryGetValue(player.playerID, out var value)) { return value; } if (player.data?.currentCards == null) { return false; } bool flag = player.data.currentCards.Any((CardInfo c) => (Object)(object)c != (Object)null && c.cardName == "Anti Radar"); _immunityCache[player.playerID] = flag; return flag; } public static void ClearCache() { _immunityCache.Clear(); } } public class ImmunityControlledFireCard : CustomCard { public static CardInfo cardInfoSelf; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { MrFuntikMod.ImmunityMasterCategory }; cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { if ((Object)(object)((Component)player).gameObject.GetComponent() == (Object)null) { ((Component)player).gameObject.AddComponent(); } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { SafemodeEffect component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Immunity: Controlled Fire"; } protected override string GetDescription() { return "Any Immunity + Any Immunity\nYou are unaffected by your own fire.\nBullet Self Damage Immunity"; } protected override GameObject GetCardArt() { return null; } 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("Hidden"); } protected override CardInfoStat[] GetStats() { return (CardInfoStat[])(object)new CardInfoStat[0]; } protected override CardThemeColorType GetTheme() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) return CardThemeLib.instance.CreateOrGetType("Hidden", (CardThemeColor)null); } public override string GetModName() { return "BFRM"; } } public class SafemodeEffect : MonoBehaviour { } [HarmonyPatch(typeof(HealthHandler))] public class SafemodePatch { private static float lastEffectTime; private const float EFFECT_COOLDOWN = 0.15f; [HarmonyPrefix] [HarmonyPriority(600)] [HarmonyPatch("CallTakeDamage")] private static bool CallTakeDamage_BlockBulletSelfDamage(HealthHandler __instance, Vector2 damage, Vector2 position, GameObject damagingWeapon, Player damagingPlayer, bool lethal, Player ___player) { if ((Object)(object)damagingPlayer == (Object)null) { return true; } if ((Object)(object)damagingPlayer != (Object)(object)___player) { return true; } if ((Object)(object)damagingWeapon == (Object)null) { return true; } SafemodeEffect component = ((Component)___player).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } PlayResistEffect(___player); return false; } private static void PlayResistEffect(Player player) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (!(Time.time - lastEffectTime < 0.15f)) { lastEffectTime = Time.time; Color color = default(Color); ((Color)(ref color))..ctor(1f, 0.8f, 0.3f, 1f); ShieldEffect.PlayShieldEffect(player, color, 0.8f); } } } public class ImmunityMomentumCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { CardCategory val = CustomCardCategories.instance.CardCategory("ImmunityCards"); cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { val }; cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { if ((Object)(object)((Component)player).gameObject.GetComponent() == (Object)null) { ((Component)player).gameObject.AddComponent(); } ImmunityHelper.CheckUnlockImmunityMaster(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AntiSlowMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } ImmunityHelper.CheckLockImmunityMaster(player); } protected override string GetTitle() { return "Immunity: Momentum"; } protected override string GetDescription() { return "Nothing can slow you down.\nSlow Immunity"; } 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)0; } protected override CardInfoStat[] GetStats() { return (CardInfoStat[])(object)new CardInfoStat[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)2; } public override string GetModName() { return "BFRM"; } } public class ImmunityRootedCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { CardCategory val = CustomCardCategories.instance.CardCategory("ImmunityCards"); cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { val }; cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { if ((Object)(object)((Component)player).gameObject.GetComponent() == (Object)null) { ((Component)player).gameObject.AddComponent(); } ImmunityHelper.CheckUnlockImmunityMaster(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AntiKnockbackMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } ImmunityHelper.CheckLockImmunityMaster(player); } protected override string GetTitle() { return "Immunity: Rooted"; } protected override string GetDescription() { return "Forces cannot push you back.\nKnockback Immunity"; } 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)0; } protected override CardInfoStat[] GetStats() { return (CardInfoStat[])(object)new CardInfoStat[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)2; } public override string GetModName() { return "BFRM"; } } public class ImmunitySafetyDetonatorCard : CustomCard { public static CardInfo cardInfoSelf; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { CardCategory val = CustomCardCategories.instance.CardCategory("ImmunityCards"); cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { val }; cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { if ((Object)(object)((Component)player).gameObject.GetComponent() == (Object)null) { ((Component)player).gameObject.AddComponent(); } ImmunityHelper.CheckUnlockImmunityMaster(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ExplosionImmunityEffect component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } ImmunityHelper.CheckLockImmunityMaster(player); } protected override string GetTitle() { return "Immunity: Safety Detonator"; } protected override string GetDescription() { return "You are unaffected by your own blasts.\nExplosion Self Damage Immunity"; } 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)0; } protected override CardInfoStat[] GetStats() { return (CardInfoStat[])(object)new CardInfoStat[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)2; } public override string GetModName() { return "BFRM"; } } public class ExplosionImmunityEffect : MonoBehaviour { } public static class ExplosionDamageContext { [ThreadStatic] private static bool _isExplosionDamage; [ThreadStatic] private static Player _explosionOwner; public static bool IsExplosionDamage => _isExplosionDamage; public static Player ExplosionOwner => _explosionOwner; public static void SetExplosionContext(Player owner) { _isExplosionDamage = true; _explosionOwner = owner; } public static void ClearContext() { _isExplosionDamage = false; _explosionOwner = null; } } [HarmonyPatch(typeof(Explosion))] public class ExplosionContextPatch { [HarmonyPrefix] [HarmonyPriority(800)] [HarmonyPatch("DoExplosionEffects")] private static void DoExplosionEffects_SetContext(Explosion __instance) { SpawnedAttack component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.spawner != (Object)null) { ExplosionDamageContext.SetExplosionContext(component.spawner); } } [HarmonyFinalizer] [HarmonyPatch("DoExplosionEffects")] private static void DoExplosionEffects_ClearContext() { ExplosionDamageContext.ClearContext(); } } [HarmonyPatch(typeof(HealthHandler))] public class ExplosionImmunityDamagePatch { private static float lastEffectTime; private const float EFFECT_COOLDOWN = 0.15f; [HarmonyPrefix] [HarmonyPriority(601)] [HarmonyPatch("CallTakeDamage")] private static bool CallTakeDamage_BlockExplosionSelfDamage(HealthHandler __instance, Vector2 damage, Vector2 position, GameObject damagingWeapon, Player damagingPlayer, bool lethal, Player ___player) { if (!ExplosionDamageContext.IsExplosionDamage) { return true; } Player explosionOwner = ExplosionDamageContext.ExplosionOwner; if ((Object)(object)explosionOwner == (Object)null) { return true; } if ((Object)(object)___player != (Object)(object)explosionOwner) { return true; } ExplosionImmunityEffect component = ((Component)explosionOwner).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } PlayResistEffect(explosionOwner); return false; } private static void PlayResistEffect(Player player) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (!(Time.time - lastEffectTime < 0.15f)) { lastEffectTime = Time.time; Color color = default(Color); ((Color)(ref color))..ctor(1f, 0.5f, 0.2f, 1f); ShieldEffect.PlayShieldEffect(player, color); } } } public class ImmunitySonicRiotCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { CardCategory val = CustomCardCategories.instance.CardCategory("ImmunityCards"); cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { val }; cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { if ((Object)(object)((Component)player).GetComponent() == (Object)null) { ((Component)player).gameObject.AddComponent(); } ImmunityHelper.CheckUnlockImmunityMaster(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AntiSilenceMono component = ((Component)player).GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } ImmunityHelper.CheckLockImmunityMaster(player); } protected override string GetTitle() { return "Immunity: Sonic Riot"; } protected override string GetDescription() { return "You cannot be muted.\nSilence Immunity"; } protected override GameObject? GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)0; } protected override CardInfoStat[] GetStats() { return (CardInfoStat[])(object)new CardInfoStat[0]; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)2; } public override string GetModName() { return "BFRM"; } } internal class ImmunityUnstoppableCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { CardCategory val = CustomCardCategories.instance.CardCategory("ImmunityCards"); cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { val }; cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { if ((Object)(object)((Component)player).gameObject.GetComponent() == (Object)null) { ((Component)player).gameObject.AddComponent(); } ImmunityHelper.CheckUnlockImmunityMaster(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AntiStunMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } ImmunityHelper.CheckLockImmunityMaster(player); } protected override string GetTitle() { return "Immunity: Unstoppable"; } protected override string GetDescription() { return "You cannot be forced to stop.\nStun Immunity"; } 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)0; } protected override CardInfoStat[] GetStats() { return (CardInfoStat[])(object)new CardInfoStat[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)2; } public override string GetModName() { return "BFRM"; } } internal class ImmunizeCard : CustomCard { [CompilerGenerated] private sealed class <>c__DisplayClass10_0 { public Player player; internal IEnumerator b__1(IGameModeHandler gm) { return EndBalancePick(player); } internal IEnumerator b__0(IGameModeHandler gm) { ((MonoBehaviour)MrFuntikMod.instance).StartCoroutine(BalancePick(player)); return new List().GetEnumerator(); } } [CompilerGenerated] private sealed class <>c__DisplayClass11_0 { public Player player; public Func <>9__0; internal bool b__0(int i) { return PlayerManager.instance.players[i].playerID == player.playerID; } } [CompilerGenerated] private sealed class d__10 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Player player; private <>c__DisplayClass10_0 <>8__1; private List 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass10_0(); <>8__1.player = player; break; case 1: <>1__state = -1; break; } if (!CardChoice.instance.IsPicking) { <>2__current = null; <>1__state = 1; return true; } if (CardChoice.instance.pickrID == <>8__1.player.playerID) { 5__2 = CharacterStatModifiersExtension.GetAdditionalData(<>8__1.player.data.stats).blacklistedCategories; if (5__2.Contains(MrFuntikMod.ImmunityCards)) { 5__2.Add(MrFuntikMod.NonImmunityCards); 5__2.Remove(MrFuntikMod.ImmunityCards); } GameModeManager.AddOnceHook("PlayerPickEnd", (Func)((IGameModeHandler gm) => EndBalancePick(<>8__1.player))); 5__2 = null; } else { GameModeManager.AddOnceHook("PlayerPickStart", (Func)delegate { ((MonoBehaviour)MrFuntikMod.instance).StartCoroutine(BalancePick(<>8__1.player)); return new List().GetEnumerator(); }); } 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 d__12 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Player player; private List 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; 5__1 = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; if (!5__1.Contains(MrFuntikMod.ImmunityCards)) { 5__1.Add(MrFuntikMod.ImmunityCards); 5__1.Remove(MrFuntikMod.NonImmunityCards); } 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 d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private Player[] 5__1; private int 5__2; private <>c__DisplayClass11_0 <>8__3; private int 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>8__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Expected O, but got Unknown //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Expected O, but got Unknown int num; switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = PlayerManager.instance.players.ToArray(); 5__2 = 0; goto IL_0217; case 1: <>1__state = -1; 5__4 = (from i in Enumerable.Range(0, PlayerManager.instance.players.Count) where PlayerManager.instance.players[i].playerID == <>8__3.player.playerID select i).First(); CardChoiceVisuals.instance.Show(5__4, 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_01d6; } IL_01d6: 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; num = 5__2 + 1; 5__2 = num; goto IL_0217; IL_0217: if (5__2 < 5__1.Length) { <>8__3 = new <>c__DisplayClass11_0(); <>8__3.player = 5__1[5__2]; goto IL_01d6; } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { Player player2 = player; characterStats.GetAdditionalData().shuffles++; GameModeManager.AddOnceHook("PlayerPickStart", (Func)delegate { ((MonoBehaviour)MrFuntikMod.instance).StartCoroutine(BalancePick(player2)); return new List().GetEnumerator(); }); } 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 "Immunize"; } protected override string GetDescription() { return "Pick an immunity to gain protection."; } 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)0; } protected override CardInfoStat[] GetStats() { return (CardInfoStat[])(object)new CardInfoStat[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)2; } public override string GetModName() { return "BFRM"; } [IteratorStateMachine(typeof(d__10))] public static IEnumerator BalancePick(Player player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0) { player = player }; } [IteratorStateMachine(typeof(d__11))] internal static IEnumerator ExtraPicks() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0); } [IteratorStateMachine(typeof(d__12))] public static IEnumerator EndBalancePick(Player player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0) { player = player }; } } public class ItBecomesAllCard : CustomCard { public const string CardName = "It Becomes ALL"; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = false; statModifiers.health = 1.05f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { if ((Object)(object)PlayerManager.instance == (Object)null || PlayerManager.instance.players == null || PlayerManager.instance.players.Count == 0 || !PlayerManager.instance.players.Contains(player)) { return; } if (NothingTimerManager.HasItBecomesAll(player)) { MrFuntikMod.Log($"[ItBecomesAllCard] Player {player.playerID}: reinventarization, skipping"); return; } MrFuntikMod.Log($"[ItBecomesAllCard] Player {player.playerID}: first time adding card"); NothingTimerManager.SetHasItBecomesAll(player, value: true); int timerCount = NothingTimerManager.GetTimerCount(player); if (timerCount > 0) { MrFuntikMod.Log($"[ItBecomesAllCard] Player {player.playerID}: transforming {timerCount} existing Nothing cards to All"); NothingTimerManager.TransformAllNothingsToAll(player); } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { if (NothingTimerManager.IsInReplaceOperation(player)) { MrFuntikMod.Log($"[ItBecomesAllCard] Player {player.playerID}: OnRemoveCard during replace operation, keeping flag"); return; } NothingTimerManager.SetHasItBecomesAll(player, value: false); MrFuntikMod.Log($"[ItBecomesAllCard] Player {player.playerID}: card removed, flag reset"); } protected override string GetTitle() { return "It Becomes ALL"; } protected override string GetDescription() { return "Transform all 'Nothing' cards into 'All' cards."; } protected override GameObject GetCardArt() { return Assets.ItBecomesAllArt; } 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_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 return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Health", amount = "+5%", 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 "IS"; } } internal class JumperCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { statModifiers.movementSpeed = 1.3f; statModifiers.jump = 1.4f; statModifiers.gravity = 1.4f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "Jumper"; } protected override string GetDescription() { return "Jump to the sky!"; } protected override GameObject GetCardArt() { return Assets.JumperArt; } 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)0; } 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 = true, stat = "Move Speed", amount = "+30%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Jump Height", amount = "+40%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Gravity", amount = "+40%", 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)6; } public override string GetModName() { return "DRON"; } } public class KamikazeCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ((Component)player).gameObject.AddComponent(); PhoenixSurgeHelper.CheckUnlockPhoenixSurge(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { PhoenixSurgeHelper.CheckLockPhoenixSurge(player); } protected override string GetTitle() { return "Kamikaze"; } protected override string GetDescription() { return "Explode on Death"; } protected override GameObject GetCardArt() { return Assets.KamikazeArt; } 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() { return (CardInfoStat[])(object)new CardInfoStat[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)0; } public override string GetModName() { return "DRON"; } } public class MinigunCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { gun.ammo = 20; gun.reloadTimeAdd = 10f; gun.damage = 0.15f; gun.attackSpeed = 0.1f; gun.spread = 0f; gun.gravity = 0f; gun.projectileSpeed = 2f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "Minigun"; } protected override string GetDescription() { return null; } protected override GameObject GetCardArt() { return Assets.MinigunArt; } 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 //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_00e5: 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_00f1: 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_0107: 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_010f: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[6] { new CardInfoStat { positive = true, stat = "Ammo", amount = "+20", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Attack Speed", amount = "+900%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Bullet Gravity", amount = "Zero", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Bullet Speed", amount = "+100%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Damage", amount = "-85%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Reload Time", amount = "+10s", 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)1; } public override string GetModName() { return "DRON"; } } public class NothingCard : CustomCard { public const string CardName = "Nothing"; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { if ((Object)(object)PlayerManager.instance == (Object)null || PlayerManager.instance.players == null || PlayerManager.instance.players.Count == 0 || !PlayerManager.instance.players.Contains(player)) { return; } if (NothingTimerManager.IsInReplaceOperation(player)) { MrFuntikMod.Log($"[NothingCard] Player {player.playerID}: inside replace operation, skipping"); if ((Object)(object)((Component)player).gameObject.GetComponent() == (Object)null) { ((Component)player).gameObject.AddComponent(); } return; } int currentNothingCount = CountNothingCards(player) + 1; if (!NothingTimerManager.IsNewNothingCard(player, currentNothingCount)) { MrFuntikMod.Log($"[NothingCard] Player {player.playerID}: reinventarization, skipping all logic"); if ((Object)(object)((Component)player).gameObject.GetComponent() == (Object)null) { ((Component)player).gameObject.AddComponent(); } return; } NothingTimerManager.RegisterTimer(player); MrFuntikMod.Log($"[NothingCard] Player {player.playerID}: new Nothing card, timer registered"); if (NothingTimerManager.HasItBecomesAll(player)) { MrFuntikMod.Log($"[NothingCard] Player {player.playerID} has ItBecomesAll - transforming immediately to All"); NothingTimerManager.RemoveOldestTimer(player); NothingTimerManager.TransformImmediatelyToAll(player); } else if ((Object)(object)((Component)player).gameObject.GetComponent() == (Object)null) { ((Component)player).gameObject.AddComponent(); } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { int num = CountNothingCards(player); if (num <= 1) { NothingMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } } } public static int CountNothingCards(Player player) { if ((Object)(object)player == (Object)null || (Object)(object)player.data == (Object)null || player.data.currentCards == null) { return 0; } return player.data.currentCards.Count((CardInfo c) => c.cardName == "Nothing" || c.cardName.EndsWith("Nothing")); } protected override string GetTitle() { return "Nothing"; } protected override string GetDescription() { return "Nothing now, but give it ten minutes and it will shine."; } protected override GameObject GetCardArt() { return Assets.NothingArt; } 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)0; } 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 return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Nothing", amount = "+0.16%/s", 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 "IS"; } } public class OneCutCard : CustomCard { [CompilerGenerated] private sealed class <>c__DisplayClass11_0 { public Player player; public Func <>9__0; internal bool b__0(int i) { return PlayerManager.instance.players[i].playerID == player.playerID; } } [CompilerGenerated] private sealed class d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private Player[] 5__1; private int 5__2; private <>c__DisplayClass11_0 <>8__3; private List 5__4; private CardInfo[] 5__5; private int 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>8__3 = null; 5__4 = null; 5__5 = null; <>1__state = -2; } private bool MoveNext() { //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Expected O, but got Unknown //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Expected O, but got Unknown //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown int num; switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = PlayerManager.instance.players.ToArray(); 5__2 = 0; goto IL_0337; case 1: <>1__state = -1; goto IL_02f2; case 2: <>1__state = -1; 5__5 = CardChoice.instance.cards; OneCutManager.StartSelection(<>8__3.player); 5__6 = (from i in Enumerable.Range(0, PlayerManager.instance.players.Count) where PlayerManager.instance.players[i].playerID == <>8__3.player.playerID select i).First(); CardChoiceVisuals.instance.Show(5__6, true); <>2__current = CardChoice.instance.DoPick(1, <>8__3.player.playerID, (PickerType)1); <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = (object)new WaitForSecondsRealtime(0.1f); <>1__state = 4; return true; case 4: <>1__state = -1; CardChoice.instance.cards = 5__5; OneCutManager.ForceEndSelection(); <>2__current = GameModeManager.TriggerHook("PlayerPickEnd"); <>1__state = 5; return true; case 5: <>1__state = -1; <>2__current = (object)new WaitForSecondsRealtime(0.1f); <>1__state = 6; return true; case 6: { <>1__state = -1; 5__4 = null; 5__5 = null; goto IL_02f2; } IL_02f2: if (<>8__3.player.data.stats.GetAdditionalData().oneCutPending > 0) { <>8__3.player.data.stats.GetAdditionalData().oneCutPending--; 5__4 = OneCutManager.GetRemovableCards(<>8__3.player); if (5__4.Count == 0) { MrFuntikMod.Log($"[OneCut] Player {<>8__3.player.playerID} has no removable cards, giving SurpriseGift directly"); if (PhotonNetwork.OfflineMode) { OneCutManager.RPCA_GiveSurpriseGift(<>8__3.player.playerID); } else { NetworkingManager.RPC(typeof(OneCutManager), "RPCA_GiveSurpriseGift", new object[1] { <>8__3.player.playerID }); } <>2__current = (object)new WaitForSecondsRealtime(0.3f); <>1__state = 1; return true; } <>2__current = GameModeManager.TriggerHook("PlayerPickStart"); <>1__state = 2; return true; } <>8__3 = null; num = 5__2 + 1; 5__2 = num; goto IL_0337; IL_0337: if (5__2 < 5__1.Length) { <>8__3 = new <>c__DisplayClass11_0(); <>8__3.player = 5__1[5__2]; goto IL_02f2; } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false; cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { CustomCardCategories.instance.CardCategory("CardManipulation") }; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { characterStats.GetAdditionalData().oneCutPending++; } 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 "One Cut"; } protected override string GetDescription() { return "Remove a card and get a random one. Or just get a random card!"; } 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)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_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 return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Remove card", amount = "Choose", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Random card", amount = "+1", 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)0; } public override string GetModName() { return "BFRM"; } public override bool GetEnabled() { return true; } [IteratorStateMachine(typeof(d__11))] internal static IEnumerator ExtraPicks() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0); } } public class OneCutNextCard : CustomCard { public static CardInfo CardInfoInstance; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { MrFuntikMod.LogWarning("[OneCut] OneCutNextCard.OnAddCard was called - this should not happen!"); } 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 "One Cut Next"; } protected override string GetDescription() { return "Show more cards..."; } 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)0; } 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 return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Next Page", amount = "→", 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)3; } public override string GetModName() { return "BFRM"; } public override bool GetEnabled() { return false; } } [HarmonyPatch(typeof(ApplyCardStats), "Pick")] internal class OneCutApplyCardStatsPatch { private static bool Prefix(ApplyCardStats __instance, int pickerID) { if (!OneCutManager.IsActive) { return true; } CardInfo component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } MrFuntikMod.Log("[OneCut] Card picked: " + component.cardName); if (OneCutManager.IsNextPageCard(component)) { MrFuntikMod.Log("[OneCut] NextPage selected"); Player val = PlayerManager.instance.players.Find((Player p) => p.playerID == pickerID); if ((Object)(object)val != (Object)null) { OneCutManager.GoToNextPage(val); } return false; } if (OneCutManager.IsSurpriseGiftCard(component)) { MrFuntikMod.Log("[OneCut] SurpriseGift selected - giving random card without removing any"); OneCutManager.HandleSurpriseGiftSelection(pickerID); return false; } OneCutManager.HandleCardSelection(component, pickerID); return false; } } internal class PhoenixCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = false; statModifiers.health = 0.35f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { characterStats.respawns += 2; } 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 "Phoenix 2.0"; } protected override string GetDescription() { return "Need mooore revives!"; } protected override GameObject GetCardArt() { return Assets.PhoenixArt; } 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 return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Revives", amount = "+2", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Health", amount = "-65%", 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)2; } public override string GetModName() { return "DRON"; } } public class PhoenixSurgeCard : CustomCard { private static bool hooksRegistered; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { MrFuntikMod.PhoenixSurgeCategory }; cardInfo.allowMultiple = false; if (!hooksRegistered) { PhoenixSurgeHandler.RegisterHooks(); hooksRegistered = true; } } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { PhoenixSurgeMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component == (Object)null) { ((Component)player).gameObject.AddComponent(); } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { PhoenixSurgeMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.ClearTempRespawn(); Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Phoenix Surge"; } protected override string GetDescription() { return "Requires Kamikaze\nOnce per round, revive with an explosion."; } protected override GameObject? GetCardArt() { return null; } 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("Hidden"); } 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 return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Revive", amount = "+1", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) return CardThemeLib.instance.CreateOrGetType("Hidden", (CardThemeColor)null); } public override string GetModName() { return "BFRM"; } } public class PlanetCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = false; statModifiers.sizeMultiplier = 1.3f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { GravityFieldMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component == (Object)null) { component = ((Component)player).gameObject.AddComponent(); } else { component.AddStack(); } PlanetRegenMono component2 = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component2 == (Object)null) { component2 = ((Component)player).gameObject.AddComponent(); } else { component2.AddStack(); } ArcFieldHelper.CheckUnlockArcField(player); GravitySurgeHelper.CheckUnlockGravitySurge(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { GravityFieldMono component = ((Component)player).gameObject.GetComponent(); bool flag = false; if ((Object)(object)component != (Object)null) { flag = component.RemoveStack(); if (flag) { Object.Destroy((Object)(object)component); } } else { flag = true; } ArcFieldHelper.CheckLockArcField(player, "Planet"); GravitySurgeHelper.CheckLockGravitySurgeOnStackRemove(player, flag); } protected override string GetTitle() { return "Planet"; } protected override string GetDescription() { return "Your gravitational pull affects everything."; } 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 return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Regen", amount = "+1%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Size", amount = "+30%", 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)8; } public override string GetModName() { return "BFRM"; } } public class RandomTeleportCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = false; statModifiers.movementSpeed = 1.2f; statModifiers.jump = 1.2f; block.cdAdd = 0.5f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { gun.damage *= 1.2f; RandomTeleportMono orAddComponent = ExtensionMethods.GetOrAddComponent(((Component)player).gameObject, false); orAddComponent.Initialize(player, block); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { RandomTeleportMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.Cleanup(); Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Random Teleport"; } protected override string GetDescription() { return "Press block to teleport to a random location on the map."; } protected override GameObject GetCardArt() { return Assets.RandomTeleportArt; } protected override Rarity GetRarity() { return (Rarity)0; } 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 //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[5] { new CardInfoStat { positive = true, stat = "Damage", amount = "+20%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Movement Speed", amount = "+20%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Jump Height", amount = "+20%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Block Cooldown", amount = "+0.5s", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Teleport Cooldown", amount = "4s", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)8; } public override string GetModName() { return "DRON"; } } public class ReaperCard : CustomCard { public const float HP_STEAL_PERCENT = 0.03f; internal static GameObject ReaperHitEffectObject; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown if ((Object)(object)ReaperHitEffectObject == (Object)null) { ReaperHitEffectObject = new GameObject("ReaperHitEffect", new Type[1] { typeof(ReaperHitEffect) }); Object.DontDestroyOnLoad((Object)(object)ReaperHitEffectObject); } List list = gun.objectsToSpawn.ToList(); list.Add(new ObjectsToSpawn { AddToProjectile = ReaperHitEffectObject }); gun.objectsToSpawn = list.ToArray(); ReaperSoulTracker orAddComponent = ExtensionMethods.GetOrAddComponent(((Component)player).gameObject, false); orAddComponent.cardCount++; } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ReaperSoulTracker component = ((Component)player).GetComponent(); if ((Object)(object)component != (Object)null) { component.cardCount--; if (component.cardCount <= 0) { Object.Destroy((Object)(object)component); } } } protected override string GetTitle() { return "Reaper"; } protected override string GetDescription() { return "Bullets steal % of the enemy's current max HP. Extra HP is not restored."; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)1; } protected override CardInfoStat[] GetStats() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Max HP Steal", amount = $"+{3f}%", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)4; } public override string GetModName() { return "BFRM"; } } public class ReaperHitEffect : RayHitEffect { private ProjectileHit projectileHit; private void Awake() { projectileHit = ((Component)this).GetComponentInParent(); } private void Start() { if ((Object)(object)projectileHit == (Object)null) { projectileHit = ((Component)this).GetComponentInParent(); } } public override HasToReturn DoHitEffect(HitInfo hit) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_0224: 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_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)hit.transform == (Object)null) { return (HasToReturn)1; } if ((Object)(object)projectileHit == (Object)null) { projectileHit = ((Component)this).GetComponentInParent(); if ((Object)(object)projectileHit == (Object)null) { return (HasToReturn)1; } } Player ownPlayer = projectileHit.ownPlayer; if ((Object)(object)ownPlayer == (Object)null) { return (HasToReturn)1; } CharacterData component = ((Component)hit.transform).GetComponent(); if ((Object)(object)component == (Object)null) { return (HasToReturn)1; } Player player = component.player; if ((Object)(object)player == (Object)null || (Object)(object)player == (Object)(object)ownPlayer) { return (HasToReturn)1; } if (player.teamID == ownPlayer.teamID) { return (HasToReturn)1; } if (component.dead || !component.isPlaying) { return (HasToReturn)1; } HealthHandler component2 = ((Component)hit.transform).GetComponent(); if ((Object)(object)component2 == (Object)null) { return (HasToReturn)1; } float num = component.maxHealth * 0.03f; if (num < 1f) { num = 1f; } num = Mathf.Min(num, Mathf.Max(1f, component.health)); if (num <= 0f) { return (HasToReturn)1; } component.maxHealth -= num; if (component.health > component.maxHealth) { component.health = component.maxHealth; } RecalculatePlayerSize(player); ReaperVictimDebuff orAddComponent = ExtensionMethods.GetOrAddComponent(((Component)player).gameObject, false); orAddComponent.AddStolenHP(num); CharacterData data = ownPlayer.data; data.maxHealth += num; RecalculatePlayerSize(ownPlayer); ReaperSoulTracker component3 = ((Component)ownPlayer).GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.AddStolenHP(num); } if (ownPlayer.data.view.IsMine) { Vector2 val = hit.point - Vector2.op_Implicit(((Component)this).transform.position); Vector2 val2 = ((Vector2)(ref val)).normalized; if (val2 == Vector2.zero) { Vector3 forward = ((Component)this).transform.forward; val2 = Vector2.op_Implicit(((Vector3)(ref forward)).normalized); } ((Damagable)component2).CallTakeDamage(val2 * 1f, hit.point, projectileHit.ownWeapon, ownPlayer, true); } ReaperSoulEffect.SpawnEffect(((Component)player).transform.position, ((Component)ownPlayer).transform.position); return (HasToReturn)1; } private void RecalculatePlayerSize(Player player) { //IL_0071: 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) if (!((Object)(object)player == (Object)null) && !((Object)(object)player.data == (Object)null)) { CharacterStatModifiers stats = player.data.stats; if (!((Object)(object)stats == (Object)null)) { float sizeMultiplier = stats.sizeMultiplier; float num = 1.2f * Mathf.Pow(player.data.maxHealth / 100f * 1.2f, 0.2f) * sizeMultiplier; ((Component)player).transform.localScale = Vector3.one * num; } } } } public class ReaperVictimDebuff : MonoBehaviour { [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public ReaperVictimDebuff <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.RestoreHP(); 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 d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public ReaperVictimDebuff <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.RestoreHP(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Player player; private CharacterData data; private float totalStolenHP = 0f; private bool initialized = false; private void Start() { Initialize(); } private void Initialize() { if (!initialized) { player = ((Component)this).GetComponent(); data = ((Component)this).GetComponent(); GameModeManager.AddHook("PointEnd", (Func)OnPointEnd); GameModeManager.AddHook("RoundEnd", (Func)OnRoundEnd); initialized = true; } } public void AddStolenHP(float amount) { if (!initialized) { Initialize(); } totalStolenHP += amount; } [IteratorStateMachine(typeof(d__7))] private IEnumerator OnPointEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { <>4__this = this, gm = gm }; } [IteratorStateMachine(typeof(d__8))] private IEnumerator OnRoundEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { <>4__this = this, gm = gm }; } private void RestoreHP() { if ((Object)(object)data != (Object)null && totalStolenHP > 0f) { CharacterData obj = data; obj.maxHealth += totalStolenHP; RecalculatePlayerSize(); } totalStolenHP = 0f; } private void RecalculatePlayerSize() { //IL_007b: 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) if (!((Object)(object)player == (Object)null) && !((Object)(object)data == (Object)null)) { CharacterStatModifiers stats = data.stats; if (!((Object)(object)stats == (Object)null)) { float sizeMultiplier = stats.sizeMultiplier; float num = 1.2f * Mathf.Pow(data.maxHealth / 100f * 1.2f, 0.2f) * sizeMultiplier; ((Component)player).transform.localScale = Vector3.one * num; } } } private void OnDestroy() { GameModeManager.RemoveHook("PointEnd", (Func)OnPointEnd); GameModeManager.RemoveHook("RoundEnd", (Func)OnRoundEnd); } } public class ReaperSoulTracker : MonoBehaviour { [CompilerGenerated] private sealed class d__15 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public ReaperSoulTracker <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ResetBonus(); 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 d__16 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public ReaperSoulTracker <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.ResetBonus(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public int cardCount = 0; private Player player; private CharacterData data; private float totalStolenHP = 0f; private float bonusMaxHP = 0f; private GameObject uiContainer; private TextMesh textMesh; private TextMesh shadowMesh; private Transform wobbleTransform; private const int UI_FONT_SIZE = 90; private const float UI_CHAR_SIZE = 0.05f; private const float Y_OFFSET = 1.8f; private static readonly Color SOUL_COLOR = new Color(0.9f, 0.2f, 0.2f, 0.9f); private static readonly Color SHADOW_COLOR = new Color(0.2f, 0f, 0f, 0.7f); private void Start() { player = ((Component)this).GetComponent(); data = ((Component)this).GetComponent(); GameModeManager.AddHook("PointEnd", (Func)OnPointEnd); GameModeManager.AddHook("RoundEnd", (Func)OnRoundEnd); CreateUI(); } [IteratorStateMachine(typeof(d__15))] private IEnumerator OnPointEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0) { <>4__this = this, gm = gm }; } [IteratorStateMachine(typeof(d__16))] private IEnumerator OnRoundEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__16(0) { <>4__this = this, gm = gm }; } public void AddStolenHP(float amount) { totalStolenHP += amount; bonusMaxHP += amount; UpdateUI(); } private void ResetBonus() { if ((Object)(object)data != (Object)null && bonusMaxHP > 0f) { CharacterData obj = data; obj.maxHealth -= bonusMaxHP; if (data.health > data.maxHealth) { data.health = data.maxHealth; } RecalculatePlayerSize(); } totalStolenHP = 0f; bonusMaxHP = 0f; UpdateUI(); } private void RecalculatePlayerSize() { //IL_007b: 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) if (!((Object)(object)player == (Object)null) && !((Object)(object)data == (Object)null)) { CharacterStatModifiers stats = data.stats; if (!((Object)(object)stats == (Object)null)) { float sizeMultiplier = stats.sizeMultiplier; float num = 1.2f * Mathf.Pow(data.maxHealth / 100f * 1.2f, 0.2f) * sizeMultiplier; ((Component)player).transform.localScale = Vector3.one * num; } } } private void CreateUI() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Expected O, but got Unknown //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) PlayerWobblePosition componentInChildren = ((Component)player).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { wobbleTransform = ((Component)componentInChildren).transform; } uiContainer = new GameObject("ReaperSoulUI"); if ((Object)(object)wobbleTransform != (Object)null) { uiContainer.transform.SetParent(wobbleTransform, false); } else { uiContainer.transform.SetParent(((Component)player).transform, false); } GameObject val = new GameObject("Shadow"); val.transform.SetParent(uiContainer.transform, false); val.transform.localPosition = new Vector3(0.02f, -0.02f, 0.1f); shadowMesh = val.AddComponent(); shadowMesh.anchor = (TextAnchor)4; shadowMesh.alignment = (TextAlignment)1; shadowMesh.fontSize = 90; shadowMesh.characterSize = 0.05f; shadowMesh.color = SHADOW_COLOR; shadowMesh.text = ""; MeshRenderer component = val.GetComponent(); if ((Object)(object)component != (Object)null) { ((Renderer)component).sortingLayerName = "MostFront"; ((Renderer)component).sortingOrder = 99; } GameObject val2 = new GameObject("Text"); val2.transform.SetParent(uiContainer.transform, false); val2.transform.localPosition = Vector3.zero; textMesh = val2.AddComponent(); textMesh.anchor = (TextAnchor)4; textMesh.alignment = (TextAlignment)1; textMesh.fontSize = 90; textMesh.characterSize = 0.05f; textMesh.color = SOUL_COLOR; textMesh.text = ""; MeshRenderer component2 = val2.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Renderer)component2).sortingLayerName = "MostFront"; ((Renderer)component2).sortingOrder = 100; } uiContainer.SetActive(false); } private void UpdateUI() { if (!((Object)(object)textMesh == (Object)null) && !((Object)(object)shadowMesh == (Object)null) && !((Object)(object)uiContainer == (Object)null)) { if (totalStolenHP <= 0f) { uiContainer.SetActive(false); return; } string text = $"☠ +{Mathf.RoundToInt(totalStolenHP)}"; textMesh.text = text; shadowMesh.text = text; uiContainer.SetActive(true); } } private void Update() { if ((Object)(object)player == (Object)null) { Cleanup(); return; } if ((Object)(object)data != (Object)null && data.dead) { HideUI(); return; } if (totalStolenHP > 0f) { ShowUI(); } UpdateUIPosition(); } private void HideUI() { if ((Object)(object)uiContainer != (Object)null) { uiContainer.SetActive(false); } } private void ShowUI() { if ((Object)(object)uiContainer != (Object)null && totalStolenHP > 0f && !uiContainer.activeSelf) { uiContainer.SetActive(true); } } private void UpdateUIPosition() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)uiContainer == (Object)null) && !((Object)(object)player == (Object)null)) { uiContainer.transform.localPosition = new Vector3(0f, 1.8f, 0f); } } private void Cleanup() { GameModeManager.RemoveHook("PointEnd", (Func)OnPointEnd); GameModeManager.RemoveHook("RoundEnd", (Func)OnRoundEnd); if ((Object)(object)uiContainer != (Object)null) { Object.Destroy((Object)(object)uiContainer); uiContainer = null; } } private void OnDestroy() { Cleanup(); } } public class ReaperSoulEffect : MonoBehaviour { private Vector3 startPos; private Vector3 endPos; private float duration = 0.4f; private float elapsed = 0f; private LineRenderer lineRenderer; private List particles = new List(); private static readonly Color SOUL_START_COLOR = new Color(0.95f, 0.15f, 0.15f, 0.9f); private static readonly Color SOUL_END_COLOR = new Color(0.5f, 0.05f, 0.05f, 0f); public static void SpawnEffect(Vector3 from, Vector3 to) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0014: 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) GameObject val = new GameObject("ReaperSoulDrainEffect"); ReaperSoulEffect reaperSoulEffect = val.AddComponent(); reaperSoulEffect.Initialize(from, to); } public void Initialize(Vector3 from, Vector3 to) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_007b: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown startPos = from; endPos = to; lineRenderer = ((Component)this).gameObject.AddComponent(); lineRenderer.positionCount = 2; lineRenderer.SetPosition(0, startPos); lineRenderer.SetPosition(1, startPos); lineRenderer.startWidth = 0.15f; lineRenderer.endWidth = 0.05f; lineRenderer.startColor = SOUL_START_COLOR; lineRenderer.endColor = SOUL_END_COLOR; ((Renderer)lineRenderer).material = new Material(Shader.Find("Sprites/Default")); ((Renderer)lineRenderer).sortingLayerName = "MostFront"; ((Renderer)lineRenderer).sortingOrder = 50; for (int i = 0; i < 5; i++) { CreateParticle((float)i * 0.06f); } } private void CreateParticle(float delay) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_0095: 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_00a7: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("SoulParticle"); val.transform.SetParent(((Component)this).transform); val.transform.position = startPos; SpriteRenderer val2 = val.AddComponent(); val2.sprite = CreateCircleSprite(); val2.color = SOUL_START_COLOR; ((Renderer)val2).sortingLayerName = "MostFront"; ((Renderer)val2).sortingOrder = 51; float num = Random.Range(0.08f, 0.15f); val.transform.localScale = Vector3.one * num; SoulParticleMover soulParticleMover = val.AddComponent(); soulParticleMover.Initialize(startPos, endPos, duration, delay, SOUL_START_COLOR); particles.Add(val); } private Sprite CreateCircleSprite() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) int num = 32; Texture2D val = new Texture2D(num, num); Color[] array = (Color[])(object)new Color[num * num]; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor((float)num / 2f, (float)num / 2f); float num2 = (float)num / 2f; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float num3 = Vector2.Distance(new Vector2((float)j, (float)i), val2); if (num3 < num2) { float num4 = 1f - num3 / num2; array[i * num + j] = new Color(1f, 1f, 1f, num4 * num4); } else { array[i * num + j] = Color.clear; } } } val.SetPixels(array); val.Apply(); return Sprite.Create(val, new Rect(0f, 0f, (float)num, (float)num), new Vector2(0.5f, 0.5f), (float)num); } private void Update() { //IL_0038: 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_0044: 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_0051: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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) elapsed += Time.deltaTime; float num = Mathf.Clamp01(elapsed / duration); if ((Object)(object)lineRenderer != (Object)null) { Vector3 val = Vector3.Lerp(startPos, endPos, num); lineRenderer.SetPosition(1, val); Color sOUL_START_COLOR = SOUL_START_COLOR; Color sOUL_END_COLOR = SOUL_END_COLOR; sOUL_START_COLOR.a *= 1f - num; sOUL_END_COLOR.a *= 1f - num; lineRenderer.startColor = sOUL_START_COLOR; lineRenderer.endColor = sOUL_END_COLOR; } if (elapsed >= duration + 0.3f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void OnDestroy() { foreach (GameObject particle in particles) { if ((Object)(object)particle != (Object)null) { Object.Destroy((Object)(object)particle); } } particles.Clear(); } } public class SoulParticleMover : MonoBehaviour { private Vector3 startPos; private Vector3 endPos; private float duration; private float delay; private float elapsed = 0f; private SpriteRenderer spriteRenderer; private Color baseColor; private Vector3 offset; public void Initialize(Vector3 from, Vector3 to, float dur, float del, Color color) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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) startPos = from; endPos = to; duration = dur; delay = del; baseColor = color; spriteRenderer = ((Component)this).GetComponent(); offset = new Vector3(Random.Range(-0.3f, 0.3f), Random.Range(-0.3f, 0.3f), 0f); if ((Object)(object)spriteRenderer != (Object)null) { spriteRenderer.color = new Color(baseColor.r, baseColor.g, baseColor.b, 0f); } } private void Update() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) elapsed += Time.deltaTime; if (!(elapsed < delay)) { float num = Mathf.Clamp01((elapsed - delay) / duration); Vector3 b = (startPos + endPos) / 2f + offset; Vector3 position = QuadraticBezier(startPos, b, endPos, num); ((Component)this).transform.position = position; if ((Object)(object)spriteRenderer != (Object)null) { float num2 = ((num < 0.3f) ? (num / 0.3f) : ((!(num > 0.7f)) ? 1f : ((1f - num) / 0.3f))); spriteRenderer.color = new Color(baseColor.r, baseColor.g, baseColor.b, num2 * 0.8f); } float num3 = Mathf.Lerp(1f, 0.3f, num); ((Component)this).transform.localScale = Vector3.one * num3 * 0.12f; if (num >= 1f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } private Vector3 QuadraticBezier(Vector3 a, Vector3 b, Vector3 c, float t) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //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) //IL_000a: 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_000c: 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_0014: 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_0016: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Lerp(a, b, t); Vector3 val2 = Vector3.Lerp(b, c, t); return Vector3.Lerp(val, val2, t); } } public class RicochetPowerCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { gun.dmgMOnBounce = 1.4f; gun.reflects = 3; gun.damage = 0.9f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "Ricochet Power"; } protected override string GetDescription() { return "Bullets gain power with each bounce."; } 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)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_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 = true, stat = "Damage per Bounce", amount = "+30%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Bounces", amount = "+3", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Damage", amount = "-10%", 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)1; } public override string GetModName() { return "BFRM"; } } public class RollbackCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { MrFuntikMod.RollbackCategory }; cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { if (!CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories.Contains(MrFuntikMod.RollbackCategory)) { CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories.Add(MrFuntikMod.RollbackCategory); } RollbackMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component == (Object)null) { RollbackMono rollbackMono = ((Component)player).gameObject.AddComponent(); rollbackMono.stackCount = 1; } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { RollbackMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Rollback"; } protected override string GetDescription() { return "Requires Backtrack\nBlock to restore to your health."; } protected override GameObject? GetCardArt() { return null; } 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("Hidden"); } 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 return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Health Rewind", amount = "3s", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Cooldown", amount = "20s", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) return CardThemeLib.instance.CreateOrGetType("Hidden", (CardThemeColor)null); } public override string GetModName() { return "BFRM"; } } public class ScorchCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { MrFuntikMod.ScorchCategory }; cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown ScorchEffect component = ((Component)player).gameObject.GetComponent(); if (!((Object)(object)component != (Object)null)) { ScorchEffect scorchEffect = ((Component)player).gameObject.AddComponent(); scorchEffect.owner = player; List list = new List(gun.objectsToSpawn); ObjectsToSpawn val = new ObjectsToSpawn(); val.AddToProjectile = new GameObject("ScorchHitEffect", new Type[1] { typeof(ScorchHitEffect) }); list.Add(val); val = new ObjectsToSpawn(); val.AddToProjectile = new GameObject("ScorchBulletVisual", new Type[1] { typeof(ScorchBulletVisual) }); list.Add(val); gun.objectsToSpawn = list.ToArray(); } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ScorchEffect component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Scorch"; } protected override string GetDescription() { return "Requires Blazing Trail\nBullets become fireballs that scatter flames."; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return RarityUtils.GetRarity("Hidden"); } 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 return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Fire Count", amount = "5", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return CardThemeLib.instance.CreateOrGetType("Hidden", (CardThemeColor)null); } public override string GetModName() { return "BFRM"; } } public class ScorchBulletVisual : MonoBehaviour { private ProjectileHit projectile; private Player owner; private int ownerTeamID = -1; private LineRenderer[] flameLines; private const int FLAME_COUNT = 6; private static Material sharedMaterial; private float[] phaseOffsets; private float[] speeds; private float[] baseAngles; private float updateTimer = 0f; private const float UPDATE_INTERVAL = 0.03f; private bool isFriendly; private void Start() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown projectile = ((Component)this).GetComponentInParent(); if (!((Object)(object)projectile == (Object)null)) { owner = projectile.ownPlayer; if ((Object)(object)owner != (Object)null) { ownerTeamID = owner.teamID; } if ((Object)(object)sharedMaterial == (Object)null) { sharedMaterial = new Material(Shader.Find("Sprites/Default")); } isFriendly = IsFriendlyForLocalPlayer(); ColorBullet(); CreateFlameEffect(); } } private void ColorBullet() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) SpriteRenderer componentInParent = ((Component)this).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { if (isFriendly) { componentInParent.color = new Color(0f, 1f, 0.1f, 1f); } else { componentInParent.color = new Color(1f, 0.4f, 1f, 1f); } } } private void CreateFlameEffect() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown flameLines = (LineRenderer[])(object)new LineRenderer[6]; phaseOffsets = new float[6]; speeds = new float[6]; baseAngles = new float[6]; Gradient colorGradient = CreateFlameGradient(); float num = 60f; for (int i = 0; i < 6; i++) { GameObject val = new GameObject($"Flame_{i}"); val.transform.SetParent(((Component)this).transform); val.transform.localPosition = Vector3.zero; LineRenderer val2 = val.AddComponent(); ((Renderer)val2).material = sharedMaterial; val2.positionCount = 4; val2.useWorldSpace = false; val2.colorGradient = colorGradient; ((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val2).receiveShadows = false; ((Renderer)val2).sortingOrder = 5; AnimationCurve val3 = new AnimationCurve(); val3.AddKey(0f, 0.21f); val3.AddKey(0.5f, 0.115f); val3.AddKey(1f, 0.029f); val2.widthCurve = val3; flameLines[i] = val2; baseAngles[i] = (float)i * num * (MathF.PI / 180f); phaseOffsets[i] = (float)i * 0.5f; speeds[i] = 8f + (float)(i % 3) * 2f; } } private Gradient CreateFlameGradient() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) Gradient val = new Gradient(); Color val3 = default(Color); Color val4 = default(Color); Color val5 = default(Color); Color val6 = default(Color); if (isFriendly) { Color val2 = default(Color); ((Color)(ref val2))..ctor(0f, 1f, 0.1f); val3 = val2; val4 = val2; val5 = val2 * 0.75f; val6 = val2 * 0.3f; } else { ((Color)(ref val3))..ctor(1f, 0.4f, 1f); ((Color)(ref val4))..ctor(0.7f, 0.2f, 1f); ((Color)(ref val5))..ctor(0.4f, 0.1f, 0.8f); ((Color)(ref val6))..ctor(0.2f, 0.05f, 0.4f); } val.SetKeys((GradientColorKey[])(object)new GradientColorKey[4] { new GradientColorKey(val3, 0f), new GradientColorKey(val4, 0.25f), new GradientColorKey(val5, 0.6f), new GradientColorKey(val6, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[4] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(0.9f, 0.25f), new GradientAlphaKey(0.5f, 0.6f), new GradientAlphaKey(0f, 1f) }); return val; } private bool IsFriendlyForLocalPlayer() { if ((Object)(object)PlayerManager.instance == (Object)null) { return false; } List players = PlayerManager.instance.players; for (int i = 0; i < players.Count; i++) { Player val = players[i]; if ((Object)(object)val != (Object)null && (Object)(object)val.data != (Object)null && (Object)(object)val.data.view != (Object)null && val.data.view.IsMine) { return val.teamID == ownerTeamID; } } return false; } private void Update() { if ((Object)(object)owner == (Object)null || flameLines == null) { return; } updateTimer += Time.deltaTime; if (updateTimer < 0.03f) { return; } updateTimer = 0f; float time = Time.time; for (int i = 0; i < 6; i++) { if (!((Object)(object)flameLines[i] == (Object)null)) { UpdateFlamePositions(i, time); } } } private void UpdateFlamePositions(int index, float time) { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) LineRenderer val = flameLines[index]; float num = baseAngles[index]; float num2 = phaseOffsets[index]; float num3 = speeds[index]; float num4 = Mathf.Sin(time * num3 * 0.5f + num2) * 0.26f; float num5 = num + num4; float num6 = Mathf.Cos(num5); float num7 = Mathf.Sin(num5); float num8 = 0.36f + Mathf.Sin(time * num3 + num2) * 0.144f; for (int i = 0; i < 4; i++) { float num9 = (float)i / 3f; float num10 = num9 * num8; float num11 = Mathf.Sin(time * num3 * 1.5f + num2 + num9 * 2f) * 0.072f * num9; float num12 = num6 * num10 - num7 * num11; float num13 = num7 * num10 + num6 * num11; val.SetPosition(i, new Vector3(num12, num13, 0f)); } } private void OnDestroy() { if (flameLines == null) { return; } for (int i = 0; i < flameLines.Length; i++) { if ((Object)(object)flameLines[i] != (Object)null && (Object)(object)((Component)flameLines[i]).gameObject != (Object)null) { Object.Destroy((Object)(object)((Component)flameLines[i]).gameObject); } } } } public class ScorchEffect : MonoBehaviour { [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public ScorchEffect <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; ScorchFirePool.ReturnAllActive(); ScorchScatterPool.ReturnAllActive(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Player owner; private const float BASE_FIRE_DURATION = 5f; private const float BASE_DAMAGE_PERCENT = 0.01f; private const float FIRE_DAMAGE_INTERVAL = 0.2f; private const float FIRE_RADIUS = 0.5f; private void Start() { ScorchFirePool.EnsureInitialized(); ScorchScatterPool.EnsureInitialized(); GameModeManager.AddHook("PointEnd", (Func)OnPointEnd); } private void OnDestroy() { GameModeManager.RemoveHook("PointEnd", (Func)OnPointEnd); } [IteratorStateMachine(typeof(d__7))] private IEnumerator OnPointEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { <>4__this = this, gm = gm }; } public float GetFireDuration() { return 5f; } public float GetDamagePercent() { return 0.01f; } public float GetDamageInterval() { return 0.2f; } public float GetFireRadius() { return 0.5f; } } public class ScorchHitEffect : RayHitEffect { private const int FIRE_COUNT = 5; private const float SCATTER_RADIUS = 1.5f; private const float RAYCAST_DISTANCE = 2f; public override HasToReturn DoHitEffect(HitInfo hit) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) _ = hit.point; if (false) { return (HasToReturn)1; } if ((Object)(object)hit.transform != (Object)null && (Object)(object)((Component)hit.transform).GetComponent() != (Object)null) { return (HasToReturn)1; } ProjectileHit componentInParent = ((Component)this).GetComponentInParent(); if ((Object)(object)componentInParent == (Object)null || (Object)(object)componentInParent.ownPlayer == (Object)null) { return (HasToReturn)1; } Player ownPlayer = componentInParent.ownPlayer; ScorchEffect component = ((Component)ownPlayer).GetComponent(); if ((Object)(object)component == (Object)null) { return (HasToReturn)1; } Vector2 point = hit.point; Vector2 val = ((((Vector2)(ref hit.normal)).sqrMagnitude > 0.001f) ? hit.normal : Vector2.up); int num = Random.Range(0, int.MaxValue); NetworkingManager.RPC(typeof(ScorchHitEffect), "RPC_SpawnScatteredFire", new object[8] { ownPlayer.playerID, point, val, component.GetFireDuration(), component.GetDamagePercent(), component.GetDamageInterval(), component.GetFireRadius(), num }); return (HasToReturn)1; } [UnboundRPC] public static void RPC_SpawnScatteredFire(int ownerID, Vector2 position, Vector2 normal, float duration, float damagePercent, float damageInterval, float damageRadius, int seed) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00ed: 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) Player val = FindPlayerByID(ownerID); if ((Object)(object)val == (Object)null) { return; } ScorchFirePool.EnsureInitialized(); Random random = new Random(seed); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0f - normal.y, normal.x); for (int i = 0; i < 5; i++) { float num = ((float)i - 2f) / 2f; float num2 = (float)(random.NextDouble() * 2.0 - 1.0) * 0.3f; float num3 = (num + num2) * 1.5f; Vector2 origin = position + val2 * num3 + normal * 0.5f; if (TryFindSurface(origin, -normal, out var hitPoint, out var hitNormal)) { SpawnSingleFire(val, ownerID, position, hitPoint, hitNormal, duration, damagePercent, damageInterval, damageRadius); } else if (TryFindSurface(origin, Vector2.down, out hitPoint, out hitNormal)) { SpawnSingleFire(val, ownerID, position, hitPoint, hitNormal, duration, damagePercent, damageInterval, damageRadius); } } } private static bool TryFindSurface(Vector2 origin, Vector2 direction, out Vector2 hitPoint, out Vector2 hitNormal) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) hitPoint = Vector2.zero; hitNormal = Vector2.up; RaycastHit2D[] array = Physics2D.RaycastAll(origin, direction, 2f); for (int i = 0; i < array.Length; i++) { RaycastHit2D val = array[i]; if ((Object)(object)((RaycastHit2D)(ref val)).collider == (Object)null || ((RaycastHit2D)(ref val)).collider.isTrigger || (Object)(object)((Component)((RaycastHit2D)(ref val)).collider).GetComponent() != (Object)null || (Object)(object)((Component)((RaycastHit2D)(ref val)).collider).GetComponentInParent() != (Object)null) { continue; } string name = ((Object)((Component)((RaycastHit2D)(ref val)).collider).gameObject).name; if (name.Contains("Fire") || name.Contains("Flame") || name.Contains("Scorch")) { continue; } if ((Object)(object)((RaycastHit2D)(ref val)).transform.parent != (Object)null) { string name2 = ((Object)((Component)((RaycastHit2D)(ref val)).transform.parent).gameObject).name; if (name2.Contains("Fire") || name2.Contains("Flame") || name2.Contains("Scorch")) { continue; } } if ((Object)(object)((Component)((RaycastHit2D)(ref val)).collider).GetComponent() != (Object)null || (Object)(object)((Component)((RaycastHit2D)(ref val)).collider).GetComponentInParent() != (Object)null) { continue; } hitPoint = ((RaycastHit2D)(ref val)).point; hitNormal = ((RaycastHit2D)(ref val)).normal; return true; } return false; } private static void SpawnSingleFire(Player owner, int ownerID, Vector2 hitPoint, Vector2 position, Vector2 normal, float duration, float damagePercent, float damageInterval, float damageRadius) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0068: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_0042: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector2.op_Implicit(position) + Vector2.op_Implicit(normal) * 0.02f; ScorchFireParticle scorchFireParticle = ScorchFireParticle.FindNearestFire(val, 0.3f, ownerID); if ((Object)(object)scorchFireParticle != (Object)null) { scorchFireParticle.ResetDuration(); ScorchScatterPool.ShowLine(hitPoint, Vector2.op_Implicit(val), owner); return; } ScorchScatterPool.ShowLine(hitPoint, Vector2.op_Implicit(val), owner); float num = Mathf.Atan2(normal.y, normal.x) * 57.29578f - 90f; ScorchFireParticle scorchFireParticle2 = ScorchFirePool.Get(); ((Component)scorchFireParticle2).transform.SetParent((Transform)null, false); ((Component)scorchFireParticle2).transform.localScale = Vector3.one; ((Component)scorchFireParticle2).transform.position = val; ((Component)scorchFireParticle2).transform.rotation = Quaternion.Euler(0f, 0f, num); scorchFireParticle2.Activate(owner, duration, damagePercent, damageInterval, damageRadius); } private static Player FindPlayerByID(int playerID) { if (playerID < 0 || (Object)(object)PlayerManager.instance == (Object)null) { return null; } List players = PlayerManager.instance.players; for (int i = 0; i < players.Count; i++) { if ((Object)(object)players[i] != (Object)null && players[i].playerID == playerID) { return players[i]; } } return null; } } public static class ScorchFirePool { private static Stack pool = new Stack(); private static Transform poolContainer; private const int INITIAL_POOL_SIZE = 30; private const int MAX_POOL_SIZE = 200; private static bool isInitialized = false; public static void EnsureInitialized() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown if (!isInitialized || !((Object)(object)poolContainer != (Object)null)) { GameObject val = new GameObject("ScorchFirePool"); Object.DontDestroyOnLoad((Object)(object)val); poolContainer = val.transform; for (int i = 0; i < 30; i++) { ScorchFireParticle scorchFireParticle = CreateNewFireParticle(); ((Component)scorchFireParticle).gameObject.SetActive(false); pool.Push(scorchFireParticle); } isInitialized = true; } } private static ScorchFireParticle CreateNewFireParticle() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown GameObject val = new GameObject("ScorchFire"); val.transform.SetParent(poolContainer); ScorchFireParticle scorchFireParticle = val.AddComponent(); scorchFireParticle.CreateVisuals(); return scorchFireParticle; } public static ScorchFireParticle Get() { EnsureInitialized(); ScorchFireParticle scorchFireParticle = ((pool.Count <= 0) ? CreateNewFireParticle() : pool.Pop()); ((Component)scorchFireParticle).gameObject.SetActive(true); return scorchFireParticle; } public static void Return(ScorchFireParticle fire) { if (!((Object)(object)fire == (Object)null)) { fire.Deactivate(); if (pool.Count < 200 && (Object)(object)poolContainer != (Object)null) { ((Component)fire).transform.SetParent(poolContainer); ((Component)fire).gameObject.SetActive(false); pool.Push(fire); } else { Object.Destroy((Object)(object)((Component)fire).gameObject); } } } public static void ReturnAllActive() { ScorchFireParticle[] array = Object.FindObjectsOfType(); ScorchFireParticle[] array2 = array; foreach (ScorchFireParticle scorchFireParticle in array2) { if ((Object)(object)scorchFireParticle != (Object)null && ((Component)scorchFireParticle).gameObject.activeInHierarchy) { Return(scorchFireParticle); } } ScorchFireParticle.ClearActiveFiresList(); } } public class ScorchFireParticle : MonoBehaviour { private static List activeFires = new List(); private Player owner; private int ownerID = -1; private int ownerTeamID = -1; private float duration; private float damagePercent; private float damageInterval; private float damageRadius; private float damageRadiusSqr; private float spawnTime; private float lastDamageTime; private bool isActive = false; private SpriteRenderer glowSprite; private LineRenderer[] flameLines; private SpriteRenderer[] sparkSprites; private Transform[] sparkTransforms; private Transform glowTransform; private float[] flameOffsets; private float[] flameSpeeds; private float[] flameHeights; private float[] sparkPhases; private float[] sparkSpeeds; private float baseGlowSize; private const int FLAME_COUNT = 4; private const int SPARK_COUNT = 4; private const float SIZE_MULT = 1.5f; public static readonly Color FRIENDLY_COLOR = new Color(0f, 1f, 0.1f); public static readonly Color ENEMY_COLOR = new Color(0.6f, 0.15f, 1f); private Color currentGlowColor; private Color currentSparkColor; private static Material sharedMaterial; private static Sprite circleSprite; private static Gradient flameGradient; public static ScorchFireParticle FindNearestFire(Vector3 position, float radius, int ownerID) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) ScorchFireParticle result = null; float num = radius * radius; for (int num2 = activeFires.Count - 1; num2 >= 0; num2--) { ScorchFireParticle scorchFireParticle = activeFires[num2]; if ((Object)(object)scorchFireParticle == (Object)null || !scorchFireParticle.isActive) { activeFires.RemoveAt(num2); } else if (scorchFireParticle.ownerID == ownerID) { Vector3 val = ((Component)scorchFireParticle).transform.position - position; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude < num) { num = sqrMagnitude; result = scorchFireParticle; } } } return result; } public static void ClearActiveFiresList() { activeFires.Clear(); } public void ResetDuration() { spawnTime = Time.time; } private static void InitializeSharedResources() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00e6: 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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_013d: 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_0153: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)sharedMaterial == (Object)null) { sharedMaterial = new Material(Shader.Find("Sprites/Default")); } if ((Object)(object)circleSprite == (Object)null) { circleSprite = CreateCircleSprite(); } if (flameGradient == null) { flameGradient = new Gradient(); flameGradient.SetKeys((GradientColorKey[])(object)new GradientColorKey[4] { new GradientColorKey(new Color(1f, 0.9f, 0.3f), 0f), new GradientColorKey(new Color(1f, 0.5f, 0f), 0.3f), new GradientColorKey(new Color(1f, 0.2f, 0f), 0.7f), new GradientColorKey(new Color(0.3f, 0.1f, 0f), 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[4] { new GradientAlphaKey(0.9f, 0f), new GradientAlphaKey(0.8f, 0.3f), new GradientAlphaKey(0.5f, 0.7f), new GradientAlphaKey(0f, 1f) }); } } private static Sprite CreateCircleSprite() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(32, 32); Color[] array = (Color[])(object)new Color[1024]; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(16f, 16f); float num = 16f; for (int i = 0; i < 32; i++) { for (int j = 0; j < 32; j++) { float num2 = (float)j - val2.x; float num3 = (float)i - val2.y; float num4 = num2 * num2 + num3 * num3; float num5 = Mathf.Clamp01(1f - Mathf.Sqrt(num4) / num); num5 *= num5; array[i * 32 + j] = new Color(1f, 1f, 1f, num5); } } val.SetPixels(array); val.Apply(); return Sprite.Create(val, new Rect(0f, 0f, 32f, 32f), new Vector2(0.5f, 0.5f), 32f); } public void CreateVisuals() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0036: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_0189: Expected O, but got Unknown //IL_01ef: Unknown result type (might be due to invalid IL or missing references) InitializeSharedResources(); GameObject val = new GameObject("Glow"); glowTransform = val.transform; glowTransform.SetParent(((Component)this).transform); glowTransform.localPosition = Vector3.zero; glowSprite = val.AddComponent(); glowSprite.sprite = circleSprite; glowSprite.color = new Color(1f, 0.3f, 0f, 0.6f); ((Renderer)glowSprite).sortingOrder = -1; flameLines = (LineRenderer[])(object)new LineRenderer[4]; for (int i = 0; i < 4; i++) { GameObject val2 = new GameObject($"Flame{i}"); val2.transform.SetParent(((Component)this).transform); val2.transform.localPosition = Vector3.zero; val2.transform.localRotation = Quaternion.identity; LineRenderer val3 = val2.AddComponent(); ((Renderer)val3).material = sharedMaterial; val3.positionCount = 5; val3.useWorldSpace = false; val3.colorGradient = flameGradient; ((Renderer)val3).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val3).receiveShadows = false; ((Renderer)val3).sortingOrder = 1; flameLines[i] = val3; } sparkSprites = (SpriteRenderer[])(object)new SpriteRenderer[4]; sparkTransforms = (Transform[])(object)new Transform[4]; for (int j = 0; j < 4; j++) { GameObject val4 = new GameObject($"Spark{j}"); sparkTransforms[j] = val4.transform; sparkTransforms[j].SetParent(((Component)this).transform); sparkSprites[j] = val4.AddComponent(); sparkSprites[j].sprite = circleSprite; sparkSprites[j].color = new Color(1f, 0.8f, 0.2f, 0.8f); ((Renderer)sparkSprites[j]).sortingOrder = 2; } flameOffsets = new float[4]; flameSpeeds = new float[4]; flameHeights = new float[4]; sparkPhases = new float[4]; sparkSpeeds = new float[4]; } public void Activate(Player owner, float duration, float damagePercent, float damageInterval, float damageRadius) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) this.owner = owner; ownerID = (((Object)(object)owner != (Object)null) ? owner.playerID : (-1)); ownerTeamID = (((Object)(object)owner != (Object)null) ? owner.teamID : (-1)); this.duration = duration; this.damagePercent = damagePercent; this.damageInterval = damageInterval; this.damageRadius = damageRadius; damageRadiusSqr = damageRadius * damageRadius; spawnTime = Time.time; lastDamageTime = Time.time; isActive = true; if (!activeFires.Contains(this)) { activeFires.Add(this); } Color fireColorForLocalPlayer = GetFireColorForLocalPlayer(); SetupVisuals(fireColorForLocalPlayer); } private Player GetLocalPlayer() { List players = PlayerManager.instance.players; for (int i = 0; i < players.Count; i++) { Player val = players[i]; if ((Object)(object)val != (Object)null && (Object)(object)val.data != (Object)null && (Object)(object)val.data.view != (Object)null && val.data.view.IsMine) { return val; } } return null; } private Color GetFireColorForLocalPlayer() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = GetLocalPlayer(); if ((Object)(object)localPlayer == (Object)null) { return ENEMY_COLOR; } if (localPlayer.teamID == ownerTeamID) { return FRIENDLY_COLOR; } return ENEMY_COLOR; } private void SetupVisuals(Color fireColor) { //IL_0029: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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) //IL_007e: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Expected O, but got Unknown //IL_01e8: 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_0203: 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_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) baseGlowSize = 0.82500005f; glowTransform.localScale = new Vector3(baseGlowSize, baseGlowSize * 0.25f, 1f); ((Renderer)glowSprite).enabled = true; float num = default(float); float num2 = default(float); float num3 = default(float); Color.RGBToHSV(fireColor, ref num, ref num2, ref num3); Color val = Color.HSVToRGB(num, 1f, 1f); Color color = default(Color); Color color2 = default(Color); if (num > 0.2f && num < 0.45f) { color = val; color2 = val; } else { ((Color)(ref color))..ctor(0.8f, 0.3f, 1f); ((Color)(ref color2))..ctor(1f, 0.5f, 1f); } color.a = 0.8f; glowSprite.color = color; float num4 = 0.21000001f; float num5 = 0.75f; Gradient colorGradient = CreateTeamFlameGradient(fireColor); for (int i = 0; i < 4; i++) { ((Renderer)flameLines[i]).enabled = true; flameOffsets[i] = Random.Range(0f, MathF.PI * 2f); flameSpeeds[i] = Random.Range(8f, 12f); flameHeights[i] = num5 * (0.8f + (float)i * 0.1f); flameLines[i].colorGradient = colorGradient; AnimationCurve val2 = new AnimationCurve(); val2.AddKey(0f, num4); val2.AddKey(0.3f, 0.15f); val2.AddKey(1f, 0f); flameLines[i].widthCurve = val2; } color2.a = 1f; for (int j = 0; j < 4; j++) { ((Renderer)sparkSprites[j]).enabled = true; sparkSprites[j].color = color2; sparkTransforms[j].localScale = Vector3.one * 0.05f * 1.5f; sparkPhases[j] = Random.Range(0f, MathF.PI * 2f); sparkSpeeds[j] = Random.Range(3f, 6f); } currentGlowColor = color; currentSparkColor = color2; } private Gradient CreateTeamFlameGradient(Color teamColor) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_004a: 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_0053: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: 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_0171: Unknown result type (might be due to invalid IL or missing references) Gradient val = new Gradient(); float num = default(float); float num2 = default(float); float num3 = default(float); Color.RGBToHSV(teamColor, ref num, ref num2, ref num3); Color val2 = Color.HSVToRGB(num, 1f, 1f); Color val3 = default(Color); Color val4 = default(Color); Color val5 = default(Color); Color val6 = default(Color); if (num > 0.2f && num < 0.45f) { val3 = val2; val4 = val2; val5 = val2 * 0.75f; val6 = val2 * 0.3f; } else { ((Color)(ref val3))..ctor(1f, 0.4f, 1f); ((Color)(ref val4))..ctor(0.7f, 0.2f, 1f); ((Color)(ref val5))..ctor(0.4f, 0.1f, 0.8f); ((Color)(ref val6))..ctor(0.2f, 0.05f, 0.4f); } val.SetKeys((GradientColorKey[])(object)new GradientColorKey[4] { new GradientColorKey(val3, 0f), new GradientColorKey(val4, 0.25f), new GradientColorKey(val5, 0.6f), new GradientColorKey(val6, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[4] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(0.9f, 0.25f), new GradientAlphaKey(0.5f, 0.6f), new GradientAlphaKey(0f, 1f) }); return val; } public void Deactivate() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) isActive = false; owner = null; activeFires.Remove(this); ((Component)this).transform.SetParent((Transform)null); ((Component)this).transform.position = Vector3.zero; ((Component)this).transform.rotation = Quaternion.identity; ((Component)this).transform.localScale = Vector3.one; if ((Object)(object)glowSprite != (Object)null) { ((Renderer)glowSprite).enabled = false; } for (int i = 0; i < 4; i++) { if ((Object)(object)flameLines[i] != (Object)null) { ((Renderer)flameLines[i]).enabled = false; } } for (int j = 0; j < 4; j++) { if ((Object)(object)sparkSprites[j] != (Object)null) { ((Renderer)sparkSprites[j]).enabled = false; } } } private void Update() { if (!isActive) { return; } if ((Object)(object)GameManager.instance == (Object)null || !GameManager.instance.battleOngoing) { ScorchFirePool.Return(this); return; } float num = Time.time - spawnTime; if (num >= duration) { ScorchFirePool.Return(this); return; } float num2 = duration - num; float fadeMultiplier = ((num2 >= 0.5f) ? 1f : (num2 / 0.5f)); UpdateGlow(fadeMultiplier); UpdateFlames(fadeMultiplier); UpdateSparks(fadeMultiplier); if (Time.time >= lastDamageTime + damageInterval) { DealDamage(fadeMultiplier); lastDamageTime = Time.time; } } private void UpdateGlow(float fadeMultiplier) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)glowSprite == (Object)null)) { Color color = currentGlowColor; color.a = 0.6f * fadeMultiplier; glowSprite.color = color; float num = 1f + Mathf.Sin(Time.time * 15f) * 0.1f; float num2 = baseGlowSize * fadeMultiplier * num; glowTransform.localScale = new Vector3(num2, num2 * 0.25f, 1f); } } private void UpdateFlames(float fadeMultiplier) { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) float num = 1.5f; float num2 = 0.089999996f; for (int i = 0; i < 4; i++) { LineRenderer val = flameLines[i]; if (!((Object)(object)val == (Object)null) && ((Renderer)val).enabled) { float num3 = Time.time * flameSpeeds[i] + flameOffsets[i]; float num4 = flameHeights[i] * fadeMultiplier; float num5 = ((float)i - num) * num2; num5 += Mathf.Sin(num3 * 0.5f) * 0.015f * 1.5f; val.SetPosition(0, new Vector3(num5, 0.01f, 0f)); val.SetPosition(1, new Vector3(num5 + Mathf.Sin(num3) * 0.025f * 1.5f, num4 * 0.25f, 0f)); val.SetPosition(2, new Vector3(num5 + Mathf.Sin(num3 * 1.3f + 0.5f) * 0.04f * 1.5f, num4 * 0.5f, 0f)); val.SetPosition(3, new Vector3(num5 + Mathf.Sin(num3 * 1.1f + 1f) * 0.05f * 1.5f, num4 * 0.75f, 0f)); val.SetPosition(4, new Vector3(num5 + Mathf.Sin(num3 * 0.9f + 1.5f) * 0.03f * 1.5f, num4, 0f)); } } } private void UpdateSparks(float fadeMultiplier) { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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) for (int i = 0; i < 4; i++) { SpriteRenderer val = sparkSprites[i]; if (!((Object)(object)val == (Object)null) && ((Renderer)val).enabled) { float num = Time.time * sparkSpeeds[i] + sparkPhases[i]; float num2 = num % 1.5f * 0.6667f; float num3 = num2 * 0.4f * fadeMultiplier * 1.5f; float num4 = Mathf.Sin(num * 3f) * 0.12f * 1.5f; sparkTransforms[i].localPosition = new Vector3(num4, num3 + 0.02f, 0f); Color color = currentSparkColor; color.a = (1f - num2) * fadeMultiplier * 0.8f; val.color = color; float num5 = 0.06f * (1f - num2 * 0.5f); sparkTransforms[i].localScale = new Vector3(num5, num5, num5); } } } private void DealDamage(float fadeMultiplier) { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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_0178: 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_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: 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_0203: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GameManager.instance == (Object)null || !GameManager.instance.battleOngoing) { return; } if ((Object)(object)owner == (Object)null || (Object)(object)owner.data == (Object)null || owner.data.dead) { owner = FindPlayerByID(ownerID); if ((Object)(object)owner == (Object)null || (Object)(object)owner.data == (Object)null || owner.data.dead) { return; } } List players = PlayerManager.instance.players; Vector2 val = Vector2.op_Implicit(((Component)this).transform.position); for (int i = 0; i < players.Count; i++) { Player val2 = players[i]; if (!((Object)(object)val2 == (Object)null) && !((Object)(object)val2.data == (Object)null) && !val2.data.dead && ((Component)val2).gameObject.activeInHierarchy && val2.playerID != ownerID && val2.teamID != owner.teamID) { Vector2 playerFeetPosition = GetPlayerFeetPosition(val2); float num = playerFeetPosition.x - val.x; float num2 = playerFeetPosition.y - val.y; float num3 = num * num + num2 * num2; if (num3 <= damageRadiusSqr) { float maxHealth = val2.data.maxHealth; float num4 = maxHealth * damagePercent * fadeMultiplier; float num5 = Mathf.Sqrt(num3); Vector2 val3 = (Vector2)((num5 > 0.001f) ? new Vector2(num / num5, num2 / num5) : Vector2.up); ((Damagable)val2.data.healthHandler).CallTakeDamage(val3 * num4, val, (GameObject)null, owner, true); ApplyBurnEffect(val2); } } } } private void ApplyBurnEffect(Player victim) { if (!((Object)(object)victim == (Object)null) && !((Object)(object)owner == (Object)null)) { NetworkingManager.RPC(typeof(ScorchFireParticle), "RPC_ApplyBurn", new object[2] { owner.playerID, victim.playerID }); } } [UnboundRPC] public static void RPC_ApplyBurn(int ownerID, int victimID) { List players = PlayerManager.instance.players; Player val = null; Player val2 = null; for (int i = 0; i < players.Count; i++) { if (!((Object)(object)players[i] == (Object)null)) { if (players[i].playerID == ownerID) { val = players[i]; } if (players[i].playerID == victimID) { val2 = players[i]; } } } if (!((Object)(object)val == (Object)null) && !((Object)(object)val2 == (Object)null)) { BurnEffect component = ((Component)val2).GetComponent(); if ((Object)(object)component != (Object)null) { component.RefreshDuration(); return; } BurnEffect burnEffect = ((Component)val2).gameObject.AddComponent(); burnEffect.Apply(val); } } private static Player FindPlayerByID(int playerID) { if (playerID < 0 || (Object)(object)PlayerManager.instance == (Object)null) { return null; } List players = PlayerManager.instance.players; for (int i = 0; i < players.Count; i++) { if ((Object)(object)players[i] != (Object)null && players[i].playerID == playerID) { return players[i]; } } return null; } private Vector2 GetPlayerFeetPosition(Player player) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_0085: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) Vector2 val = Vector2.op_Implicit(((Component)player).transform.position); float num = 1f; if ((Object)(object)player.data != (Object)null && (Object)(object)player.data.stats != (Object)null) { num = player.data.stats.sizeMultiplier; } float num2 = Mathf.Max(((Component)player).transform.localScale.x, ((Component)player).transform.localScale.y); if (num2 > num) { num = num2; } return new Vector2(val.x, val.y - 0.5f * num); } } public static class ScorchScatterPool { private static Stack pool = new Stack(); private static Transform poolContainer; private const int INITIAL_POOL_SIZE = 15; private const int MAX_POOL_SIZE = 50; private static bool isInitialized = false; public static void EnsureInitialized() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown if (!isInitialized || !((Object)(object)poolContainer != (Object)null)) { GameObject val = new GameObject("ScorchScatterPool"); Object.DontDestroyOnLoad((Object)(object)val); poolContainer = val.transform; for (int i = 0; i < 15; i++) { ScorchScatterLine scorchScatterLine = CreateNewLine(); ((Component)scorchScatterLine).gameObject.SetActive(false); pool.Push(scorchScatterLine); } isInitialized = true; } } private static ScorchScatterLine CreateNewLine() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown GameObject val = new GameObject("ScorchScatterLine"); val.transform.SetParent(poolContainer); ScorchScatterLine scorchScatterLine = val.AddComponent(); scorchScatterLine.Initialize(); return scorchScatterLine; } public static void ShowLine(Vector2 from, Vector2 to, Player owner) { //IL_003d: 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) EnsureInitialized(); ScorchScatterLine scorchScatterLine = ((pool.Count <= 0) ? CreateNewLine() : pool.Pop()); ((Component)scorchScatterLine).gameObject.SetActive(true); scorchScatterLine.Play(from, to, owner); } public static void Return(ScorchScatterLine line) { if (!((Object)(object)line == (Object)null)) { if (pool.Count < 50 && (Object)(object)poolContainer != (Object)null) { ((Component)line).transform.SetParent(poolContainer); ((Component)line).gameObject.SetActive(false); pool.Push(line); } else { Object.Destroy((Object)(object)((Component)line).gameObject); } } } public static void ReturnAllActive() { ScorchScatterLine[] array = Object.FindObjectsOfType(); ScorchScatterLine[] array2 = array; foreach (ScorchScatterLine scorchScatterLine in array2) { if ((Object)(object)scorchScatterLine != (Object)null && ((Component)scorchScatterLine).gameObject.activeInHierarchy) { Return(scorchScatterLine); } } } } public class ScorchScatterLine : MonoBehaviour { private LineRenderer lineRenderer; private static Material sharedMaterial; private const float DURATION = 0.18f; private const float START_WIDTH = 0.12f; private const float END_WIDTH = 0.04f; private Vector3 startPoint; private Vector3 endPoint; private float startTime; private bool isPlaying = false; private static readonly Color FRIENDLY_COLOR = new Color(0f, 1f, 0.1f); private static readonly Color ENEMY_COLOR = new Color(1f, 0.4f, 1f); public void Initialize() { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown if ((Object)(object)sharedMaterial == (Object)null) { sharedMaterial = new Material(Shader.Find("Sprites/Default")); } lineRenderer = ((Component)this).gameObject.AddComponent(); ((Renderer)lineRenderer).material = sharedMaterial; lineRenderer.positionCount = 2; lineRenderer.useWorldSpace = true; ((Renderer)lineRenderer).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)lineRenderer).receiveShadows = false; ((Renderer)lineRenderer).sortingOrder = 10; lineRenderer.numCapVertices = 3; AnimationCurve val = new AnimationCurve(); val.AddKey(0f, 0.12f); val.AddKey(1f, 0.04f); lineRenderer.widthCurve = val; } public void Play(Vector2 from, Vector2 to, Player owner) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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_000e: 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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_0049: Expected O, but got Unknown //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_0064: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) startPoint = Vector2.op_Implicit(from); endPoint = Vector2.op_Implicit(to); startTime = Time.time; isPlaying = true; Color val = (IsFriendlyForLocalPlayer(owner) ? FRIENDLY_COLOR : ENEMY_COLOR); Gradient val2 = new Gradient(); val2.SetKeys((GradientColorKey[])(object)new GradientColorKey[3] { new GradientColorKey(val, 0f), new GradientColorKey(val * 0.8f, 0.5f), new GradientColorKey(val * 0.5f, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(0.7f, 0.5f), new GradientAlphaKey(0.3f, 1f) }); lineRenderer.colorGradient = val2; lineRenderer.SetPosition(0, startPoint); lineRenderer.SetPosition(1, startPoint); ((Renderer)lineRenderer).enabled = true; } private void Update() { //IL_007d: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_009d: 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) //IL_00ab: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) if (isPlaying) { float num = Time.time - startTime; float num2 = num / 0.18f; if (num2 >= 1f) { isPlaying = false; ((Renderer)lineRenderer).enabled = false; ScorchScatterPool.Return(this); return; } float num3 = Mathf.Clamp01(num2 * 1.5f); float num4 = Mathf.Clamp01((num2 - 0.2f) * 1.5f); Vector3 val = Vector3.Lerp(startPoint, endPoint, num3); Vector3 val2 = Vector3.Lerp(startPoint, endPoint, num4); lineRenderer.SetPosition(0, val2); lineRenderer.SetPosition(1, val); float a = 1f - num2 * 0.5f; Color val3 = lineRenderer.colorGradient.Evaluate(0f); val3.a = a; } } private bool IsFriendlyForLocalPlayer(Player owner) { if ((Object)(object)owner == (Object)null || (Object)(object)PlayerManager.instance == (Object)null) { return false; } int teamID = owner.teamID; List players = PlayerManager.instance.players; for (int i = 0; i < players.Count; i++) { Player val = players[i]; if ((Object)(object)val != (Object)null && (Object)(object)val.data != (Object)null && (Object)(object)val.data.view != (Object)null && val.data.view.IsMine) { return val.teamID == teamID; } } return false; } } public class SidePortalCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = false; statModifiers.gravity = 0.9f; statModifiers.numberOfJumps = 1; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { if ((Object)(object)((Component)player).gameObject.GetComponent() == (Object)null) { SidePortalEffect sidePortalEffect = ((Component)player).gameObject.AddComponent(); sidePortalEffect.ownerPlayer = player; } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { SidePortalEffect component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Side Portal"; } protected override string GetDescription() { return "Screen borders act as portals, but they may be unstable — use with caution"; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { 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_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 = true, stat = "Jumps", amount = "+1", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Gravity", amount = "-10%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "HP per portal", amount = "-10%", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)8; } public override string GetModName() { return "BFRM"; } } public class SmallButToughCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { statModifiers.health = 1.4f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { characterStats.sizeMultiplier *= 0.6f; } 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 "Small But Tough"; } protected override string GetDescription() { return null; } protected override GameObject GetCardArt() { return Assets.SmallButToughArt; } 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_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 return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Health", amount = "+40%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Size", amount = "-40%", 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 "DRON"; } } public class SomethingCard : CustomCard { public const string CardName = "Something"; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { statModifiers.health = 1.15f; statModifiers.movementSpeed = 1.15f; gun.damage = 1.15f; gun.attackSpeed = 0.85f; gun.reloadTime = 0.85f; block.cdMultiplier = 0.85f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override bool GetEnabled() { return false; } protected override string GetTitle() { return "Something"; } protected override string GetDescription() { return "Your 'Nothing' hatched into 'Something'!"; } protected override GameObject GetCardArt() { return Assets.SomethingArt; } 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_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 //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_00e5: 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_00f1: 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_0107: 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_010f: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[6] { new CardInfoStat { positive = true, stat = "Health", amount = "+15%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Move Speed", amount = "+15%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Damage", amount = "+15%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Attack Speed", amount = "+15%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Reload Time", amount = "-15%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Block Сooldown", amount = "-15%", 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 "IS"; } } public class SoulPiercerCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { gun.projectileSpeed *= 1.3f; if (characterStats.lifeSteal == 0f) { characterStats.lifeSteal += 0.3f; } else { characterStats.lifeSteal *= 1.3f; } SoulPiercerMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.AddStack(); } else { ((Component)player).gameObject.AddComponent().stackCount = 1; } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { SoulPiercerMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.RemoveStack(); if (component.stackCount <= 0) { Object.Destroy((Object)(object)component); } } } protected override string GetTitle() { return "Soul Piercer"; } protected override string GetDescription() { return "Your bullets pierce through enemies, dealing damage as they pass."; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { 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_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 return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Bullet Speed", amount = "+30%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Lifesteal", amount = "+30%", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)4; } public override string GetModName() { return "BFRM"; } } internal class SpeedDemonCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { statModifiers.movementSpeed = 1.4f; statModifiers.jump = 0.7f; statModifiers.health = 1.15f; gun.damage = 1.15f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "Speed Demon"; } protected override string GetDescription() { return null; } protected override GameObject GetCardArt() { return Assets.SpeedDemonArt; } 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_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 //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[4] { new CardInfoStat { positive = true, stat = "Move Speed", amount = "+40%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Health", amount = "+15%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Damage", amount = "+15%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Jump Height", amount = "-30%", 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)4; } public override string GetModName() { return "DRON"; } } internal class SprayCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) gun.ammo = 36; gun.reloadTime = 1.5f; gun.projectileColor = Color.cyan; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { gun.damage *= 0.05f; gun.attackSpeed *= 0.02f; gun.spread += 0.2f; gun.gravity *= 0.8f; } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } private void OnTakingDamage(HealthHandler health, float amount) { } protected override string GetTitle() { return "Spray 2.0"; } protected override string GetDescription() { return "CardDescription"; } protected override GameObject GetCardArt() { return Assets.SprayArt; } 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("Legendary"); } 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 //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[5] { new CardInfoStat { positive = true, stat = "Ammo", amount = "+36", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Attack Speed", amount = "+300%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Bullets", amount = "+2", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Bullet Gravity", amount = "-20%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Damage", amount = "-95%", 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)1; } public override string GetModName() { return "DRON"; } } internal class StepBackCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { block.forceToAdd = -15f; statModifiers.health = 1.35f; statModifiers.movementSpeed = 1.1f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "Step Back"; } protected override string GetDescription() { return "Push yourself back when you block"; } protected override GameObject GetCardArt() { MrFuntikMod.Log($"Getting Step Back Art {Assets.StepBackArt}"); return Assets.StepBackArt; } 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)0; } 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 return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Health", amount = "+35%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Move Speed", amount = "+10%", 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 "IS"; } } public class SurpriseGiftCard : CustomCard { [CompilerGenerated] private sealed class d__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Player player; public Gun gun; public GunAmmo gunAmmo; public CharacterData data; public HealthHandler health; public Gravity gravity; public Block block; public CharacterStatModifiers characterStats; public SurpriseGiftCard <>4__this; private int 5__1; private Rarity 5__2; private CardInfo 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0058: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = Random.Range(1, 101); if (5__1 <= 33) { 5__2 = (Rarity)2; } else if (5__1 <= 66) { 5__2 = (Rarity)1; } else { 5__2 = (Rarity)0; } 5__3 = <>4__this.GetRandomCardWithRarity(player, gun, gunAmmo, data, health, gravity, block, characterStats, 5__2); if ((Object)(object)5__3 == (Object)null) { 5__3 = <>4__this.GetRandomCardWithRarity(player, gun, gunAmmo, data, health, gravity, block, characterStats, (Rarity)0); } if ((Object)(object)5__3 == (Object)null) { return false; } if (PhotonNetwork.OfflineMode) { GiveCardToPlayer(player.playerID, ((Object)5__3).name); } else { NetworkingManager.RPC(typeof(SurpriseGiftCard), "RPCA_GiveCard", new object[2] { player.playerID, ((Object)5__3).name }); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static CardCategory[] noLotteryCategories = (CardCategory[])(object)new CardCategory[2] { CustomCardCategories.instance.CardCategory("CardManipulation"), CustomCardCategories.instance.CardCategory("NoRandom") }; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = true; CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false; cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { CustomCardCategories.instance.CardCategory("CardManipulation") }; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient) { ((MonoBehaviour)Unbound.Instance).StartCoroutine(HostSelectAndGiveCard(player, gun, gunAmmo, data, health, gravity, block, characterStats)); } } [IteratorStateMachine(typeof(d__3))] private IEnumerator HostSelectAndGiveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { <>4__this = this, player = player, gun = gun, gunAmmo = gunAmmo, data = data, health = health, gravity = gravity, block = block, characterStats = characterStats }; } [UnboundRPC] public static void RPCA_GiveCard(int playerID, string cardName) { GiveCardToPlayer(playerID, cardName); } private static void GiveCardToPlayer(int playerID, string cardName) { Player val = PlayerManager.instance.players.Find((Player p) => p.playerID == playerID); if (!((Object)(object)val == (Object)null)) { CardInfo cardWithObjectName = Cards.instance.GetCardWithObjectName(cardName); if (!((Object)(object)cardWithObjectName == (Object)null)) { Cards.instance.AddCardToPlayer(val, cardWithObjectName, false, "", 0f, 0f, true); CardBarUtils.instance.ShowAtEndOfPhase(val, cardWithObjectName); } } } private CardInfo GetRandomCardWithRarity(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats, Rarity rarity) { //IL_000e: 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) CardInfo val = Cards.instance.NORARITY_GetRandomCardWithCondition(player, gun, gunAmmo, data, health, gravity, block, characterStats, (Func)((CardInfo c, Player p, Gun g, GunAmmo ga, CharacterData d, HealthHandler h, Gravity gr, Block b, CharacterStatModifiers s) => CheckCardCondition(c, rarity)), 1000); if ((Object)(object)val != (Object)null) { return val; } try { ObservableCollection source = (ObservableCollection)typeof(CardManager).GetField("activeCards", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null); List second = (List)typeof(CardManager).GetField("inactiveCards", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null); CardInfo[] array = source.ToList().Concat(second).ToArray(); val = Cards.instance.DrawRandomCardWithCondition(array, player, gun, gunAmmo, data, health, gravity, block, characterStats, (Func)((CardInfo c, Player p, Gun g, GunAmmo ga, CharacterData d, HealthHandler h, Gravity gr, Block b, CharacterStatModifiers s) => CheckCardCondition(c, rarity)), 1000); } catch { } return val; } private bool CheckCardCondition(CardInfo card, Rarity rarity) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) if (card.rarity != rarity) { return false; } if (card.categories.Intersect(noLotteryCategories).Any()) { return false; } if (!CardCheck.IsFromAllowedMod(card)) { return false; } if (!CardInfoExtension.GetAdditionalData(card).canBeReassigned) { return false; } return true; } 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 "Surprise Gift"; } protected override string GetDescription() { return "Gives a random card from BFRM, MFM, IS, or DRON."; } 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)1; } protected override CardInfoStat[] GetStats() { return (CardInfoStat[])(object)new CardInfoStat[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)8; } public override string GetModName() { return "BFRM"; } } internal class TakeAimCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { gun.useCharge = true; gun.chargeSpeedTo = 10f; gun.chargeSpreadTo = 0f; gun.multiplySpread = 0f; gun.chargeDamageMultiplier = 2.7f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "Take Aim"; } protected override string GetDescription() { return "Hold down your mouse button to charge fast and accurate shot \nOn charge:"; } protected override GameObject GetCardArt() { return Assets.TakeAimArt; } 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_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 = true, stat = "Bullet Speed", amount = "+1000%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Bullet Spread", amount = "-100%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Damage", amount = "+170%", 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 "IS"; } } internal class TankCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { statModifiers.health = 3f; block.cdMultiplier = 3f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "Tank 2.0"; } protected override string GetDescription() { return "Need mooore HP!"; } protected override GameObject GetCardArt() { return Assets.TankArt; } 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 return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Health", amount = "+200%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Block Cooldown", amount = "+200%", 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)8; } public override string GetModName() { return "DRON"; } } public class ThornShieldCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ThornShieldMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component == (Object)null) { ((Component)player).gameObject.AddComponent(); } else { component.AddStack(); } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ThornShieldMono component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.RemoveStack(); if (component.stackCount <= 0) { Object.Destroy((Object)(object)component); } } } protected override string GetTitle() { return "Thorn Shield"; } protected override string GetDescription() { return "Block to activate Thorns, reflecting 10% damage back to attackers."; } protected override GameObject GetCardArt() { return Assets.ThornShieldArt; } 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_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 = true, stat = "Damage Reflect", amount = "10%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Effect Duration", amount = "3s", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Cooldown", amount = "10s", 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)2; } public override string GetModName() { return "DRON"; } } public class ThunderCoreCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Expected O, but got Unknown gun.projectileColor = new Color(0.5f, 0.8f, 1f, 1f); ElectricBulletEffect component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.stackCount++; } else { ElectricBulletEffect electricBulletEffect = ((Component)player).gameObject.AddComponent(); electricBulletEffect.stackCount = 1; List list = gun.objectsToSpawn.ToList(); ObjectsToSpawn val = new ObjectsToSpawn(); val.AddToProjectile = new GameObject("A_ElectricBullet", new Type[1] { typeof(ElectricBulletMono) }); list.Add(val); gun.objectsToSpawn = list.ToArray(); } ArcFieldHelper.CheckUnlockArcField(player); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ElectricBulletEffect component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } ArcFieldHelper.CheckLockArcField(player, "ThunderCore"); } protected override string GetTitle() { return "Thunder Core"; } protected override string GetDescription() { return "Electric shots shock nearby enemies; +1% arc damage and +10% radius per stack (multiplicative)."; } 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)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_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 = true, stat = "Arc Damage", amount = "1%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Tick Rate", amount = "0.03s", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Arc Radius", amount = "3m", 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)3; } public override string GetModName() { return "BFRM"; } } public class ElectricBulletEffect : MonoBehaviour { public int stackCount = 1; } public class LightningArcAutoDestroy : MonoBehaviour { public float lifetime = 0.15f; private float timer = 0f; private LineRenderer lineRenderer; private Color startColorInitial; private Color endColorInitial; private void Start() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) lineRenderer = ((Component)this).GetComponent(); if ((Object)(object)lineRenderer != (Object)null) { startColorInitial = lineRenderer.startColor; endColorInitial = lineRenderer.endColor; } } private void Update() { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) timer += Time.deltaTime; if ((Object)(object)lineRenderer != (Object)null) { float num = 1f - timer / lifetime; lineRenderer.startColor = new Color(startColorInitial.r, startColorInitial.g, startColorInitial.b, startColorInitial.a * num); lineRenderer.endColor = new Color(endColorInitial.r, endColorInitial.g, endColorInitial.b, endColorInitial.a * num); } if (timer >= lifetime) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class ElectricBulletMono : MonoBehaviour { private ProjectileHit projectile; private Player owner; private int stackCount = 1; private float baseDamageRadius = 3f; private float damageRadius = 3f; private float tickInterval = 0.03f; private float baseDamageMultiplier = 0.01f; private float damageMultiplier = 0.01f; private bool isActive = false; private float activationDistance = 1f; private float distanceTraveled = 0f; private float nextTickTime = 0f; private float arcDuration = 0.7f; private LineRenderer ambientArc; private float ambientArcTimer = 0f; private float ambientArcChangeInterval = 0.1f; private static Material sharedMaterial; private Player[] cachedPlayers; private Vector3 lastPosition; private static int wallLayerMask = -1; private void Start() { //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) projectile = ((Component)this).GetComponentInParent(); if ((Object)(object)projectile != (Object)null) { owner = projectile.ownPlayer; if ((Object)(object)owner != (Object)null) { ElectricBulletEffect component = ((Component)owner).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { stackCount = component.stackCount; damageRadius = baseDamageRadius * Mathf.Pow(1.1f, (float)(stackCount - 1)); damageMultiplier = baseDamageMultiplier * (float)stackCount; } } } if ((Object)(object)sharedMaterial == (Object)null) { sharedMaterial = new Material(Shader.Find("Sprites/Default")); } if (wallLayerMask == -1) { wallLayerMask = LayerMask.GetMask(new string[3] { "Default", "Obstacle", "IgnorePlayer" }); if (wallLayerMask == 0) { wallLayerMask = ~LayerMask.GetMask(new string[2] { "Player", "PlayerObjectCollider" }); } } cachedPlayers = PlayerManager.instance.players.ToArray(); lastPosition = ((Component)this).transform.position; nextTickTime = Time.time + tickInterval; CreateAmbientElectricEffect(); } private void Update() { if (!((Object)(object)owner == (Object)null)) { UpdateDistanceTraveled(); if (!isActive && distanceTraveled >= damageRadius + activationDistance) { ActivateElectricEffect(); } if (isActive && Time.time >= nextTickTime) { DischargeElectricity(); nextTickTime = Time.time + tickInterval; } UpdateAmbientEffect(); } } private void UpdateDistanceTraveled() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; float num = Vector3.Distance(lastPosition, position); distanceTraveled += num; lastPosition = position; } private void ActivateElectricEffect() { //IL_0033: 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) isActive = true; if ((Object)(object)ambientArc != (Object)null) { ambientArc.startColor = new Color(0.5f, 0.8f, 1f, 0.8f); ambientArc.endColor = new Color(1f, 1f, 1f, 0.6f); } } private void DischargeElectricity() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a8: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f5: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) float num = 55f; if ((Object)(object)projectile != (Object)null && projectile.damage > 0f) { num = projectile.damage; } float num2 = num * damageMultiplier; Vector3 position = ((Component)this).transform.position; for (int i = 0; i < cachedPlayers.Length; i++) { Player val = cachedPlayers[i]; if (!((Object)(object)val == (Object)null) && !val.data.dead && ((Component)val).gameObject.activeInHierarchy) { Vector3 position2 = ((Component)val).transform.position; float num3 = Vector2.Distance(Vector2.op_Implicit(position), Vector2.op_Implicit(position2)); if (num3 <= damageRadius && HasLineOfSight(position, position2)) { Vector3 val2 = position2 - position; Vector2 val3 = Vector2.op_Implicit(((Vector3)(ref val2)).normalized); ((Damagable)val.data.healthHandler).CallTakeDamage(val3 * num2, Vector2.op_Implicit(position), (GameObject)null, owner, true); CreateLightningArc(val, position); } } } } private bool HasLineOfSight(Vector3 from, Vector3 to) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //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) Vector2 val = Vector2.op_Implicit(to - from); float magnitude = ((Vector2)(ref val)).magnitude; RaycastHit2D val2 = Physics2D.Raycast(Vector2.op_Implicit(from), ((Vector2)(ref val)).normalized, magnitude, wallLayerMask); return (Object)(object)((RaycastHit2D)(ref val2)).collider == (Object)null; } private void CreateLightningArc(Player target, Vector3 sourcePosition) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject($"ElectricArc_{target.playerID}"); val.transform.position = sourcePosition; LineRenderer val2 = val.AddComponent(); val2.startWidth = 0.1f; val2.endWidth = 0.05f; val2.positionCount = 5; ((Renderer)val2).material = sharedMaterial; val2.startColor = new Color(0.5f, 0.8f, 1f, 1f); val2.endColor = new Color(1f, 1f, 1f, 0.7f); ((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val2).receiveShadows = false; Vector3 position = ((Component)target).transform.position; val2.SetPosition(0, sourcePosition); for (int i = 1; i < val2.positionCount - 1; i++) { float num = (float)i / (float)(val2.positionCount - 1); Vector3 val3 = Vector3.Lerp(sourcePosition, position, num); val3 += Vector2.op_Implicit(Random.insideUnitCircle) * 0.25f; val2.SetPosition(i, val3); } val2.SetPosition(val2.positionCount - 1, position); LightningArcAutoDestroy lightningArcAutoDestroy = val.AddComponent(); lightningArcAutoDestroy.lifetime = arcDuration; } private void OnDestroy() { if ((Object)(object)ambientArc != (Object)null) { Object.Destroy((Object)(object)((Component)ambientArc).gameObject); } } private void CreateAmbientElectricEffect() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0024: 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_00ba: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("AmbientElectricArc"); val.transform.SetParent(((Component)this).transform); val.transform.localPosition = Vector3.zero; ambientArc = val.AddComponent(); ambientArc.startWidth = 0.08f; ambientArc.endWidth = 0.04f; ambientArc.positionCount = 4; ((Renderer)ambientArc).material = sharedMaterial; ambientArc.startColor = new Color(0.5f, 0.8f, 1f, 0.3f); ambientArc.endColor = new Color(1f, 1f, 1f, 0.2f); ((Renderer)ambientArc).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)ambientArc).receiveShadows = false; } private void UpdateAmbientEffect() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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_00eb: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ambientArc == (Object)null) { return; } ambientArcTimer += Time.deltaTime; if (ambientArcTimer >= ambientArcChangeInterval) { ambientArcTimer = 0f; float num = (isActive ? 0.4f : 0.2f); if (stackCount > 1) { num *= Mathf.Pow(1.05f, (float)(stackCount - 1)); } Vector3 position = ((Component)this).transform.position; Vector3 val = default(Vector3); for (int i = 0; i < ambientArc.positionCount; i++) { float num2 = Random.Range(0f, 360f) * (MathF.PI / 180f); float num3 = Random.Range(num * 0.5f, num); ((Vector3)(ref val))..ctor(Mathf.Cos(num2) * num3, Mathf.Sin(num2) * num3, 0f); ambientArc.SetPosition(i, position + val); } } } } public class TrafficLightCard : CustomCard { public const float PENALTY_PER_HIT = 0.5f; public const int AFFECTED_BLOCKS = 3; public const int MAX_STACKS = 3; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo ammo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers stats) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown TrafficLightOwnerEffect trafficLightOwnerEffect = ((Component)player).gameObject.GetComponent(); if ((Object)(object)trafficLightOwnerEffect == (Object)null) { trafficLightOwnerEffect = ((Component)player).gameObject.AddComponent(); List list = gun.objectsToSpawn.ToList(); ObjectsToSpawn val = new ObjectsToSpawn(); val.AddToProjectile = new GameObject("TrafficLight_Debuff", new Type[1] { typeof(TrafficLightProjectile) }); list.Add(val); gun.objectsToSpawn = list.ToArray(); } trafficLightOwnerEffect.cardCount++; } public override void OnRemoveCard(Player player, Gun gun, GunAmmo ammo, CharacterData d, HealthHandler h, Gravity g, Block b, CharacterStatModifiers s) { TrafficLightOwnerEffect component = ((Component)player).GetComponent(); if (!((Object)(object)component == (Object)null)) { component.cardCount--; if (component.cardCount <= 0) { Object.Destroy((Object)(object)component); } } } protected override string GetTitle() { return "Traffic Light"; } protected override string GetDescription() { return "Hits add delay before enemy can block."; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { return (Rarity)1; } protected override CardInfoStat[] GetStats() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[3] { new CardInfoStat { positive = true, stat = "Block Delay", amount = "+0.5s" }, new CardInfoStat { positive = true, stat = "Next Blocks", amount = "3" }, new CardInfoStat { positive = true, stat = "Max Stacks", amount = "3" } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)4; } public override string GetModName() { return "BFRM"; } } public class TrafficLightOwnerEffect : MonoBehaviour { public int cardCount = 0; } public class TrafficLightProjectile : RayHitEffect { private Player owner; private static readonly Color EFFECT_COLOR = new Color(0.6f, 0.2f, 0.8f, 1f); private void Start() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) ProjectileHit componentInParent = ((Component)this).GetComponentInParent(); if (!((Object)(object)componentInParent == (Object)null)) { owner = componentInParent.ownPlayer; if (!((Object)(object)owner == (Object)null)) { ColorizeProjectile(componentInParent, EFFECT_COLOR); } } } private void ColorizeProjectile(ProjectileHit projectile, Color c) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_009a: 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) if (!((Object)(object)projectile == (Object)null)) { projectile.projectileColor = c; SpriteRenderer componentInChildren = ((Component)projectile).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.color = c; } TrailRenderer componentInChildren2 = ((Component)projectile).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null) { componentInChildren2.startColor = c; componentInChildren2.endColor = new Color(c.r, c.g, c.b, 0.2f); } LineRenderer componentInChildren3 = ((Component)projectile).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren3 != (Object)null) { componentInChildren3.startColor = c; componentInChildren3.endColor = c; } } } public override HasToReturn DoHitEffect(HitInfo hit) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)hit.transform)) { return (HasToReturn)1; } Player component = ((Component)hit.transform).GetComponent(); if ((Object)(object)component == (Object)null || component.data.dead) { return (HasToReturn)1; } if ((Object)(object)owner != (Object)null && owner.data.view.IsMine) { NetworkingManager.RPC(typeof(TrafficLightProjectile), "RPC_ApplyTrafficLightDebuff", new object[1] { component.playerID }); } return (HasToReturn)1; } [UnboundRPC] public static void RPC_ApplyTrafficLightDebuff(int targetPlayerID) { Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player p) => p.playerID == targetPlayerID)); if (!((Object)(object)val == (Object)null)) { TrafficLightDebuff component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { component.AddCurse(3, 0.5f); return; } component = ((Component)val).gameObject.AddComponent(); component.Initialize(val); } } } [HarmonyPatch(typeof(Block), "blocked")] public class TrafficLightBlockedPatch { public static void Postfix(Block __instance, GameObject projectile) { if ((Object)(object)projectile == (Object)null) { return; } TrafficLightProjectile componentInChildren = projectile.GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { return; } ProjectileHit component = projectile.GetComponent(); if ((Object)(object)component == (Object)null) { return; } Player ownPlayer = component.ownPlayer; if (!((Object)(object)ownPlayer == (Object)null)) { Player component2 = ((Component)__instance).GetComponent(); if (!((Object)(object)component2 == (Object)null) && !component2.data.dead && ownPlayer.data.view.IsMine) { NetworkingManager.RPC(typeof(TrafficLightProjectile), "RPC_ApplyTrafficLightDebuff", new object[1] { component2.playerID }); } } } } [HarmonyPatch(typeof(Block), "TryBlock")] public class TrafficLightTryBlockPatch { public static bool Prefix(Block __instance, ref bool __state) { __state = false; TrafficLightDebuff component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } if (component.IsDelaying) { return false; } if (component.HasPenalty() && __instance.counter >= __instance.Cooldown()) { Player component2 = ((Component)__instance).GetComponent(); if ((Object)(object)component2 != (Object)null && component2.data.view.IsMine) { __state = true; } } return true; } public static void Postfix(Block __instance, bool __state) { if (__state) { TrafficLightDebuff component = ((Component)__instance).GetComponent(); if (!((Object)(object)component == (Object)null)) { component.StartPostBlockDelay(__instance); } } } } public class TrafficLightDebuff : MonoBehaviour { [CompilerGenerated] private sealed class d__33 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject dot; public bool callCleanupAfter; public TrafficLightDebuff <>4__this; private float 5__1; private float 5__2; private float 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__33(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00a3: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = 0.2f; 5__2 = 0f; break; case 1: <>1__state = -1; break; } if (5__2 < 5__1) { if ((Object)(object)dot == (Object)null) { return false; } 5__2 += Time.deltaTime; 5__3 = Mathf.Clamp01(5__2 / 5__1); dot.transform.localScale = new Vector3(1f - 5__3, 1f - 5__3, 1f); <>2__current = null; <>1__state = 1; return true; } if ((Object)(object)dot != (Object)null) { Object.Destroy((Object)(object)dot); } if ((Object)(object)<>4__this.pendingDestroyDot == (Object)(object)dot) { <>4__this.pendingDestroyDot = null; } if (callCleanupAfter) { <>4__this.CleanupAfterLastBlock(); } 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 d__36 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public TrafficLightDebuff <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__36(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.Cleanup(); 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 d__37 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; public TrafficLightDebuff <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__37(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; <>4__this.Cleanup(); 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 d__27 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Block block; public float penalty; public TrafficLightDebuff <>4__this; private float 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__27(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = 0f; break; case 1: <>1__state = -1; break; } if (5__1 < penalty) { 5__1 += TimeHandler.deltaTime; if ((Object)(object)block != (Object)null) { block.counter = 0f; } <>2__current = null; <>1__state = 1; return true; } <>4__this.IsDelaying = false; NetworkingManager.RPC(typeof(TrafficLightDebuff), "RPC_RemovePenalty", new object[1] { <>4__this.target.playerID }); 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 d__30 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float penalty; public TrafficLightDebuff <>4__this; private float 5__1; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__30(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = 0f; break; case 1: <>1__state = -1; break; } if (5__1 < penalty) { 5__1 += TimeHandler.deltaTime; 5__2 = Mathf.Clamp01(5__1 / penalty); <>4__this.UpdateArcProgress(5__2); <>2__current = null; <>1__state = 1; return true; } <>4__this.UpdateArcProgress(1f); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Player target; private CharacterData data; private List blockPenalties = new List(); private bool active = false; private Coroutine delayCoroutine; private Coroutine visualDelayCoroutine; private float currentArcProgress = 0f; private GameObject pendingDestroyDot; private const float DOT_SPACING = 0.38f; private const float Y_OFFSET = 1.6f; private const int SECTOR_RESOLUTION = 36; private const float SECTOR_RADIUS = 0.19f; private static readonly Color[] STACK_COLORS = (Color[])(object)new Color[3] { new Color(0.25f, 0.72f, 0.32f, 0.85f), new Color(0.92f, 0.84f, 0.38f, 0.85f), new Color(0.82f, 0.28f, 0.28f, 0.9f) }; private static readonly Color SHADOW_COLOR = new Color(0.1f, 0f, 0.1f, 0.6f); private static readonly Color[] SECTOR_FILL_COLORS = (Color[])(object)new Color[3] { new Color(0.05f, 0.32f, 0.09f, 0.95f), new Color(0.45f, 0.38f, 0.06f, 0.95f), new Color(0.38f, 0.05f, 0.05f, 0.95f) }; private GameObject uiContainer; private List dotObjects = new List(); private Transform wobbleTransform; private GameObject clockContainer; private Mesh clockFillMesh; public bool IsDelaying { get; private set; } = false; public void Initialize(Player t) { target = t; data = t.data; if ((Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive)); } GameModeManager.AddHook("PointStart", (Func)OnPointStart); GameModeManager.AddHook("RoundStart", (Func)OnRoundStart); active = true; CreateUI(); AddCurse(3, 0.5f); UpdateUIPosition(); } public bool HasPenalty() { return active && blockPenalties.Count > 0; } public void StartPostBlockDelay(Block block) { if (!IsDelaying && blockPenalties.Count != 0) { IsDelaying = true; float num = blockPenalties[0]; NetworkingManager.RPC(typeof(TrafficLightDebuff), "RPC_StartDelay", new object[2] { target.playerID, num }); delayCoroutine = ((MonoBehaviour)this).StartCoroutine(PostBlockDelayCoroutine(block, num)); } } [IteratorStateMachine(typeof(d__27))] private IEnumerator PostBlockDelayCoroutine(Block block, float penalty) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__27(0) { <>4__this = this, block = block, penalty = penalty }; } [UnboundRPC] public static void RPC_StartDelay(int targetPlayerID, float penalty) { Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player p) => p.playerID == targetPlayerID)); if (!((Object)(object)val == (Object)null)) { TrafficLightDebuff component = ((Component)val).GetComponent(); if (!((Object)(object)component == (Object)null)) { component.StartVisualDelay(penalty); } } } public void StartVisualDelay(float penalty) { currentArcProgress = 0f; IsDelaying = true; if (visualDelayCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(visualDelayCoroutine); visualDelayCoroutine = null; } UpdateUI(); visualDelayCoroutine = ((MonoBehaviour)this).StartCoroutine(VisualDelayCoroutine(penalty)); } [IteratorStateMachine(typeof(d__30))] private IEnumerator VisualDelayCoroutine(float penalty) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__30(0) { <>4__this = this, penalty = penalty }; } [UnboundRPC] public static void RPC_RemovePenalty(int targetPlayerID) { Player val = ((IEnumerable)PlayerManager.instance.players).FirstOrDefault((Func)((Player p) => p.playerID == targetPlayerID)); if (!((Object)(object)val == (Object)null)) { TrafficLightDebuff component = ((Component)val).GetComponent(); if (!((Object)(object)component == (Object)null)) { component.RemoveFirstPenalty(); } } } private void RemoveFirstPenalty() { IsDelaying = false; if (visualDelayCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(visualDelayCoroutine); visualDelayCoroutine = null; } UpdateArcProgress(1f); if (blockPenalties.Count > 0) { blockPenalties.RemoveAt(0); } bool flag = blockPenalties.Count == 0; GameObject val = null; if (dotObjects.Count > 0) { val = dotObjects[0]; dotObjects.RemoveAt(0); clockContainer = null; clockFillMesh = null; } UpdateUI(); if ((Object)(object)val != (Object)null) { pendingDestroyDot = val; ((MonoBehaviour)this).StartCoroutine(DotDisappearCoroutine(val, flag)); } else if (flag) { CleanupAfterLastBlock(); } } [IteratorStateMachine(typeof(d__33))] private IEnumerator DotDisappearCoroutine(GameObject dot, bool callCleanupAfter) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__33(0) { <>4__this = this, dot = dot, callCleanupAfter = callCleanupAfter }; } private void OnRevive() { Cleanup(); } public void AddCurse(int blocksAffected, float penalty) { float num = 1.5f; for (int i = 0; i < blocksAffected; i++) { if (i < blockPenalties.Count) { blockPenalties[i] = Mathf.Min(blockPenalties[i] + penalty, num); } else { blockPenalties.Add(penalty); } } UpdateUI(); } [IteratorStateMachine(typeof(d__36))] private IEnumerator OnPointStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__36(0) { <>4__this = this, gm = gm }; } [IteratorStateMachine(typeof(d__37))] private IEnumerator OnRoundStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__37(0) { <>4__this = this, gm = gm }; } private void CleanupAfterLastBlock() { active = false; if ((Object)(object)data != (Object)null && (Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive)); } GameModeManager.RemoveHook("PointStart", (Func)OnPointStart); GameModeManager.RemoveHook("RoundStart", (Func)OnRoundStart); DestroyUI(); Object.Destroy((Object)(object)this); } private void Update() { if ((Object)(object)target == (Object)null) { Cleanup(); return; } if ((Object)(object)data != (Object)null && data.dead) { HideUI(); return; } ShowUI(); UpdateUIPosition(); } private void OnDisable() { HideUI(); } private void HideUI() { if ((Object)(object)uiContainer != (Object)null) { uiContainer.SetActive(false); } } private void ShowUI() { if ((Object)(object)uiContainer != (Object)null && !uiContainer.activeSelf) { uiContainer.SetActive(true); } } private void CreateUI() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown PlayerWobblePosition componentInChildren = ((Component)target).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { wobbleTransform = ((Component)componentInChildren).transform; } uiContainer = new GameObject("TrafficLightDebuffUI"); if ((Object)(object)wobbleTransform != (Object)null) { uiContainer.transform.SetParent(wobbleTransform, false); } else { uiContainer.transform.SetParent(((Component)target).transform, false); } } private void UpdateUI() { //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_00f4: Unknown result type (might be due to invalid IL or missing references) foreach (GameObject dotObject in dotObjects) { if ((Object)(object)dotObject != (Object)null) { Object.Destroy((Object)(object)dotObject); } } dotObjects.Clear(); DestroyArcTimer(); if (blockPenalties.Count == 0 || (Object)(object)uiContainer == (Object)null) { return; } float num = (float)(blockPenalties.Count - 1) * 0.38f; float num2 = (0f - num) / 2f; for (int i = 0; i < blockPenalties.Count; i++) { float xOffset = num2 + (float)i * 0.38f; int num3 = Mathf.RoundToInt(blockPenalties[i] / 0.5f); int num4 = Mathf.Clamp(num3 - 1, 0, STACK_COLORS.Length - 1); Color color = STACK_COLORS[num4]; GameObject val = CreateDot(xOffset, color); dotObjects.Add(val); if (i == 0) { CreateArcTimer(val.transform, num4); if (IsDelaying && currentArcProgress > 0f) { UpdateArcProgress(currentArcProgress); } } } } private void CreateArcTimer(Transform parentDot, int colorIndex) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown //IL_00a6: 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_00d0: Expected O, but got Unknown clockContainer = new GameObject("ArcTimer"); clockContainer.transform.SetParent(parentDot, false); clockContainer.transform.localPosition = Vector3.zero; GameObject val = new GameObject("ArcFill"); val.transform.SetParent(clockContainer.transform, false); MeshFilter val2 = val.AddComponent(); MeshRenderer val3 = val.AddComponent(); ((Renderer)val3).sortingLayerName = "MostFront"; ((Renderer)val3).sortingOrder = 102; Material val4 = new Material(Shader.Find("Sprites/Default")); val4.color = SECTOR_FILL_COLORS[Mathf.Clamp(colorIndex, 0, SECTOR_FILL_COLORS.Length - 1)]; ((Renderer)val3).material = val4; clockFillMesh = new Mesh { name = "FillSector" }; val2.mesh = clockFillMesh; } private void UpdateArcProgress(float progress) { //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_00cd: 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_00dc: Unknown result type (might be due to invalid IL or missing references) currentArcProgress = progress; if ((Object)(object)clockFillMesh == (Object)null) { return; } if (progress <= 0f) { clockFillMesh.Clear(); return; } int num = ((progress >= 1f) ? 36 : Mathf.Max(1, Mathf.RoundToInt(progress * 36f))); float num2 = Mathf.Min(progress, 1f) * 360f; Vector3[] array = (Vector3[])(object)new Vector3[num + 2]; int[] array2 = new int[num * 3]; array[0] = Vector3.zero; for (int i = 0; i <= num; i++) { float num3 = (float)i / (float)num; float num4 = 90f - num3 * num2; float num5 = num4 * (MathF.PI / 180f); array[i + 1] = new Vector3(Mathf.Cos(num5), Mathf.Sin(num5), 0f) * 0.19f; } for (int j = 0; j < num; j++) { array2[j * 3] = 0; array2[j * 3 + 1] = j + 1; array2[j * 3 + 2] = j + 2; } clockFillMesh.Clear(); clockFillMesh.vertices = array; clockFillMesh.triangles = array2; clockFillMesh.RecalculateBounds(); } private void DestroyArcTimer() { clockFillMesh = null; if ((Object)(object)clockContainer != (Object)null) { Object.Destroy((Object)(object)clockContainer); clockContainer = null; } } private static Mesh BuildCircleMesh(float radius, int segments) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown Vector3[] array = (Vector3[])(object)new Vector3[segments + 2]; int[] array2 = new int[segments * 3]; array[0] = Vector3.zero; for (int i = 0; i <= segments; i++) { float num = 90f - (float)i / (float)segments * 360f; float num2 = num * (MathF.PI / 180f); array[i + 1] = new Vector3(Mathf.Cos(num2), Mathf.Sin(num2), 0f) * radius; } for (int j = 0; j < segments; j++) { array2[j * 3] = 0; array2[j * 3 + 1] = j + 1; array2[j * 3 + 2] = j + 2; } Mesh val = new Mesh { name = "Circle" }; val.vertices = array; val.triangles = array2; val.RecalculateBounds(); return val; } private GameObject CreateDot(float xOffset, Color color) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Expected O, but got Unknown //IL_0149: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Dot"); val.transform.SetParent(uiContainer.transform, false); val.transform.localPosition = new Vector3(xOffset, 0f, 0f); GameObject val2 = new GameObject("Shadow"); val2.transform.SetParent(val.transform, false); val2.transform.localPosition = new Vector3(0.018f, -0.018f, 0.1f); MeshFilter val3 = val2.AddComponent(); MeshRenderer val4 = val2.AddComponent(); ((Renderer)val4).sortingLayerName = "MostFront"; ((Renderer)val4).sortingOrder = 99; Material val5 = new Material(Shader.Find("Sprites/Default")); val5.color = SHADOW_COLOR; ((Renderer)val4).material = val5; val3.mesh = BuildCircleMesh(0.19f, 36); GameObject val6 = new GameObject("Circle"); val6.transform.SetParent(val.transform, false); val6.transform.localPosition = Vector3.zero; MeshFilter val7 = val6.AddComponent(); MeshRenderer val8 = val6.AddComponent(); ((Renderer)val8).sortingLayerName = "MostFront"; ((Renderer)val8).sortingOrder = 100; Material val9 = new Material(Shader.Find("Sprites/Default")); val9.color = color; ((Renderer)val8).material = val9; val7.mesh = BuildCircleMesh(0.19f, 36); return val; } private void UpdateUIPosition() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)uiContainer == (Object)null) && !((Object)(object)target == (Object)null)) { uiContainer.transform.localPosition = new Vector3(0f, 1.6f, 0f); } } private void DestroyUI() { foreach (GameObject dotObject in dotObjects) { if ((Object)(object)dotObject != (Object)null) { Object.Destroy((Object)(object)dotObject); } } dotObjects.Clear(); DestroyArcTimer(); if ((Object)(object)uiContainer != (Object)null) { Object.Destroy((Object)(object)uiContainer); uiContainer = null; } } private void Cleanup() { if (active) { active = false; if (delayCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(delayCoroutine); delayCoroutine = null; } if (visualDelayCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(visualDelayCoroutine); visualDelayCoroutine = null; } IsDelaying = false; if ((Object)(object)data != (Object)null && (Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive)); } blockPenalties.Clear(); GameModeManager.RemoveHook("PointStart", (Func)OnPointStart); GameModeManager.RemoveHook("RoundStart", (Func)OnRoundStart); DestroyUI(); Object.Destroy((Object)(object)this); } } private void OnDestroy() { if (delayCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(delayCoroutine); } if (visualDelayCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(visualDelayCoroutine); } if ((Object)(object)data != (Object)null && (Object)(object)data.healthHandler != (Object)null) { HealthHandler healthHandler = data.healthHandler; healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive)); } GameModeManager.RemoveHook("PointStart", (Func)OnPointStart); GameModeManager.RemoveHook("RoundStart", (Func)OnRoundStart); if ((Object)(object)pendingDestroyDot != (Object)null) { Object.Destroy((Object)(object)pendingDestroyDot); pendingDestroyDot = null; } DestroyUI(); } } public class VengefulSparkCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = false; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { VengefulSparkEffect orAddComponent = ExtensionMethods.GetOrAddComponent(((Component)player).gameObject, false); orAddComponent.Initialize(); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { VengefulSparkEffect component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Vengeful Spark"; } protected override string GetDescription() { return $"When hit, fires a copy of the attacker's bullet back at them with {30.000002f:0}% damage."; } protected override GameObject GetCardArt() { return null; } protected override Rarity GetRarity() { 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_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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0044: 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_0050: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Damage Reflect", amount = $"{30.000002f:0}%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Cooldown", amount = "0.5s", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)2; } public override string GetModName() { return "BFRM"; } } public static class BurnEffectManager { [CompilerGenerated] private sealed class d__5 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IGameModeHandler gm; private List 5__1; private List.Enumerator <>s__2; private BurnEffect 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>s__2 = default(List.Enumerator); 5__3 = null; <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; 5__1 = new List(activeBurns); <>s__2 = 5__1.GetEnumerator(); try { while (<>s__2.MoveNext()) { 5__3 = <>s__2.Current; if ((Object)(object)5__3 != (Object)null) { 5__3.StopBurn(); Object.Destroy((Object)(object)5__3); } 5__3 = null; } } finally { ((IDisposable)<>s__2).Dispose(); } <>s__2 = default(List.Enumerator); activeBurns.Clear(); 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 static readonly HashSet activeBurns = new HashSet(); private static bool hooksRegistered = false; public static void EnsureInitialized() { if (!hooksRegistered) { hooksRegistered = true; GameModeManager.AddHook("PointEnd", (Func)OnPointEnd); } } public static void Register(BurnEffect burn) { EnsureInitialized(); activeBurns.Add(burn); } public static void Unregister(BurnEffect burn) { activeBurns.Remove(burn); } [IteratorStateMachine(typeof(d__5))] private static IEnumerator OnPointEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0) { gm = gm }; } public static void ClearAll() { List list = new List(activeBurns); foreach (BurnEffect item in list) { if ((Object)(object)item != (Object)null) { Object.Destroy((Object)(object)item); } } activeBurns.Clear(); } } public class BurnEffect : MonoBehaviour { private Player owner; private int ownerID; private Player victim; private float burnEndTime; private float lastDamageTime; private bool isActive = true; private const float BURN_DURATION = 2f; private const float BURN_DAMAGE_PERCENT_TOTAL = 0.01f; private const float BURN_DAMAGE_INTERVAL = 0.5f; public void Apply(Player attacker, float duration = 2f) { owner = attacker; ownerID = (((Object)(object)attacker != (Object)null) ? attacker.playerID : (-1)); victim = ((Component)this).GetComponent(); burnEndTime = Time.time + duration; lastDamageTime = Time.time; isActive = true; BurnEffectManager.Register(this); } public void RefreshDuration(float duration = 2f) { burnEndTime = Time.time + duration; } public void StopBurn() { isActive = false; } private void Update() { if (!isActive || (Object)(object)GameManager.instance == (Object)null || !GameManager.instance.battleOngoing) { return; } if ((Object)(object)victim == (Object)null || (Object)(object)victim.data == (Object)null || victim.data.dead) { Object.Destroy((Object)(object)this); return; } if ((Object)(object)owner == (Object)null || (Object)(object)owner.data == (Object)null || owner.data.dead) { owner = FindPlayerByID(ownerID); if ((Object)(object)owner == (Object)null || (Object)(object)owner.data == (Object)null || owner.data.dead) { Object.Destroy((Object)(object)this); return; } } if (Time.time >= burnEndTime) { Object.Destroy((Object)(object)this); } else if (Time.time >= lastDamageTime + 0.5f) { DealBurnDamage(); lastDamageTime = Time.time; } } private void DealBurnDamage() { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)victim == (Object)null) && !((Object)(object)victim.data == (Object)null) && !victim.data.dead && !((Object)(object)owner == (Object)null) && !((Object)(object)owner.data == (Object)null) && !owner.data.dead) { float num = 4f; float num2 = victim.data.maxHealth * (0.01f / num); ((Damagable)victim.data.healthHandler).CallTakeDamage(Vector2.up * num2, Vector2.op_Implicit(((Component)victim).transform.position), (GameObject)null, owner, true); } } private Player FindPlayerByID(int playerID) { if (playerID < 0) { return null; } foreach (Player player in PlayerManager.instance.players) { if ((Object)(object)player != (Object)null && player.playerID == playerID) { return player; } } return null; } private void OnDestroy() { BurnEffectManager.Unregister(this); } } public static class AuraHelper { public static CardInfo FindCard(List cards, string cardName) { string cardName2 = cardName; if (cards == null || cards.Count == 0) { return null; } CardInfo val = cards.Find((CardInfo c) => c.cardName == cardName2); if ((Object)(object)val != (Object)null) { return val; } return cards.Find((CardInfo c) => c.cardName.EndsWith(cardName2)); } public static bool MatchesCardName(CardInfo card, string cardName) { if ((Object)(object)card == (Object)null || string.IsNullOrEmpty(cardName)) { return false; } return card.cardName == cardName || card.cardName.EndsWith(cardName); } public static void ApplyDebuffsToEnemies(Player player, string auraCardName, string debuffCardName) { int num = CountCards(player, auraCardName) + 1; bool flag = PhotonNetwork.OfflineMode; if (!flag && (Object)(object)player.data.view != (Object)null) { flag = player.data.view.IsMine; } if (flag) { if (PhotonNetwork.OfflineMode) { ApplyDebuffsToEnemiesInternal(player.playerID, num, debuffCardName); return; } NetworkingManager.RPC(typeof(AuraHelper), "RPCA_ApplyDebuffsToEnemies", new object[3] { player.playerID, num, debuffCardName }); } } [UnboundRPC] public static void RPCA_ApplyDebuffsToEnemies(int auraOwnerPlayerID, int auraCount, string debuffCardName) { ApplyDebuffsToEnemiesInternal(auraOwnerPlayerID, auraCount, debuffCardName); } private static void ApplyDebuffsToEnemiesInternal(int auraOwnerPlayerID, int auraCount, string debuffCardName) { if (MrFuntikMod.hiddenCards == null) { return; } CardInfo val = FindCard(MrFuntikMod.hiddenCards, debuffCardName); if ((Object)(object)val == (Object)null) { return; } Player val2 = PlayerManager.instance.players.Find((Player p) => p.playerID == auraOwnerPlayerID); if ((Object)(object)val2 == (Object)null) { return; } foreach (Player player in PlayerManager.instance.players) { if (player.playerID != val2.playerID && player.teamID != val2.teamID) { int num = CountCards(player, debuffCardName); int num2 = auraCount - num; for (int i = 0; i < num2; i++) { Cards.instance.AddCardToPlayer(player, val, false, "", 0f, 0f, true); CardBarUtils.instance.ShowAtEndOfPhase(player, val); } } } } public static int CountCards(Player player, string cardName) { string cardName2 = cardName; if ((Object)(object)player == (Object)null || (Object)(object)player.data == (Object)null || player.data.currentCards == null) { return 0; } return player.data.currentCards.Count((CardInfo c) => MatchesCardName(c, cardName2)); } } public static class AuraMasterHelper { public static int CountAuraCards(Player player) { if ((Object)(object)player == (Object)null || (Object)(object)player.data == (Object)null || player.data.currentCards == null) { return 0; } return player.data.currentCards.Count((CardInfo card) => (Object)(object)card != (Object)null && card.categories != null && card.categories.Contains(MrFuntikMod.AuraCards)); } public static void CheckUnlockAuraMaster(Player player) { if (!((Object)(object)player == (Object)null)) { List blacklistedCategories = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; int num = CountAuraCards(player) + 1; if (num >= 2 && blacklistedCategories.Contains(MrFuntikMod.AuraMasterCategory)) { blacklistedCategories.Remove(MrFuntikMod.AuraMasterCategory); } } } public static void CheckLockAuraMaster(Player player) { if (!((Object)(object)player == (Object)null)) { List blacklistedCategories = CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories; int num = CountAuraCards(player) - 1; if (num < 2 && !blacklistedCategories.Contains(MrFuntikMod.AuraMasterCategory)) { blacklistedCategories.Add(MrFuntikMod.AuraMasterCategory); } } } } public static class OneCutManager { public static bool IsActive = false; public static int CurrentPage = 0; public static Player CurrentPlayer = null; public static List RemovableCards = null; private static int CardsShownBefore = 0; private static CardInfo[] OriginalCards = null; private static int TotalSlots = 5; public static CardInfo NextPageCard = null; private static CardInfo _surpriseGiftCard = null; public static CardInfo SurpriseGiftCard { get { if ((Object)(object)_surpriseGiftCard == (Object)null) { _surpriseGiftCard = FindSurpriseGiftCard(); } return _surpriseGiftCard; } set { _surpriseGiftCard = value; } } private static int GetTotalSlots() { if (OriginalCards != null && OriginalCards.Length != 0) { return OriginalCards.Length; } if ((Object)(object)CardChoice.instance != (Object)null) { int childCount = ((Component)CardChoice.instance).transform.childCount; if (childCount > 0) { return childCount; } if (CardChoice.instance.cards != null && CardChoice.instance.cards.Length != 0) { return CardChoice.instance.cards.Length; } } return 5; } private static CardInfo FindSurpriseGiftCard() { if (CardManager.cards == null) { MrFuntikMod.LogWarning("[OneCut] CardManager.cards is null!"); return null; } foreach (KeyValuePair card in CardManager.cards) { if (!((Object)(object)card.Value?.cardInfo == (Object)null)) { string text = card.Value.cardInfo.cardName ?? ""; string text2 = card.Key ?? ""; if (text == "Surprise Gift" || text.Contains("Surprise Gift") || text2.Contains("SurpriseGift") || text2.Contains("Surprise Gift")) { MrFuntikMod.Log("[OneCut] Found SurpriseGiftCard: cardName='" + text + "', objectName='" + text2 + "'"); return card.Value.cardInfo; } } } MrFuntikMod.LogWarning("[OneCut] SurpriseGiftCard not found! Available cards:"); int num = 0; foreach (KeyValuePair card2 in CardManager.cards) { if ((Object)(object)card2.Value?.cardInfo != (Object)null && num < 20) { MrFuntikMod.Log(" - Key: '" + card2.Key + "', CardName: '" + card2.Value.cardInfo.cardName + "'"); num++; } } return null; } public static List GetRemovableCards(Player player) { if ((Object)(object)player == (Object)null || (Object)(object)player.data == (Object)null || player.data.currentCards == null) { MrFuntikMod.Log("[OneCut] GetRemovableCards: player or data is null"); return new List(); } List list = new List(); MrFuntikMod.Log($"[OneCut] GetRemovableCards: checking {player.data.currentCards.Count} cards"); for (int i = 0; i < player.data.currentCards.Count; i++) { CardInfo val = player.data.currentCards[i]; if ((Object)(object)val == (Object)null) { MrFuntikMod.Log($"[OneCut] [{i}] NULL"); continue; } string text = val.cardName ?? ""; if (text == "One Cut" || text == "One Cut Next") { MrFuntikMod.Log($"[OneCut] [{i}] SKIP OneCut: {text}"); continue; } if (text == "Surprise Gift" || text.Contains("Surprise Gift")) { MrFuntikMod.Log($"[OneCut] [{i}] SKIP SurpriseGift: {text}"); continue; } MrFuntikMod.Log($"[OneCut] [{i}] ADD: {text}"); list.Add(val); } MrFuntikMod.Log($"[OneCut] GetRemovableCards: found {list.Count} removable cards"); return list; } public static bool IsNextPageCard(CardInfo card) { if ((Object)(object)card == (Object)null) { return false; } string text = card.cardName ?? ""; return text == "One Cut Next"; } public static bool IsSurpriseGiftCard(CardInfo card) { if ((Object)(object)card == (Object)null) { return false; } string text = card.cardName ?? ""; return text == "Surprise Gift" || text.Contains("Surprise Gift"); } public static void StartSelection(Player player) { CurrentPlayer = player; CurrentPage = 0; CardsShownBefore = 0; RemovableCards = GetRemovableCards(player); IsActive = true; OriginalCards = CardChoice.instance.cards; UpdateCardChoiceCards(); MrFuntikMod.Log(string.Format("[OneCut] Started selection. Total removable: {0}, SurpriseGift: {1}", RemovableCards.Count, ((Object)(object)SurpriseGiftCard != (Object)null) ? SurpriseGiftCard.cardName : "NULL")); } public static void UpdateCardChoiceCards() { List list = new List(); int totalSlots = GetTotalSlots(); int num = RemovableCards?.Count ?? 0; int num2 = num - CardsShownBefore; int num3 = totalSlots - 1; bool flag = num2 > num3; int num4 = (flag ? (num3 - 1) : num3); int num5 = Mathf.Min(num2, num4); MrFuntikMod.Log($"[OneCut] Page {CurrentPage}: totalSlots={totalSlots}, cardsShownBefore={CardsShownBefore}, cardsLeft={num2}, needNextPage={flag}, cardsToShow={num5}"); for (int i = 0; i < num5; i++) { int num6 = CardsShownBefore + i; if (num6 < num) { CardInfo val = RemovableCards[num6]; CardInfo val2 = val.sourceCard ?? val; list.Add(val2); MrFuntikMod.Log($"[OneCut] Slot {i}: [{num6}] {val2.cardName}"); } } if (flag) { if ((Object)(object)NextPageCard != (Object)null) { list.Add(NextPageCard); MrFuntikMod.Log($"[OneCut] Slot {list.Count - 1}: NextPage"); } else { MrFuntikMod.LogWarning("[OneCut] NextPageCard is NULL!"); } } CardInfo surpriseGiftCard = SurpriseGiftCard; if ((Object)(object)surpriseGiftCard != (Object)null) { list.Add(surpriseGiftCard); MrFuntikMod.Log($"[OneCut] Slot {list.Count - 1}: SurpriseGift ({surpriseGiftCard.cardName})"); } else { MrFuntikMod.LogError("[OneCut] SurpriseGiftCard is NULL! Cannot add to selection."); } CardChoice.instance.cards = list.ToArray(); MrFuntikMod.Log($"[OneCut] CardChoice.cards updated: {list.Count} cards total (max slots: {totalSlots})"); } public static void EndSelection() { if (OriginalCards != null) { CardChoice.instance.cards = OriginalCards; OriginalCards = null; } IsActive = false; CurrentPage = 0; CardsShownBefore = 0; CurrentPlayer = null; RemovableCards = null; MrFuntikMod.Log("[OneCut] Selection ended"); } public static void ForceEndSelection() { OriginalCards = null; IsActive = false; CurrentPage = 0; CardsShownBefore = 0; CurrentPlayer = null; RemovableCards = null; MrFuntikMod.Log("[OneCut] Selection force ended"); } public static void GoToNextPage(Player player) { int totalSlots = GetTotalSlots(); int num = totalSlots - 1; int num2 = RemovableCards?.Count ?? 0; int num3 = num2 - CardsShownBefore; int num4 = ((num3 > num) ? (num - 1) : Mathf.Min(num3, num)); CardsShownBefore += num4; CurrentPage++; player.data.stats.GetAdditionalData().oneCutPending++; MrFuntikMod.Log($"[OneCut] GoToNextPage: now page {CurrentPage}, cardsShownBefore={CardsShownBefore}, totalSlots={totalSlots}"); } public static void HandleCardSelection(CardInfo selectedCard, int playerID) { if (RemovableCards == null || RemovableCards.Count == 0 || (Object)(object)selectedCard == (Object)null) { MrFuntikMod.LogWarning("[OneCut] HandleCardSelection: invalid state"); return; } string cardName = selectedCard.cardName; MrFuntikMod.Log("[OneCut] HandleCardSelection: selected '" + cardName + "'"); int totalSlots = GetTotalSlots(); int num = totalSlots - 1; int count = RemovableCards.Count; int num2 = count - CardsShownBefore; int num3 = ((num2 > num) ? (num - 1) : Mathf.Min(num2, num)); int cardsShownBefore = CardsShownBefore; int num4 = CardsShownBefore + num3; int num5 = -1; for (int i = cardsShownBefore; i < num4 && i < count; i++) { CardInfo val = RemovableCards[i]; CardInfo val2 = val.sourceCard ?? val; if (val.cardName == cardName || val2.cardName == cardName) { num5 = i; MrFuntikMod.Log($"[OneCut] Found card at removable index {i}: {val.cardName}"); break; } } if (num5 < 0) { MrFuntikMod.LogWarning($"[OneCut] Could not find '{cardName}' on current page (range {cardsShownBefore}-{num4})"); return; } Player val3 = PlayerManager.instance.players.Find((Player p) => p.playerID == playerID); if ((Object)(object)val3 == (Object)null) { MrFuntikMod.LogWarning($"[OneCut] Player {playerID} not found"); return; } CardInfo val4 = RemovableCards[num5]; int num6 = -1; for (int j = 0; j < val3.data.currentCards.Count; j++) { if ((Object)(object)val3.data.currentCards[j] == (Object)(object)val4) { num6 = j; break; } } if (num6 < 0) { for (int k = 0; k < val3.data.currentCards.Count; k++) { if (val3.data.currentCards[k].cardName == val4.cardName) { num6 = k; break; } } } if (num6 >= 0) { MrFuntikMod.Log($"[OneCut] Removing card at index {num6}: {val4.cardName}"); if (PhotonNetwork.OfflineMode) { RPCA_RemoveCardAndGiveSurprise(playerID, num6); return; } NetworkingManager.RPC(typeof(OneCutManager), "RPCA_RemoveCardAndGiveSurprise", new object[2] { playerID, num6 }); } else { MrFuntikMod.LogWarning("[OneCut] Could not find '" + val4.cardName + "' in currentCards"); } } public static void HandleSurpriseGiftSelection(int playerID) { MrFuntikMod.Log($"[OneCut] SurpriseGift selected by player {playerID}"); if (PhotonNetwork.OfflineMode) { RPCA_GiveSurpriseGift(playerID); return; } NetworkingManager.RPC(typeof(OneCutManager), "RPCA_GiveSurpriseGift", new object[1] { playerID }); } [UnboundRPC] public static void RPCA_RemoveCardAndGiveSurprise(int playerID, int cardIndex) { Player val = PlayerManager.instance.players.Find((Player p) => p.playerID == playerID); if ((Object)(object)val == (Object)null) { MrFuntikMod.LogWarning($"[OneCut] Player not found: {playerID}"); return; } if (cardIndex < 0 || cardIndex >= val.data.currentCards.Count) { MrFuntikMod.LogWarning($"[OneCut] Invalid card index: {cardIndex}"); return; } string cardName = val.data.currentCards[cardIndex].cardName; MrFuntikMod.Log($"[OneCut] RPCA: Removing '{cardName}' at index {cardIndex}"); Cards.instance.RemoveCardFromPlayer(val, cardIndex, true); CardInfo surpriseGiftCard = SurpriseGiftCard; if ((Object)(object)surpriseGiftCard != (Object)null) { Cards.instance.AddCardToPlayer(val, surpriseGiftCard, false, "", 0f, 0f, true); CardBarUtils.instance.ShowAtEndOfPhase(val, surpriseGiftCard); MrFuntikMod.Log($"[OneCut] Gave SurpriseGift to player {playerID}"); } else { MrFuntikMod.LogError("[OneCut] Cannot give SurpriseGift - not found!"); } } [UnboundRPC] public static void RPCA_GiveSurpriseGift(int playerID) { Player val = PlayerManager.instance.players.Find((Player p) => p.playerID == playerID); if ((Object)(object)val == (Object)null) { MrFuntikMod.LogWarning($"[OneCut] Player not found: {playerID}"); return; } CardInfo surpriseGiftCard = SurpriseGiftCard; if ((Object)(object)surpriseGiftCard != (Object)null) { Cards.instance.AddCardToPlayer(val, surpriseGiftCard, false, "", 0f, 0f, true); CardBarUtils.instance.ShowAtEndOfPhase(val, surpriseGiftCard); MrFuntikMod.Log($"[OneCut] Gave SurpriseGift to player {playerID} (no removal)"); } else { MrFuntikMod.LogError("[OneCut] Cannot give SurpriseGift - not found!"); } } public static void Reset() { IsActive = false; CurrentPage = 0; CardsShownBefore = 0; CurrentPlayer = null; RemovableCards = null; OriginalCards = null; } } }