Decompiled source of Arcana v1.9.6
plugins/Arcana.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using BepInEx; using BepInEx.Configuration; using CardChoiceSpawnUniqueCardPatch.CustomCategories; using EventDispatcher; using HarmonyLib; using ItemShops.Extensions; using ItemShops.Utils; using Jotunn.Utils; using ModdingUtils.AIMinion.Extensions; using ModdingUtils.MonoBehaviours; using ModdingUtils.Utils; using ModsPlus; using Photon.Pun; using PlayerTimeScale; using RarityLib.Utils; using Sirenix.OdinInspector; using Sonigon; using SoundImplementation; using TMPro; using UnboundLib; using UnboundLib.Cards; using UnboundLib.GameModes; using UnboundLib.Networking; using UnboundLib.Utils.UI; using UnityEngine; using UnityEngine.Audio; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyVersion("0.0.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.willis.rounds.arcana", "Arcana", "1.9.6")] [BepInProcess("Rounds.exe")] public class ArcanaCardsPlugin : BaseUnityPlugin { private const string ModId = "com.willis.rounds.arcana"; private const string ModName = "Arcana"; private const string ModVersion = "1.9.5"; private const string CompatabilityModName = "Arcana"; internal static LayerMask playerMask; internal static LayerMask projectileMask; internal static LayerMask floorMask; internal static ConfigEntry<bool> reducedParticles; internal static Shop wheelOfFortuneShop; private void Awake() { //IL_008f: 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_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_00d1: 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) AutowiredCard.RegisterAll(Assets.Bundle); CardRegistry.RegisterCard<HealthOne>(hidden: true); CardRegistry.RegisterCard<DamageOne>(hidden: true); CardRegistry.RegisterCard<HealthTwo>(hidden: true); CardRegistry.RegisterCard<DamageTwo>(hidden: true); CardRegistry.RegisterCard<ReloadOne>(hidden: true); CardRegistry.RegisterCard<ReloadTwo>(hidden: true); CardRegistry.RegisterCard<BlockOne>(hidden: true); CardRegistry.RegisterCard<BlockTwo>(hidden: true); CardRegistry.RegisterCard<AmmoOne>(hidden: true); CardRegistry.RegisterCard<AmmoTwo>(hidden: true); GameModeManager.AddHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => TempExtraPicks.HandleExtraPicks())); playerMask = LayerMask.op_Implicit(LayerMask.GetMask(new string[1] { "Player" })); projectileMask = LayerMask.op_Implicit(LayerMask.GetMask(new string[1] { "Projectile" })); floorMask = LayerMask.op_Implicit(LayerMask.GetMask(new string[2] { "Default", "IgnorePlayer" })); } private void Start() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("com.willis.rounds.arcana"); val.PatchAll(); reducedParticles = ((BaseUnityPlugin)this).Config.Bind<bool>("Arcana", "Arcana_ReducedParticles", false, "Enable reduced particle mode for faster performance"); Unbound.RegisterMenu("Arcana", (UnityAction)null, (Action<GameObject>)SetupMenu, (GameObject)null, true); Unbound.AddAllCardsCallback((Action<CardInfo[]>)ApplyBlacklists); ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)Unbound.Instance, 3f, (Action)DelayedSetup); } private void ApplyBlacklists(CardInfo[] cards) { CardInfo justiceCard = AutowiredCard.cards["justice"]; CharacterStatModifiers component2; foreach (CardInfo item in cards.Where((CardInfo c) => (Object)(object)c != (Object)(object)justiceCard && (component2 = ((Component)c).GetComponent<CharacterStatModifiers>()) != null && component2.secondsToTakeDamageOver > 0f)) { CustomCardCategories.instance.MakeCardsExclusive(justiceCard, item); } CardInfo deathCard = AutowiredCard.cards["death"]; CharacterStatModifiers component; foreach (CardInfo item2 in cards.Where((CardInfo c) => (Object)(object)c != (Object)(object)deathCard && (component = ((Component)c).GetComponent<CharacterStatModifiers>()) != null && component.respawns > 0)) { CustomCardCategories.instance.MakeCardsExclusive(deathCard, item2); } } private void DelayedSetup() { wheelOfFortuneShop = Assets.WheelOfFortuneShop.GetValue(); Shop obj = wheelOfFortuneShop; obj.itemPurchasedAction = (Action<Player, ShopItem>)Delegate.Combine(obj.itemPurchasedAction, (Action<Player, ShopItem>)delegate(Player p, ShopItem i) { NetworkingManager.RPC(typeof(FortuneHandler), "OnItemPurchased", new object[1] { p.playerID }); }); Debug.Log((object)"[Arcana] Created Wheel of Fortune Shop"); } private void SetupMenu(GameObject menu) { MenuHandler.CreateToggle(reducedParticles.Value, "Reduced Particle Mode", menu, (UnityAction<bool>)delegate(bool val) { reducedParticles.Value = val; }, 30, false, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null); } } public class Assets { internal static AssetBundle Bundle = AssetUtils.LoadAssetBundleFromResources("arcana", typeof(ArcanaCardsPlugin).Assembly); internal static ShopObject WheelOfFortuneShop = Bundle.LoadAsset<ShopObject>("Wheel Of Fortune Shop"); internal static GameObject FoolBlackout = Bundle.LoadAsset<GameObject>("Fool Blackout"); } public class BindingChain : MonoBehaviour { private class AnchorPoint { private Vector2 offset; private Transform target; public AnchorPoint(Vector2 position, Transform target) { //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) //IL_001c: 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_0023: 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_002d: Unknown result type (might be due to invalid IL or missing references) this.target = target; if ((Object)(object)target != (Object)null) { offset = position - Vector2.op_Implicit(target.position); } else { offset = position; } } public Vector2 GetPosition() { //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_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) //IL_0035: 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_0038: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target == (Object)null) { return offset; } return Vector2.op_Implicit(target.position) + offset; } } [SerializeField] private LineRenderer lineRenderer; [SerializeField] private ParticleSystem particles; [SerializeField] private Transform rightSpear; [SerializeField] private Transform leftSpear; [SerializeField] private float lifeTime; private AnchorPoint rightAnchor; private AnchorPoint leftAnchor; private Vector2 rVel; private Vector2 lVel; private float distancePerSecond = 100f; private float baseEmissionRate = 0f; private float lifeTimeCounter = 0f; private void Start() { //IL_0009: 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_003b: 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_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_0069: 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_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) rightAnchor = GetAnchorPointFrom(((Component)this).transform.right); leftAnchor = GetAnchorPointFrom(-((Component)this).transform.right); EmissionModule emission = particles.emission; MinMaxCurve rateOverTime = ((EmissionModule)(ref emission)).rateOverTime; baseEmissionRate = ((MinMaxCurve)(ref rateOverTime)).constant; lineRenderer.SetPositions((Vector3[])(object)new Vector3[2] { ((Component)this).transform.position, ((Component)this).transform.position }); } private void Update() { //IL_0040: 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_0045: 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_004f: 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_0066: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_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_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_00c8: 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_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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_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_010b: 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_0133: 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_0147: 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_015f: 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_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_018f: 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_0193: 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_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: 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_01b9: 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) //IL_01c0: 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_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: 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_01fb: 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_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) lifeTimeCounter += TimeHandler.deltaTime; bool flag = lifeTimeCounter >= lifeTime; Vector2 val = (flag ? leftAnchor.GetPosition() : Vector2.op_Implicit(((Component)this).transform.position)); Vector2 val2 = (flag ? rightAnchor.GetPosition() : Vector2.op_Implicit(((Component)this).transform.position)); Vector2 val3 = (flag ? Vector2.op_Implicit(((Component)this).transform.position) : leftAnchor.GetPosition()); Vector2 val4 = (flag ? Vector2.op_Implicit(((Component)this).transform.position) : rightAnchor.GetPosition()); Vector2 val5 = Vector2.SmoothDamp(Vector2.op_Implicit(lineRenderer.GetPosition(0)), val3, ref lVel, Vector3.Distance(Vector2.op_Implicit(val3), Vector2.op_Implicit(val)) / (distancePerSecond * (float)((!flag) ? 1 : 2))); Vector2 val6 = Vector2.SmoothDamp(Vector2.op_Implicit(lineRenderer.GetPosition(1)), val4, ref rVel, Vector3.Distance(Vector2.op_Implicit(val4), Vector2.op_Implicit(val2)) / (distancePerSecond * (float)((!flag) ? 1 : 2))); lineRenderer.SetPosition(0, Vector2.op_Implicit(val5)); lineRenderer.SetPosition(1, Vector2.op_Implicit(val6)); ((Component)leftSpear).transform.position = Vector2.op_Implicit(val5); ((Component)rightSpear).transform.position = Vector2.op_Implicit(val6); Transform transform = ((Component)leftSpear).transform; Vector2 val7 = val5 - val6; transform.right = Vector2.op_Implicit(((Vector2)(ref val7)).normalized); Transform transform2 = ((Component)rightSpear).transform; val7 = val6 - val5; transform2.right = Vector2.op_Implicit(((Vector2)(ref val7)).normalized); EmissionModule emission = particles.emission; MinMaxCurve rateOverTime = ((EmissionModule)(ref emission)).rateOverTime; ((MinMaxCurve)(ref rateOverTime)).constant = baseEmissionRate * Vector3.Distance(Vector2.op_Implicit(val5), Vector2.op_Implicit(val6)); ((EmissionModule)(ref emission)).rateOverTime = rateOverTime; if (flag && Vector3.Distance(Vector2.op_Implicit(val5), Vector2.op_Implicit(val6)) <= 10f) { RemoveAfterSeconds orAddComponent = ExtensionMethods.GetOrAddComponent<RemoveAfterSeconds>(((Component)this).gameObject, false); orAddComponent.shrink = true; orAddComponent.seconds = 0f; } } private AnchorPoint GetAnchorPointFrom(Vector3 direction) { //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_0012: 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_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_0070: 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_004b: 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_005f: Unknown result type (might be due to invalid IL or missing references) RaycastHit2D val = Physics2D.Raycast(Vector2.op_Implicit(((Component)this).transform.position), Vector2.op_Implicit(direction), 50f, LayerMask.op_Implicit(ArcanaCardsPlugin.floorMask)); if ((Object)(object)((RaycastHit2D)(ref val)).collider == (Object)null) { return new AnchorPoint(Vector2.op_Implicit(((Component)this).transform.position + ((Vector3)(ref direction)).normalized * 50f), null); } return new AnchorPoint(((RaycastHit2D)(ref val)).point, ((RaycastHit2D)(ref val)).transform); } } public static class CardRegistry { private static Dictionary<Type, CardInfo> storedCardInfo = new Dictionary<Type, CardInfo>(); public static void RegisterCard<T>(bool hidden = false) where T : CustomCard { CustomCard.BuildCard<T>((Action<CardInfo>)delegate(CardInfo c) { StoreCard<T>(c); if (hidden) { Cards.instance.AddHiddenCard(c); } }); } private static void StoreCard<T>(CardInfo card) where T : CustomCard { storedCardInfo.Add(typeof(T), card); } public static CardInfo GetCard<T>() where T : CustomCard { if (storedCardInfo.TryGetValue(typeof(T), out var value)) { return value; } return null; } public static CardInfo GetCard(Type T) { if (storedCardInfo.TryGetValue(T, out var value)) { return value; } return null; } } public class DeathHandler : PlayerHook { public Color reviveBarColor; [Header("Player colors on revive")] public Color[] colors; private bool active = true; private int reviveCount = 0; private List<StatChangeTracker> buffs = new List<StatChangeTracker>(); private ReversibleColorEffect colorEffect = null; private Coroutine buffCoroutine = null; private CustomHealthBar reviveBar; private StatChanges buffToApply = new StatChanges { Jumps = 1, MaxAmmo = 2, AttackSpeed = 0.8f, MovementSpeed = 1.1f, JumpHeight = 1.25f, BulletSpeed = 1.25f, MaxHealth = 2f, Damage = 2f }; protected override void Start() { //IL_0051: 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) ((CardEffect)this).Start(); RevivePatch.RegisterReviveAction(((CardEffect)this).player, ApplyBuff); RevivePatch.RegisterTrueDeathAction(((CardEffect)this).player, OnTrueDeath); reviveBar = new GameObject("Revives Bar", new Type[1] { typeof(CustomHealthBar) }).GetComponent<CustomHealthBar>(); ExtensionMethods.AddStatusIndicator(((CardEffect)this).player, ((Component)reviveBar).gameObject, 0f, true); reviveBar.SetColor(reviveBarColor); reviveBar.SetValues((float)((CardEffect)this).player.data.stats.respawns, (float)((CardEffect)this).player.data.stats.remainingRespawns); } private void OnTrueDeath() { reviveBar.CurrentHealth = reviveBar.MaxHealth; reviveCount = 0; ClearBuffs(); } private void ApplyBuff() { reviveBar.CurrentHealth = ((CardEffect)this).player.data.stats.remainingRespawns - 1; reviveCount++; buffCoroutine = ((MonoBehaviour)Unbound.Instance).StartCoroutine(ApplyBuffCoroutine(reviveCount)); } private IEnumerator ApplyBuffCoroutine(int count) { yield return (object)new WaitUntil((Func<bool>)(() => ((Component)((CardEffect)this).player).gameObject.activeInHierarchy)); _ = buffs.Count; ClearBuffs(); yield return null; colorEffect = ((Component)((CardEffect)this).player).gameObject.AddComponent<ReversibleColorEffect>(); Color color = ((count - 1 < colors.Length) ? colors[count - 1] : colors[colors.Length - 1]); ((ColorEffect)colorEffect).SetColor(color); for (int i = 0; i < count; i++) { StatChangeTracker appliedBuff = StatManager.Apply(((CardEffect)this).player, buffToApply); buffs.Add(appliedBuff); } } public override IEnumerator OnBattleStart(IGameModeHandler gameModeHandler) { reviveBar.SetValues((float)((CardEffect)this).player.data.stats.respawns, (float)((CardEffect)this).player.data.stats.remainingRespawns); ClearBuffs(); active = true; reviveCount = 0; yield break; } public override IEnumerator OnPointEnd(IGameModeHandler gameModeHandler) { active = false; ClearBuffs(); reviveCount = 0; yield break; } private void ClearBuffs() { ClearColor(); foreach (StatChangeTracker item in buffs.Where((StatChangeTracker b) => b != null)) { StatManager.Remove(item); } buffs.Clear(); } private void ClearColor() { if ((Object)(object)colorEffect != (Object)null) { Object.Destroy((Object)(object)colorEffect); colorEffect = null; } } protected override void OnDestroy() { RevivePatch.DeregisterReviveAction(((CardEffect)this).player, ApplyBuff); RevivePatch.DeregisterTrueDeathAction(((CardEffect)this).player, OnTrueDeath); ClearBuffs(); Object.Destroy((Object)(object)((Component)reviveBar).gameObject); ((CardEffect)this).OnDestroy(); } } [HarmonyPatch(typeof(HealthHandler))] public class RevivePatch { private static Dictionary<Player, Action> registeredReviveActions = new Dictionary<Player, Action>(); private static Dictionary<Player, Action> registeredTrueDeathActions = new Dictionary<Player, Action>(); [HarmonyPatch("RPCA_Die_Phoenix")] [HarmonyPrefix] public static void PhoenixRevive_Postfix(Player ___player, bool ___isRespawning, Vector2 deathDirection) { if (!___isRespawning && !___player.data.dead && registeredReviveActions.TryGetValue(___player, out var value)) { value?.Invoke(); } } [HarmonyPatch("RPCA_Die")] [HarmonyPrefix] public static void TrueDeath_Postfix(Player ___player, bool ___isRespawning, Vector2 deathDirection) { if (!___isRespawning && !___player.data.dead && registeredTrueDeathActions.TryGetValue(___player, out var value)) { value?.Invoke(); } } public static void RegisterReviveAction(Player player, Action onRevive) { if (registeredReviveActions.TryGetValue(player, out var value)) { value = (Action)Delegate.Combine(value, onRevive); } else { registeredReviveActions.Add(player, onRevive); } } public static void DeregisterReviveAction(Player player, Action onRevive) { if (registeredReviveActions.TryGetValue(player, out var value)) { value = (Action)Delegate.Remove(value, onRevive); } } public static void RegisterTrueDeathAction(Player player, Action onTrueDeath) { if (registeredTrueDeathActions.TryGetValue(player, out var value)) { value = (Action)Delegate.Combine(value, onTrueDeath); } else { registeredTrueDeathActions.Add(player, onTrueDeath); } } public static void DeregisterTrueDeathAction(Player player, Action onTrueDeath) { if (registeredTrueDeathActions.TryGetValue(player, out var value)) { value = (Action)Delegate.Remove(value, onTrueDeath); } } } public class FoolHandler : PlayerHook { internal static Dictionary<Player, FoolHandler> fooledPlayers = new Dictionary<Player, FoolHandler>(); [SerializeField] private float rarityScalar; private Dictionary<Rarity, float> changes = new Dictionary<Rarity, float>(); protected override void Start() { ((CardEffect)this).Start(); fooledPlayers[((CardEffect)this).player] = this; if (!((CardEffect)this).player.data.view.IsMine) { return; } Rarity rareData = RarityUtils.GetRarityData((Rarity)2); foreach (Rarity item in RarityUtils.Rarities.Values.Where((Rarity r) => r.relativeRarity <= rareData.relativeRarity)) { UpdateRarity(item, rarityScalar); } } private void UpdateRarity(Rarity rarity, float multiplier) { float num = rarity.calculatedRarity * multiplier - rarity.calculatedRarity; rarity.calculatedRarity += num; changes.Add(rarity, num); } protected override void OnDestroy() { ((CardEffect)this).OnDestroy(); if (!((CardEffect)this).player.data.view.IsMine) { return; } fooledPlayers.Remove(((CardEffect)this).player); foreach (Rarity key in changes.Keys) { key.calculatedRarity -= changes[key]; } } } public class FortuneHandler : PlayerHook { internal class FinishedPickingEvent : Event<FinishedPickingEvent> { public Player target; public FinishedPickingEvent(Player target) { this.target = target; } } private bool isShopping = false; private static HashSet<Player> trackedPlayers = new HashSet<Player>(); protected override void Awake() { ((PlayerHook)this).Awake(); Event<FinishedPickingEvent>.RegisterListener(DonePicking); } public override IEnumerator OnPickPhaseStart(IGameModeHandler gameModeHandler) { isShopping = false; trackedPlayers.Clear(); yield break; } public override IEnumerator OnPickPhaseEnd(IGameModeHandler gameModeHandler) { foreach (Player player in PlayerManager.instance.players) { FortuneHandler handler = ((Component)player).GetComponentInChildren<FortuneHandler>(); if ((Object)(object)handler == (Object)null || trackedPlayers.Contains(player) || gameModeHandler.GetRoundWinners().Contains(player.playerID)) { continue; } trackedPlayers.Add(player); yield return (object)new WaitForSeconds(0.5f); FortunesWheel wheel = Object.Instantiate<FortunesWheel>(Assets.Bundle.LoadAsset<GameObject>("Fortune's Wheel").GetComponent<FortunesWheel>(), ((Component)Unbound.Instance.canvas).transform); yield return null; wheel.Initialize(player); yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)wheel == (Object)null)); yield return (object)new WaitForSeconds(0.5f); if (PlayerExtension.GetAdditionalData(player).bankAccount.Money.TryGetValue("Fortune", out var balance) && balance > 0) { handler.isShopping = true; ArcanaCardsPlugin.wheelOfFortuneShop.Show(player); if (!player.data.view.IsMine) { Object.Instantiate<GameObject>(Assets.Bundle.LoadAsset<GameObject>("Fortune's Countdown"), ((Component)Unbound.Instance.canvas).transform); } yield return (object)new WaitForSeconds(0.25f); float startTime = Time.time; yield return (object)new WaitUntil((Func<bool>)(() => !handler.isShopping || (player.data.view.IsMine && !ArcanaCardsPlugin.wheelOfFortuneShop.IsOpen) || Time.time - startTime >= (float)FortunesCountdown.duration)); NetworkingManager.RPC(typeof(FortuneHandler), "OnItemPurchased", new object[1] { player.playerID }); ArcanaCardsPlugin.wheelOfFortuneShop.Hide(); yield return (object)new WaitForSeconds(0.5f); } } } protected override void OnDestroy() { ((CardEffect)this).OnDestroy(); Event<FinishedPickingEvent>.UnregisterListener(DonePicking); } [UnboundRPC] internal static void OnItemPurchased(int playerId) { Player playerWithID = ExtensionMethods.GetPlayerWithID(PlayerManager.instance, playerId); new FinishedPickingEvent(playerWithID).FireEvent(); } private void DonePicking(FinishedPickingEvent e) { Player componentInParent = ((Component)this).GetComponentInParent<Player>(); if (!((Object)(object)componentInParent == (Object)null) && !((Object)(object)componentInParent != (Object)(object)e.target)) { isShopping = false; ArcanaCardsPlugin.wheelOfFortuneShop.Hide(); } } } public class HangedManHandler : PlayerHook { [SerializeField] private PlayerTimeScale slowEffect; [SerializeField] private GameObject applySlowEffect; [SerializeField] private float duration; [SerializeField] private float timeScale; [SerializeField] private UnityEvent onStart; [SerializeField] private UnityEvent onEnd; private bool spent = false; private List<PlayerTimeScale> appliedDebuffs = new List<PlayerTimeScale>(); protected override void Awake() { //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) ((PlayerHook)this).Awake(); ((Component)this).GetComponent<ParticleSystemColor>().color = ((CardEffect)this).player.GetTeamColors().winText; } protected override void Start() { ((CardEffect)this).Start(); if (PhotonNetwork.OfflineMode) { ((MonoBehaviour)this).StartCoroutine(((CardEffect)this).OnBattleStart((IGameModeHandler)null)); } } private void Update() { if (!spent) { ((CardEffect)this).player.data.block.sinceBlock = 0f; } } public override IEnumerator OnBattleStart(IGameModeHandler gameModeHandler) { if (spent) { ((Behaviour)((Component)this).GetComponent<CodeAnimation>()).enabled = false; ((Component)this).transform.localScale = Vector3.zero; yield break; } spent = true; UnityEvent obj = onStart; if (obj != null) { obj.Invoke(); } yield return MoveAndHold(((CardEffect)this).player, Vector3.zero, duration); ((CardEffect)this).player.data.view.RPC("RPCA_Die", (RpcTarget)0, new object[1] { Vector2.up }); } public override IEnumerator OnPointEnd(IGameModeHandler gameModeHandler) { spent = true; ((MonoBehaviour)this).StopAllCoroutines(); yield break; } private void ApplyEffect(Player target) { //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) PlayerTimeScale val = Object.Instantiate<PlayerTimeScale>(slowEffect, ((Component)target).transform); val.Scale = timeScale; ParticleSystemColor component = ((Component)val).GetComponent<ParticleSystemColor>(); component.color = target.GetTeamColors().winText; appliedDebuffs.Add(val); } private IEnumerator MoveAndHold(Player person, Vector3 targetPos, float holdTime) { //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) PlayerVelocity playerVel = person.data.playerVel; AnimationCurve playerMoveCurve = PlayerManager.instance.playerMoveCurve; ExtensionMethods.SetFieldValue((object)playerVel, "simulated", (object)false); ExtensionMethods.SetFieldValue((object)playerVel, "isKinematic", (object)true); Vector3 distance = targetPos - ((Component)playerVel).transform.position; Vector3 targetStartPos = ((Component)playerVel).transform.position; PlayerCollision col = ((Component)playerVel).GetComponent<PlayerCollision>(); float t = ((Keyframe)(ref playerMoveCurve.keys[playerMoveCurve.keys.Length - 1])).time; float c = 0f; col.checkForGoThroughWall = false; while (c < t) { c += Mathf.Clamp(Time.unscaledDeltaTime, 0f, 0.02f); ((Component)playerVel).transform.position = targetStartPos + distance * playerMoveCurve.Evaluate(c); yield return null; } List<Player> targets = PlayerManager.instance.players.Where((Player p) => p.teamID != ((CardEffect)this).player.teamID).ToList(); if (targets.Count == 0) { yield return (object)new WaitForSeconds(holdTime); } for (int i = 0; i < targets.Count; i++) { Player target = targets[i]; GameObject applyEffect = Object.Instantiate<GameObject>(applySlowEffect, ((Component)target).transform.position, applySlowEffect.transform.rotation); applyEffect.AddComponent<FollowTransform>().target = ((Component)target).transform; Color color = target.GetTeamColors().winText; applyEffect.GetComponent<SpriteColor>().color = color; applyEffect.GetComponent<ParticleSystemColor>().color = color; yield return (object)new WaitForSeconds(holdTime / (float)targets.Count); ApplyEffect(target); } UnityEvent obj = onEnd; if (obj != null) { obj.Invoke(); } yield return (object)new WaitForSeconds(1f); ExtensionMethods.SetFieldValue((object)col, "lastPos", (object)Vector2.op_Implicit(targetPos)); yield return null; col.checkForGoThroughWall = true; yield return null; int frames = 0; while (frames < 10) { ((Component)playerVel).transform.position = targetPos; frames++; yield return null; } ExtensionMethods.SetFieldValue((object)playerVel, "simulated", (object)true); ExtensionMethods.SetFieldValue((object)playerVel, "isKinematic", (object)false); if (PhotonNetwork.OfflineMode) { spent = true; } } protected override void OnDestroy() { ((CardEffect)this).OnDestroy(); foreach (PlayerTimeScale appliedDebuff in appliedDebuffs) { Object.Destroy((Object)(object)((Component)appliedDebuff).gameObject); } appliedDebuffs.Clear(); } } public class HermitHandler : PlayerHook { public override IEnumerator OnBattleStart(IGameModeHandler gameModeHandler) { TealAura effect = ((Component)((CardEffect)this).player).gameObject.GetComponentInChildren<TealAura>(); ((MonoBehaviour)effect).StopAllCoroutines(); effect.ClearBuffs(); ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)Unbound.Instance, 1, (Action)delegate { ((MonoBehaviour)effect).StartCoroutine(effect.AuraEffect()); }); yield break; } public override IEnumerator OnPointEnd(IGameModeHandler gameModeHandler) { TealAura effect = ((Component)((CardEffect)this).player).gameObject.GetComponentInChildren<TealAura>(); ((MonoBehaviour)effect).StopAllCoroutines(); effect.ClearBuffs(); yield break; } } public class HierophantHandler : PlayerHook { [SerializeField] private Color cooldownIndicatorColor; [SerializeField] private float baseCooldown; private float cooldownCounter; [SerializeField] private GameObject visualsToSpawn; private CustomHealthBar cooldownIndicator; private float cooldown { get { float num = (float)ExtensionMethods.GetPropertyValue((object)((CardEffect)this).player.data.weaponHandler.gun, "usedCooldown") / 0.3f; return baseCooldown * Mathf.Clamp(num, 0.6f, 1.4f); } } protected override void Start() { //IL_0021: 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) ((CardEffect)this).Start(); cooldownIndicator = new GameObject("Hierophant Cooldown", new Type[1] { typeof(CustomHealthBar) }).GetComponent<CustomHealthBar>(); cooldownIndicator.SetColor(cooldownIndicatorColor); cooldownIndicator.SetValues(cooldown, cooldown); ExtensionMethods.AddStatusIndicator(((CardEffect)this).player, ((Component)cooldownIndicator).gameObject, 0f, true); Event<HierophantHit>.RegisterListener(OnHit); } private void Update() { cooldownCounter += TimeHandler.deltaTime; cooldownIndicator.CurrentHealth = cooldownCounter; } protected override void OnDestroy() { ((CardEffect)this).OnDestroy(); Object.Destroy((Object)(object)((Component)cooldownIndicator).gameObject); Event<HierophantHit>.UnregisterListener(OnHit); } private void OnHit(HierophantHit e) { //IL_0074: 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) if (!((Object)(object)e.owner != (Object)(object)((CardEffect)this).player) && IsEffectReady()) { cooldownCounter = 0f; cooldownIndicator.SetValues(0f, cooldown); e.target.data.stunHandler.AddStun(3f); Object.Instantiate<GameObject>(visualsToSpawn, ((Component)e.target).transform.position, visualsToSpawn.transform.rotation); } } public bool IsEffectReady() { return cooldownCounter >= cooldown; } public override IEnumerator OnBattleStart(IGameModeHandler gameModeHandler) { cooldownCounter = cooldown; cooldownIndicator.SetValues(cooldown, cooldown); yield break; } } public class JusticeHandler : PlayerHook { [SerializeField] private float thornsFactor; [SerializeField] private GameObject retributionEffect; protected override void Start() { ((CardEffect)this).Start(); TakeDamagePatch.RegisterTakeDamageAction(((CardEffect)this).player, OnTakeDamage); } protected override void OnDestroy() { ((CardEffect)this).OnDestroy(); TakeDamagePatch.DeregisterTakeDamageAction(((CardEffect)this).player, OnTakeDamage); } private void OnTakeDamage(Vector2 damage, Player damagingPlayer) { //IL_0026: 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_0036: 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_007e: Unknown result type (might be due to invalid IL or missing references) if (((CardEffect)this).player.teamID != damagingPlayer.teamID) { ((Damagable)damagingPlayer.data.healthHandler).TakeDamage(GetScaledDamage(), Vector2.op_Implicit(((Component)damagingPlayer).transform.position), (GameObject)null, ((CardEffect)this).player, true, false); GameObject val = Object.Instantiate<GameObject>(retributionEffect, ((Component)damagingPlayer).transform); val.transform.localPosition = Vector3.zero; Transform transform = val.transform; transform.localScale *= 2f; } } private Vector2 GetScaledDamage() { //IL_0026: 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_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_0063: 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_0088: 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) object arg = ((CardEffect)this).player.data.maxHealth; object arg2 = thornsFactor; Vector2 val = Vector2.one * ((CardEffect)this).player.data.maxHealth * thornsFactor; Debug.Log((object)$"Max Health: {arg}\nThorns factor: {arg2}\nCalculated damage: {((Vector2)(ref val)).magnitude}\n\n"); return Vector2.one * ((CardEffect)this).player.data.maxHealth * thornsFactor; } } [HarmonyPatch(typeof(HealthHandler))] public class TakeDamagePatch { private static Dictionary<Player, Action<Vector2, Player>> registeredDamageActions; [HarmonyPatch("DoDamage")] [HarmonyPostfix] public static void PhoenixRevive_Postfix(HealthHandler __instance, Vector2 damage, Player damagingPlayer) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) Player component; if (!((Object)(object)damagingPlayer == (Object)null) && (component = ((Component)__instance).GetComponent<Player>()) != null && registeredDamageActions.ContainsKey(component)) { registeredDamageActions[component]?.Invoke(damage, damagingPlayer); } } public static void RegisterTakeDamageAction(Player player, Action<Vector2, Player> onRevive) { if (registeredDamageActions.TryGetValue(player, out var value)) { value = (Action<Vector2, Player>)Delegate.Combine(value, onRevive); } else { registeredDamageActions.Add(player, onRevive); } } public static void DeregisterTakeDamageAction(Player player, Action<Vector2, Player> onRevive) { if (registeredDamageActions.TryGetValue(player, out var value)) { value = (Action<Vector2, Player>)Delegate.Remove(value, onRevive); registeredDamageActions[player] = value; } } static TakeDamagePatch() { registeredDamageActions = new Dictionary<Player, Action<Vector2, Player>>(); } } public class LoversHandler : PlayerHook { private class LoversIgnore : MonoBehaviour { public List<Player> ignorePlayers = new List<Player>(); } [SerializeField] private LineEffect circleEffect; [SerializeField] private GameObject negatedEffect; [SerializeField] [Range(0f, 1f)] private float negationChance; protected override void Awake() { ((PlayerHook)this).Awake(); if ((Object)(object)circleEffect == (Object)null) { circleEffect = ((Component)this).GetComponent<LineEffect>(); } } private void Update() { //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_001d: 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) Collider2D[] array = Physics2D.OverlapCircleAll(Vector2.op_Implicit(((Component)this).transform.position), circleEffect.radius, LayerMask.op_Implicit(ArcanaCardsPlugin.projectileMask)); foreach (Collider2D val in array) { SpawnedAttack componentInParent; if (!((Component)((Component)val).transform.root).CompareTag("Bullet") || ((componentInParent = ((Component)val).GetComponentInParent<SpawnedAttack>()) != null && componentInParent.spawner.teamID == ((CardEffect)this).player.teamID)) { continue; } LoversIgnore orAddComponent = ExtensionMethods.GetOrAddComponent<LoversIgnore>(((Component)val).gameObject, false); if (orAddComponent.ignorePlayers.Contains(((CardEffect)this).player)) { continue; } orAddComponent.ignorePlayers.Add(((CardEffect)this).player); PhotonView componentInParent2 = ((Component)val).GetComponentInParent<PhotonView>(); Random random = new Random(componentInParent2.ViewID); if (!(random.NextDouble() >= (double)negationChance)) { ((Component)((Component)val).GetComponentInParent<SpawnedAttack>()).gameObject.SetActive(false); if (componentInParent2.IsMine) { PhotonNetwork.Destroy(componentInParent2); } SpawnNegatedEffect(((Component)val).transform.position); } } } private void SpawnNegatedEffect(Vector3 negatedPosition) { //IL_0007: 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) Object.Instantiate<GameObject>(negatedEffect, negatedPosition, negatedEffect.transform.rotation); } } public class TemperanceHandler : PlayerHook { public const float BUFF_PERCENTAGE = 0.5f; public const float DEBUFF_PERCENTAGE = 0.1f; private List<ReversibleEffect> appliedEffects = new List<ReversibleEffect>(); public override IEnumerator OnBattleStart(IGameModeHandler gameModeHandler) { yield return null; int myScore = -1; int bestScoreOthers = -1; foreach (int teamId in PlayerManager.instance.players.Select((Player p) => p.teamID).Distinct()) { if (teamId == ((CardEffect)this).player.teamID) { myScore = gameModeHandler.GetTeamScore(teamId).rounds; continue; } int score = gameModeHandler.GetTeamScore(teamId).rounds; bestScoreOthers = ((bestScoreOthers > score) ? bestScoreOthers : score); } if (myScore == bestScoreOthers) { ApplyEffect<AheadBuff>(); ApplyEffect<BehindBuff>(); } else if (myScore < bestScoreOthers) { ApplyEffect<BehindBuff>(Mathf.Abs(myScore - bestScoreOthers)); } else { ApplyEffect<AheadBuff>(Mathf.Abs(myScore - bestScoreOthers)); } } private void ApplyEffect<T>(int count = 1) where T : ReversibleEffect { for (int i = 0; i < count; i++) { T val = ((Component)((CardEffect)this).player).gameObject.AddComponent<T>(); appliedEffects.Add((ReversibleEffect)(object)val); } } private void ClearEffects() { foreach (ReversibleEffect appliedEffect in appliedEffects) { Object.Destroy((Object)(object)appliedEffect); } appliedEffects.Clear(); } public override IEnumerator OnPointEnd(IGameModeHandler gameModeHandler) { ClearEffects(); yield break; } protected override void OnDestroy() { ((CardEffect)this).OnDestroy(); ClearEffects(); } } internal class AheadBuff : ReversibleEffect { public override void OnStart() { ((ReversibleEffect)this).SetLivesToEffect(int.MaxValue); base.characterDataModifier.maxHealth_mult = 0.9f; base.gunStatModifier.damage_mult = 0.9f; base.blockModifier.cdMultiplier_mult = 1.1f; base.gunAmmoStatModifier.reloadTimeMultiplier_mult = 1.1f; } } internal class BehindBuff : ReversibleEffect { public override void OnStart() { ((ReversibleEffect)this).SetLivesToEffect(int.MaxValue); base.characterDataModifier.maxHealth_mult = 1.5f; base.gunStatModifier.damage_mult = 1.5f; base.blockModifier.cdMultiplier_mult = 0.5f; base.gunAmmoStatModifier.reloadTimeMultiplier_mult = 0.5f; } } public class HealthOne : SimpleCard { public override CardDetails Details { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0051: Expected O, but got Unknown //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_005f: 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_006c: 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_007d: Expected O, but got Unknown CardDetails val = new CardDetails(); val.Title = "Health - I"; val.Description = "<color=\"purple\">[ Fortune ]</color>"; val.Stats = (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, amount = "+25%", simepleAmount = (SimpleAmount)2, stat = "Health" }, new CardInfoStat { positive = false, amount = "-10%", simepleAmount = (SimpleAmount)6, stat = "Damage" } }; val.ModName = "Arcana"; return val; } } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers) { statModifiers.health = 1.25f; gun.damage = 0.9f; } public override bool GetEnabled() { return false; } } public class HealthTwo : SimpleCard { public override CardDetails Details { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0051: Expected O, but got Unknown //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_005f: 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_006c: 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_007d: Expected O, but got Unknown CardDetails val = new CardDetails(); val.Title = "Health - II"; val.Description = "<color=\"purple\">[ Fortune ]</color>"; val.Stats = (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, amount = "+50%", simepleAmount = (SimpleAmount)4, stat = "Health" }, new CardInfoStat { positive = false, amount = "-20%", simepleAmount = (SimpleAmount)6, stat = "Damage" } }; val.ModName = "Arcana"; return val; } } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers) { statModifiers.health = 1.5f; gun.damage = 0.8f; } public override bool GetEnabled() { return false; } } public class DamageOne : SimpleCard { public override CardDetails Details { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0051: Expected O, but got Unknown //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_005f: 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_006c: 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_007d: Expected O, but got Unknown CardDetails val = new CardDetails(); val.Title = "Damage - I"; val.Description = "<color=\"purple\">[ Fortune ]</color>"; val.Stats = (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, amount = "+25%", simepleAmount = (SimpleAmount)2, stat = "Damage" }, new CardInfoStat { positive = false, amount = "-10%", simepleAmount = (SimpleAmount)6, stat = "Health" } }; val.ModName = "Arcana"; return val; } } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers) { gun.damage = 1.25f; statModifiers.health = 0.9f; } public override bool GetEnabled() { return false; } } public class DamageTwo : SimpleCard { public override CardDetails Details { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0051: Expected O, but got Unknown //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_005f: 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_006c: 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_007d: Expected O, but got Unknown CardDetails val = new CardDetails(); val.Title = "Damage - II"; val.Description = "<color=\"purple\">[ Fortune ]</color>"; val.Stats = (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, amount = "+50%", simepleAmount = (SimpleAmount)4, stat = "Damage" }, new CardInfoStat { positive = false, amount = "-20%", simepleAmount = (SimpleAmount)6, stat = "Health" } }; val.ModName = "Arcana"; return val; } } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers) { gun.damage = 1.5f; statModifiers.health = 0.8f; } public override bool GetEnabled() { return false; } } public class ReloadOne : SimpleCard { public override CardDetails Details { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0051: Expected O, but got Unknown //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_005f: 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_006c: 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_007d: Expected O, but got Unknown CardDetails val = new CardDetails(); val.Title = "Reload - I"; val.Description = "<color=\"purple\">[ Fortune ]</color>"; val.Stats = (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, amount = "-25%", simepleAmount = (SimpleAmount)2, stat = "Reload Time" }, new CardInfoStat { positive = false, amount = "+10%", simepleAmount = (SimpleAmount)1, stat = "Block Cooldown" } }; val.ModName = "Arcana"; return val; } } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { gun.reloadTime = 0.75f; block.cdMultiplier = 1.1f; } public override bool GetEnabled() { return false; } } public class ReloadTwo : SimpleCard { public override CardDetails Details { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0051: Expected O, but got Unknown //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_005f: 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_006c: 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_007d: Expected O, but got Unknown CardDetails val = new CardDetails(); val.Title = "Reload - II"; val.Description = "<color=\"purple\">[ Fortune ]</color>"; val.Stats = (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, amount = "-50%", simepleAmount = (SimpleAmount)2, stat = "Reload Time" }, new CardInfoStat { positive = false, amount = "+20%", simepleAmount = (SimpleAmount)1, stat = "Block Cooldown" } }; val.ModName = "Arcana"; return val; } } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { gun.reloadTime = 0.5f; block.cdMultiplier = 1.2f; } public override bool GetEnabled() { return false; } } public class BlockOne : SimpleCard { public override CardDetails Details { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0051: Expected O, but got Unknown //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_005f: 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_006c: 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_007d: Expected O, but got Unknown CardDetails val = new CardDetails(); val.Title = "Block - I"; val.Description = "<color=\"purple\">[ Fortune ]</color>"; val.Stats = (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, amount = "-25%", simepleAmount = (SimpleAmount)2, stat = "Block Cooldown" }, new CardInfoStat { positive = false, amount = "+10%", simepleAmount = (SimpleAmount)1, stat = "Reload Time" } }; val.ModName = "Arcana"; return val; } } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { block.cdMultiplier = 0.75f; gun.reloadTime = 1.1f; } public override bool GetEnabled() { return false; } } public class BlockTwo : SimpleCard { public override CardDetails Details { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0051: Expected O, but got Unknown //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_005f: 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_006c: 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_007d: Expected O, but got Unknown CardDetails val = new CardDetails(); val.Title = "Block - II"; val.Description = "<color=\"purple\">[ Fortune ]</color>"; val.Stats = (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, amount = "-50%", simepleAmount = (SimpleAmount)2, stat = "Block Cooldown" }, new CardInfoStat { positive = false, amount = "+20%", simepleAmount = (SimpleAmount)1, stat = "Reload Time" } }; val.ModName = "Arcana"; return val; } } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { block.cdMultiplier = 0.5f; gun.reloadTime = 1.2f; } public override bool GetEnabled() { return false; } } public class AmmoOne : SimpleCard { public override CardDetails Details { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0051: Expected O, but got Unknown CardDetails val = new CardDetails(); val.Title = "Ammo - I"; val.Description = "<color=\"purple\">[ Fortune ]</color>"; val.Stats = (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, amount = "+3", simepleAmount = (SimpleAmount)2, stat = "Ammo" } }; val.ModName = "Arcana"; return val; } } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { gun.ammo = 3; } public override bool GetEnabled() { return false; } } public class AmmoTwo : SimpleCard { public override CardDetails Details { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0051: Expected O, but got Unknown CardDetails val = new CardDetails(); val.Title = "Ammo - II"; val.Description = "<color=\"purple\">[ Fortune ]</color>"; val.Stats = (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, amount = "+6", simepleAmount = (SimpleAmount)2, stat = "Ammo" } }; val.ModName = "Arcana"; return val; } } public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { gun.ammo = 6; } public override bool GetEnabled() { return false; } } [RequireComponent(typeof(PhotonView))] public class ChainLightning : MonoBehaviour, IPunInstantiateMagicCallback { [SerializeField] [AssetsOnly] private ChainLightningSpawner spawner; [SerializeField] private UnityEvent onHit; [SerializeField] private float hitRange; [SerializeField] private float damage; private PhotonView view; private HashSet<Player> hitPlayers = new HashSet<Player>(); private Player target; private Player owner; private Vector2 velocity; private bool active = true; private void Awake() { view = ((Component)this).GetComponent<PhotonView>(); } private void FixedUpdate() { //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_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_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_0083: 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_00f1: Unknown result type (might be due to invalid IL or missing references) if (!view.IsMine || !active) { return; } ((Component)this).transform.position = Vector2.op_Implicit(Vector2.SmoothDamp(Vector2.op_Implicit(((Component)this).transform.position), Vector2.op_Implicit(((Component)target).transform.position), ref velocity, 0.1f)); view.RPC("RPC_SetPosition", (RpcTarget)1, new object[1] { ((Component)this).transform.position }); if (InRange()) { hitPlayers.Add(target); TrySplit(); view.RPC("RPCA_DealDamage", (RpcTarget)0, new object[4] { velocity, GetScaledDamage(), ((Component)this).transform.position, owner.playerID }); ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)Unbound.Instance, 1, (Action)delegate { PhotonNetwork.Destroy(((Component)this).gameObject); }); active = false; } } private bool InRange() { //IL_0007: 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) return Vector3.Distance(((Component)this).transform.position, ((Component)target).transform.position) <= hitRange; } private float GetScaledDamage() { return damage * owner.data.weaponHandler.gun.damage; } [PunRPC] private void RPCA_DealDamage(Vector2 velocity, float damage, Vector3 position, int ownerId) { //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_002b: 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) Player playerWithID = ExtensionMethods.GetPlayerWithID(PlayerManager.instance, ownerId); ((Damagable)target.data.healthHandler).TakeDamage(((Vector2)(ref velocity)).normalized * damage, Vector2.op_Implicit(position), (GameObject)null, playerWithID, true, false); UnityEvent obj = onHit; if (obj != null) { obj.Invoke(); } } private void TrySplit() { //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) IEnumerable<Player> enumerable = from p in PlayerManager.instance.players.Except(hitPlayers) where p.IsFullyAlive() && PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)this).transform.position), p).canSee select p; foreach (Player item in enumerable) { PhotonNetwork.Instantiate(((Object)spawner.chainLightningPrefab).name, ((Component)this).transform.position, Quaternion.identity, (byte)0, new object[3] { owner.playerID, hitPlayers.Select((Player p) => p.playerID).ToArray(), item.playerID }); } } [PunRPC] private void RPC_SetPosition(Vector3 position) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = position; } public void OnPhotonInstantiate(PhotonMessageInfo info) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) object[] instantiationData = info.photonView.InstantiationData; if (instantiationData.Length == 3) { int num = (int)instantiationData[0]; int[] ignorePlayerIds = (int[])instantiationData[1]; int num2 = (int)instantiationData[2]; owner = ExtensionMethods.GetPlayerWithID(PlayerManager.instance, num); IEnumerable<Player> other = PlayerManager.instance.players.Where((Player p) => ignorePlayerIds.Contains(p.playerID)); hitPlayers.UnionWith(other); target = ExtensionMethods.GetPlayerWithID(PlayerManager.instance, num2); } } } public class ChainLightningSpawner : MonoBehaviour { [SerializeField] [AssetsOnly] internal GameObject chainLightningPrefab; private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) if (!((DefaultPool)PhotonNetwork.PrefabPool).ResourceCache.ContainsKey(((Object)chainLightningPrefab).name)) { PhotonNetwork.PrefabPool.RegisterPrefab(((Object)chainLightningPrefab).name, chainLightningPrefab); } } private void Start() { //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) Player owner = ((Component)this).GetComponent<SpawnedAttack>().spawner; if (!owner.data.view.IsMine) { return; } IOrderedEnumerable<Player> orderedEnumerable = from p in PlayerManager.instance.players where (Object)(object)p != (Object)(object)owner && p.IsFullyAlive() && PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)this).transform.position), p).canSee orderby Vector3.Distance(((Component)this).transform.position, ((Component)p).transform.position) select p; if (orderedEnumerable == null || orderedEnumerable.Count() == 0) { return; } foreach (Player item in orderedEnumerable) { PhotonNetwork.Instantiate(((Object)chainLightningPrefab).name, ((Component)this).transform.position, Quaternion.identity, (byte)0, new object[3] { owner.playerID, new int[1] { owner.playerID }, item.playerID }); } } } public class ChariotCharge : MonoBehaviour { [SerializeField] private float damage; [SerializeField] private float castRadius; [SerializeField] private float castRange; private SpawnedAttack spawned; private void Awake() { spawned = ((Component)this).GetComponent<SpawnedAttack>(); } private IEnumerator Start() { yield return null; ((Component)this).transform.up = spawned.spawner.data.aimDirection; if (!spawned.spawner.data.view.IsMine) { yield break; } yield return (object)new WaitForSeconds(0.15f); RaycastHit2D[] array = Physics2D.CircleCastAll(Vector2.op_Implicit(((Component)this).transform.position), castRadius, Vector2.op_Implicit(((Component)this).transform.up), castRange, LayerMask.op_Implicit(ArcanaCardsPlugin.playerMask)); for (int i = 0; i < array.Length; i++) { RaycastHit2D hit = array[i]; Player componentInChildren; Player target = (componentInChildren = ((Component)((Component)((RaycastHit2D)(ref hit)).collider).transform.root).GetComponentInChildren<Player>()); if (componentInChildren != null && target.teamID != spawned.spawner.teamID) { ((Damagable)target.data.healthHandler).CallTakeDamage(Vector2.op_Implicit(((Component)this).transform.up * GetScaledDamage()), Vector2.op_Implicit(((Component)target).transform.position), (GameObject)null, spawned.spawner, true); } hit = default(RaycastHit2D); } } private float GetScaledDamage() { float num = Mathf.Max(1f, spawned.spawner.data.block.Cooldown()); float num2 = Mathf.Max(1f, (float)spawned.spawner.data.block.additionalBlocks); return damage * (num / 4f) / num2; } } public class CoroutineTest : MonoBehaviour { private void Start() { ((MonoBehaviour)this).StartCoroutine(Foo()); } private IEnumerator Foo() { Debug.Log((object)"Start"); yield return Bar(); Debug.Log((object)"End"); } private IEnumerator Bar() { yield break; } } public class CrimsonAura : MonoBehaviour { [SerializeField] private float maxRadius; [SerializeField] private float minPercentage; [SerializeField] private float fillTime; [SerializeField] private float damage; [SerializeField] private float force; private Vector3 baseScale; private Player owner; private float smoothingVelocity = 0f; private float targetPercentage = 0f; private float currentPercentage = 0f; private float smoothTime = 0.3f; [SerializeField] private UnityEvent onDealtDamage; [SerializeField] private UnityEvent onSpawn; [SerializeField] private UnityEvent onStartDespawn; private IEnumerator Start() { ((Component)this).transform.localScale = Vector3.ClampMagnitude(((Component)this).transform.localScale, 4f); baseScale = ((Component)this).transform.localScale; ((Component)this).transform.localScale = Vector3.zero; owner = ((Component)this).GetComponent<SpawnedAttack>().spawner; UnityEvent obj = onSpawn; if (obj != null) { obj.Invoke(); } targetPercentage = 1f; yield return (object)new WaitForSeconds(fillTime + 1f); UnityEvent obj2 = onStartDespawn; if (obj2 != null) { obj2.Invoke(); } targetPercentage = 0f; yield return (object)new WaitForSeconds(fillTime / 2f); Object.Destroy((Object)(object)((Component)this).gameObject); } private void Update() { //IL_002b: 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) currentPercentage = Mathf.SmoothDamp(currentPercentage, targetPercentage, ref smoothingVelocity, smoothTime); ((Component)this).transform.localScale = baseScale * currentPercentage; } private void FixedUpdate() { ApplyEffectInArea(); } private void ApplyEffectInArea() { //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_0040: 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) if (!PhotonNetwork.IsMasterClient && !PhotonNetwork.OfflineMode) { return; } HashSet<Player> hashSet = new HashSet<Player>(); Collider2D[] array = Physics2D.OverlapCircleAll(Vector2.op_Implicit(((Component)this).transform.position), GetScaledRadius() * currentPercentage, LayerMask.op_Implicit(ArcanaCardsPlugin.playerMask)); DOTDealer dOTDealer = default(DOTDealer); foreach (Collider2D val in array) { Player componentInParent = ((Component)((Component)val).transform).GetComponentInParent<Player>(); if (!hashSet.Contains(componentInParent)) { if (!ExtensionMethods.TryGetComponent<DOTDealer>(((Component)componentInParent).gameObject, ref dOTDealer)) { ((Component)componentInParent).gameObject.AddComponent<DOTDealer>().Initialize(owner, componentInParent, 0.3f, 0.3f, ((Component)this).transform.position, GetScaledForce, GetScaledDamage, OnDealtDamage); } hashSet.Add(componentInParent); } } } private float GetScaledRadius() { return maxRadius * baseScale.x; } private float GetScaledForce() { return force * currentPercentage; } private float GetScaledDamage() { float num = Mathf.Max(1f, baseScale.x); return damage * currentPercentage * num; } private void OnDealtDamage() { UnityEvent obj = onDealtDamage; if (obj != null) { obj.Invoke(); } } } public class DOTDealer : MonoBehaviour { private Player owner; private Player target; private float duration; private float interval; private Vector3 effectCenter; private Func<float> damageProvider; private Func<float> forceProvider; private Action onDealtDamageAction; public void Initialize(Player owner, Player target, float duration, float interval, Vector3 effectCenter, Func<float> forceProvider, Func<float> damageProvider, Action onDealtDamageAction) { //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) this.owner = owner; this.target = target; this.duration = duration; this.interval = interval; this.effectCenter = effectCenter; this.forceProvider = forceProvider; this.damageProvider = damageProvider; this.onDealtDamageAction = onDealtDamageAction; } private IEnumerator Start() { float startTime = Time.time; while (Time.time - startTime <= duration) { if ((Object)(object)target != (Object)(object)owner) { ((Damagable)target.data.healthHandler).CallTakeDamage(Vector2.op_Implicit(Vector3.Normalize(effectCenter - ((Component)target).transform.position) * damageProvider()), Vector2.op_Implicit(((Component)target).transform.position), (GameObject)null, owner, true); onDealtDamageAction?.Invoke(); } yield return (object)new WaitForSeconds(interval); } Object.Destroy((Object)(object)this); } private void FixedUpdate() { //IL_000c: 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_001c: 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_0032: 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) Vector3 val = Vector3.Normalize(((Component)target).transform.position - effectCenter); target.data.healthHandler.CallTakeForce(Vector2.op_Implicit(val * forceProvider()), (ForceMode2D)0, false, false, 0f); } private void OnDisable() { ((MonoBehaviour)this).StopAllCoroutines(); Object.Destroy((Object)(object)this); } } [RequireComponent(typeof(ParticleSystem))] public class DamagingParticles : MonoBehaviour { public float damage; public UnityEvent onCollide; private ParticleSystem particles; private SpawnedAttack spawnedAttack; private void Awake() { particles = ((Component)this).GetComponent<ParticleSystem>(); } private void Start() { spawnedAttack = ((Component)this).GetComponent<SpawnedAttack>(); } private void OnParticleCollision(GameObject other) { //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_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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_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) UnityEvent obj = onCollide; if (obj != null) { obj.Invoke(); } if (!PhotonNetwork.IsMasterClient && !PhotonNetwork.OfflineMode) { return; } Damagable val = other.GetComponentInParent<Damagable>(); if ((Object)(object)val == (Object)null) { val = other.GetComponentInChildren<Damagable>(); } if (!((Object)(object)val == (Object)null) && !((Object)(object)((Component)val).transform.root == (Object)(object)((Component)spawnedAttack.spawner).transform.root)) { List<ParticleCollisionEvent> list = new List<ParticleCollisionEvent>(ParticlePhysicsExtensions.GetSafeCollisionEventSize(particles)); if (ParticlePhysicsExtensions.GetCollisionEvents(particles, other, list) != 0) { Damagable obj2 = val; ParticleCollisionEvent val2 = list[0]; Vector3 velocity = ((ParticleCollisionEvent)(ref val2)).velocity; Vector2 val3 = Vector2.op_Implicit(((Vector3)(ref velocity)).normalized * GetScaledDamage()); val2 = list[0]; obj2.CallTakeDamage(val3, Vector2.op_Implicit(((ParticleCollisionEvent)(ref val2)).intersection), (GameObject)null, (Player)null, true); } } } private float GetScaledDamage() { return damage * spawnedAttack.spawner.data.weaponHandler.gun.damage / 2f; } } public static class ExtensionMethods { public static bool IsFullyAlive(this Player p) { return !p.data.dead && !p.data.healthHandler.isRespawning; } public static bool IsMinion(this Player p) { return CharacterDataExtension.GetAdditionalData(p.data).isAIMinion; } } internal class FoolBlackoutHandler : MonoBehaviour { [SerializeField] private Image colorBorder; [SerializeField] private TextMeshProUGUI rarityText; private Rarity rarity; internal void Initialize(Rarity rarity) { this.rarity = rarity; } private void Start() { DisplayRarity(); } private void DisplayRarity() { //IL_001c: 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_0021: 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_0035: Unknown result type (might be due to invalid IL or missing references) Color color = ((rarity == RarityUtils.GetRarityData((Rarity)0)) ? Color.white : rarity.color); ((Graphic)colorBorder).color = color; ((Graphic)rarityText).color = color; ((TMP_Text)rarityText).text = rarity.name; } } public class FortunesCountdown : MonoBehaviour { [SerializeField] private TextMeshProUGUI countdownText; internal static int duration = 60; private void Awake() { Event<FortuneHandler.FinishedPickingEvent>.RegisterListener(DoDestroy); } private IEnumerator Start() { for (int i = 0; i < duration; i++) { ((TMP_Text)countdownText).text = $"{duration - i}"; yield return (object)new WaitForSeconds(1f); } } private void DoDestroy(FortuneHandler.FinishedPickingEvent e) { ((MonoBehaviour)this).StopAllCoroutines(); Object.Destroy((Object)(object)((Component)this).gameObject); } private void OnDestroy() { Event<FortuneHandler.FinishedPickingEvent>.UnregisterListener(DoDestroy); } } public class FortunesWheel : MonoBehaviour { [SerializeField] private TextMeshProUGUI resultText; [HideInInspector] public Player target; public void Initialize(Player target) { this.target = target; } public void CalculateReward() { if ((Object)(object)target == (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); } else if (target.data.view.IsMine) { int num = Random.Range(0, 4); NetworkingManager.RPC(typeof(FortunesWheel), "RPCA_ShowReward", new object[1] { num }); } } public void ShowReward(int winnings) { ((TMP_Text)resultText).text = winnings.ToString(); ((Component)resultText).gameObject.SetActive(true); if (!((Object)(object)target == (Object)null)) { PlayerExtension.GetAdditionalData(target).bankAccount.Deposit("Fortune", winnings); } } [UnboundRPC] private static void RPCA_ShowReward(int winnings) { Object.FindObjectOfType<FortunesWheel>().ShowReward(winnings); } } public class HierophantHitEffect : RayHitEffect { private Player owner; private void Start() { owner = ((Component)((Component)this).transform.root).GetComponentInChildren<ProjectileHit>().ownPlayer; } public override HasToReturn DoHitEffect(HitInfo hit) { //IL_002a: 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) Player componentInParent; if ((componentInParent = ((Component)hit.collider).GetComponentInParent<Player>()) != null) { new HierophantHit(owner, componentInParent).FireEvent(); } return (HasToReturn)1; } } public class HierophantHit : Event<HierophantHit> { public Player owner; public Player target; public HierophantHit(Player owner, Player target) { this.owner = owner; this.target = target; } } [RequireComponent(typeof(ParticleSystem))] public class MagicMissiles : MonoBehaviour { [SerializeField] private ParticleSystemForceField attractorPrefab; [SerializeField] private float damage; [SerializeField] private UnityEvent onDamage; [SerializeField] private GameObject hitEffect; private ParticleSystemForceField attractor; private ParticleSystem particles; private SpawnedAttack spawned; private Player target; private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) if (!((DefaultPool)PhotonNetwork.PrefabPool).ResourceCache.ContainsKey(((Object)hitEffect).name)) { PhotonNetwork.PrefabPool.RegisterPrefab(((Object)hitEffect).name, hitEffect); } } private void Start() { //IL_0084: 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) particles = ((Component)this).GetComponent<ParticleSystem>(); spawned = ((Component)this).GetComponent<SpawnedAttack>(); target = (from p in PlayerManager.instance.players where p.teamID != spawned.spawner.teamID && p.IsFullyAlive() orderby Vector3.Distance(((Component)this).transform.position, ((Component)p).transform.position) select p).FirstOrDefault(); if (!((Object)(object)target == (Object)null)) { attractor = Object.Instantiate<ParticleSystemForceField>(attractorPrefab, ((Component)target).transform); ExternalForcesModule externalForces = particles.externalForces; ((ExternalForcesModule)(ref externalForces)).AddInfluence(attractor); } } private void OnParticleCollision(GameObject other) { //IL_0038: 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_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_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_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_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_00ed: 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) if (!((Object)(object)target == (Object)null) && (PhotonNetwork.IsMasterClient || PhotonNetwork.OfflineMode)) { Vector3 val = Vector3.Normalize(((Component)target).transform.position - ((Component)spawned.spawner).transform.position) * GetScaledDamage(); ((Damagable)target.data.healthHandler).CallTakeDamage(Vector2.op_Implicit(val), Vector2.op_Implicit(((Component)target).transform.position), (GameObject)null, spawned.spawner, true); UnityEvent obj = onDamage; if (obj != null) { obj.Invoke(); } List<ParticleCollisionEvent> list = new List<ParticleCollisionEvent>(ParticlePhysicsExtensions.GetSafeCollisionEventSize(particles)); int collisionEvents = ParticlePhysicsExtensions.GetCollisionEvents(particles, other, list); string name = ((Object)hitEffect).name; ParticleCollisionEvent val2 = list[0]; PhotonNetwork.Instantiate(name, ((ParticleCollisionEvent)(ref val2)).intersection, hitEffect.transform.rotation, (byte)0, (object[])null); } } private void OnParticleSystemStopped() { if ((Object)(object)attractor != (Object)null) { Object.Destroy((Object)(object)((Component)attractor).gameObject); } Object.Destroy((Object)(object)((Component)this).gameObject); } private float GetScaledDamage() { float num = Mathf.Max(1f, spawned.spawner.data.block.Cooldown()); float num2 = Mathf.Max(1f, (float)spawned.spawner.data.block.additionalBlocks); return damage * (num / 4f) / num2; } } public class MoonBeam : MonoBehaviour { [SerializeField] private float delay; [SerializeField] private float duration; [SerializeField] private float force; [SerializeField] private float damage; [SerializeField] private float radius; [SerializeField] private UnityEvent onEffectActivate; [SerializeField] private UnityEvent onEffectDeactivate; private SpawnedAttack spawned; private IEnumerator Start() { spawned = ((Component)this).GetComponent<SpawnedAttack>(); yield return (object)new WaitForSeconds(delay); UnityEvent obj = onEffectActivate; if (obj != null) { obj.Invoke(); } IEnumerable<Player> playersHit = from p in PlayerManager.instance.players where p.playerID != spawned.spawner.playerID && !p.data.dead where Vector3.Distance(((Component)this).transform.position, ((Component)p).transform.position) <= GetScaledRadius() select p; foreach (Player target in playersHit) { target.data.stunHandler.AddStun(1f); if (PhotonNetwork.IsMasterClient || PhotonNetwork.OfflineMode) { Vector3 direction = Vector3.Normalize(((Component)target).transform.position - ((Component)this).transform.position); target.data.healthHandler.CallTakeForce(Vector2.op_Implicit(direction * GetScaledForce()), (ForceMode2D)1, false, true, 0f); ((Damagable)target.data.healthHandler).CallTakeDamage(Vector2.op_Implicit(direction * GetScaledDamage()), Vector2.op_Implicit(((Component)target).transform.position), (GameObject)null, spawned.spawner, true); } } float startTime = Time.time; while (Time.time - startTime <= duration) { yield return (object)new WaitForFixedUpdate(); PushProjectiles(); } UnityEvent obj2 = onEffectDeactivate; if (obj2 != null) { obj2.Invoke(); } } private void PushProjectiles() { //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_0018: 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_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_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_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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_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) Collider2D[] array = Physics2D.OverlapCircleAll(Vector2.op_Implicit(((Component)this).transform.position), GetScaledRadius(), LayerMask.op_Implicit(ArcanaCardsPlugin.projectileMask)); foreach (Collider2D val in array) { Vector3 val2 = Vector3.Normalize(((Component)val).transform.position - ((Component)this).transform.position) * GetScaledForce() * 0.02f; MoveTransform componentInChildren = ((Component)((Component)val).transform.root).GetComponentInChildren<MoveTransform>(); componentInChildren.velocity += val2; } } private float GetHealthScalar() { return spawned.spawner.data.maxHealth / 100f; } private float GetScaledForce() { return force * GetHealthScalar(); } private float GetScaledDamage() { return damage * GetHealthScalar(); } private float GetScaledRadius() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) return radius * ((Component)this).transform.localScale.x; } } [HarmonyPatch(typeof(ApplyCardStats), "ApplyStats")] internal class ApplyCardStatsPatch { private static void Postfix(ApplyCardStats __instance, Player ___playerToUpgrade) { ((Component)__instance).GetComponentsInChildren<OnAddEffect>().ToList().ForEach(delegate(OnAddEffect effect) { effect.Run(___playerToUpgrade); }); } } [HarmonyPatch(typeof(DeathEffect))] internal class DeathEffect_Patch { [HarmonyPostfix] [HarmonyPatch("PlayDeath")] private static void AdjustedRespawnTime(DeathEffect __instance, Color color, PlayerVelocity playerRig, Vector2 vel, int playerIDToRevive) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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 (playerIDToRevive == -1) { return; } Player player = ((CharacterData)ExtensionMethods.GetFieldValue((object)playerRig, "data")).player; if ((Object)(object)((Component)player).GetComponentInChildren<DeathHandler>() != (Object)null) { float num = 0.5f; ExtensionMethods.SetFieldValue((object)__instance, "respawnTime", (object)num); ParticleSystem[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<ParticleSystem>(); ParticleSystem[] array = componentsInChildren; foreach (ParticleSystem val in array) { val.playbackSpeed = 2.53f / num; MainModule main = val.main; ((MainModule)(ref main)).simulationSpeed = 2.53f / num; } ((Component)__instance).gameObject.GetComponent<RemoveAfterSeconds>().seconds = 2f * num; } } } [HarmonyPatch(typeof(CardChoice))] public class UniqueCardChoicePatch { [HarmonyPatch("SpawnUniqueCard")] [HarmonyPostfix] public static void SpawnUniqueCard_Patch(ref GameObject __result, int ___pickrID, PickerType ___pickerType, Vector3 pos, Quaternion rot) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 Player key = (((int)___pickerType != 0) ? PlayerManager.instance.players[___pickrID] : PlayerManager.instance.GetPlayersInTeam(___pickrID)[0]); if (FoolHandler.fooledPlayers.ContainsKey(key)) { SpawnFoolBlackout(__result); NetworkingManager.RPC_Others(typeof(UniqueCardChoicePatch), "RPC_SpawnFoolBlackout", new object[1] { __result.GetComponent<PhotonView>().ViewID }); } } private static void SpawnFoolBlackout(GameObject card) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0033: 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) CardInfo componentInChildren = card.GetComponentInChildren<CardInfo>(); Canvas componentInChildren2 = ((Component)componentInChildren).gameObject.GetComponentInChildren<Canvas>(); foreach (Transform item in ((Component)componentInChildren2).transform) { Transform val = item; val.localScale = Vector3.zero; } Object.Instantiate<GameObject>(Assets.FoolBlackout, ((Component)componentInChildren2).transform).GetComponent<FoolBlackoutHandler>().Initialize(RarityUtils.GetRarityData(componentInChildren.rarity)); CardVisuals componentInChildren3 = card.GetComponentInChildren<CardVisuals>(); ((Behaviour)componentInChildren3.nameText).enabled = false; } [UnboundRPC] public static void RPC_SpawnFoolBlackout(int targetCardId) { GameObject gameObject = ((Component)PhotonNetwork.GetPhotonView(targetCardId)).gameObject; SpawnFoolBlackout(gameObject); } } [CreateAssetMenu(fileName = "CardProvider", menuName = "ItemShop/CardProvider")] public class CardProvider : ScriptableObject, IProvider<CardInfo> { public enum CardType { HealthOne, HealthTwo, DamageOne, DamageTwo, ReloadOne, ReloadTwo, BlockOne, BlockTwo, AmmoOne, AmmoTwo } private static Dictionary<CardType, Type> cardMap = new Dictionary<CardType, Type> { { CardType.HealthOne, typeof(HealthOne) }, { CardType.HealthTwo, typeof(HealthTwo) }, { CardType.DamageOne, typeof(DamageOne) }, { CardType.DamageTwo, typeof(DamageTwo) }, { CardType.ReloadOne, typeof(ReloadOne) }, { CardType.ReloadTwo, typeof(ReloadTwo) }, { CardType.BlockOne, typeof(BlockOne) }, { CardType.BlockTwo, typeof(BlockTwo) }, { CardType.AmmoOne, typeof(AmmoOne) }, { CardType.AmmoTwo, typeof(AmmoTwo) } }; public CardType card; public CardInfo GetValue() { return CardRegistry.GetCard(cardMap[card]); } } [CreateAssetMenu(fileName = "PurchasableCardItem", menuName = "ItemShop/PurchasableCardItem")] public class PurchasableCardObject : ScriptableObject, IProvider<PurchasableCard> { [LabelWidth(75f)] [HorizontalGroup("Item Details", 0f, 0, 0, 0f)] public string itemName; [LabelWidth(75f)] [HorizontalGroup("Item Details", 0f, 0, 0, 0f)] public string itemId; [LabelWidth(75f)] [HorizontalGroup("Currency Details", 0f, 0, 0, 0f)] public string currency; [LabelWidth(75f)] [HorizontalGroup("Currency Details", 0f, 0, 0, 0f)] public int amount; public CardProvider card; public TagObject[] tags; public PurchasableCard GetValue() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown Dictionary<string, int> dictionary = new Dictionary<string, int> { { currency, amount } }; return new PurchasableCard(card.GetValue(), dictionary, tags.Select((TagObject t) => t.GetValue()).ToArray()); } } [CreateAssetMenu(fileName = "PurchasableItem", menuName = "ItemShop/PurchasableItem")] public class PurchasableObject : ScriptableObject, IProvider<Purchasable> { [LabelWidth(75f)] [HorizontalGroup("Item Details", 0f, 0, 0, 0f)] public string itemName; [LabelWidth(75f)] [HorizontalGroup("Item Details", 0f, 0, 0, 0f)] public string itemId; [LabelWidth(75f)] [HorizontalGroup("Currency Details", 0f, 0, 0, 0f)] public string currency; [LabelWidth(75f)] [HorizontalGroup("C