Decompiled source of Supcom2Cards v2.0.3
Supcom2Cards.dll
Decompiled 2 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using HarmonyLib; using Jotunn.Utils; using Microsoft.CodeAnalysis; using ModdingUtils.MonoBehaviours; using ModdingUtils.RoundsEffects; using ModdingUtils.Utils; using ModsPlus; using On; using Sonigon; using Supcom2Cards.Cards; using Supcom2Cards.MonoBehaviours; using Supcom2Cards.RoundsEffects; using UnboundLib; using UnboundLib.Cards; using UnboundLib.GameModes; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Supcom2Cards")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+4785b96a7b4684ff7ca5574d7ea3a388b75b50fd")] [assembly: AssemblyProduct("Supcom2Cards")] [assembly: AssemblyTitle("Supcom2Cards")] [assembly: AssemblyVersion("1.0.0.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } public class ProtoBrainEffect : MonoBehaviour { public Player player; public void Start() { player = ((Component)this).gameObject.GetComponentInParent<Player>(); } } public class TempExtraPicks : MonoBehaviour { [SerializeField] public int ExtraPicks = 0; internal static IEnumerator HandleExtraPicks() { Player[] array = PlayerManager.instance.players.ToArray(); foreach (Player player in array) { TempExtraPicks[] extraDrawComponents = ((Component)player).GetComponentsInChildren<TempExtraPicks>(); int remainingDraws = extraDrawComponents.Sum((TempExtraPicks e) => e.ExtraPicks); if (remainingDraws > 0) { extraDrawComponents.Where((TempExtraPicks e) => e.ExtraPicks > 0).First().ExtraPicks--; yield return GameModeManager.TriggerHook("PlayerPickStart"); CardChoiceVisuals.instance.Show((from i in Enumerable.Range(0, PlayerManager.instance.players.Count) where PlayerManager.instance.players[i].playerID == player.playerID select i).First(), true); yield return CardChoice.instance.DoPick(1, player.playerID, (PickerType)1); yield return (object)new WaitForSecondsRealtime(0.1f); yield return GameModeManager.TriggerHook("PlayerPickEnd"); yield return (object)new WaitForSecondsRealtime(0.1f); } } } } namespace Supcom2Cards { [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.alphahex.rounds.supcom2cards", "Supcom2 Cards", "2.0.3")] [BepInProcess("Rounds.exe")] public class Supcom2 : BaseUnityPlugin { public const string Version = "2.0.3"; private const string ModId = "com.alphahex.rounds.supcom2cards"; private const string ModName = "Supcom2 Cards"; public const string ModInitials = "SC2"; public static Dictionary<string, GameObject> CardArt = new Dictionary<string, GameObject>(); public static bool PickPhase = false; public static Supcom2? Instance { get; private set; } private void Awake() { //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.alphahex.rounds.supcom2cards"); val.PatchAll(); GameModeManager.AddHook("GameEnd", (Func<IGameModeHandler, IEnumerator>)GameEnd); GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)PointEnd); GameModeManager.AddHook("PointStart", (Func<IGameModeHandler, IEnumerator>)PointStart); GameModeManager.AddHook("RoundEnd", (Func<IGameModeHandler, IEnumerator>)RoundEnd); GameModeManager.AddHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => TempExtraPicks.HandleExtraPicks())); } private void Start() { LoadCardArt(); CustomCard.BuildCard<Afterburn>(); CustomCard.BuildCard<BombBouncer>(); CustomCard.BuildCard<Brackman>(); CustomCard.BuildCard<Buhbledow>(); CustomCard.BuildCard<ChromeShield>(); CustomCard.BuildCard<ClusterBomb>(); CustomCard.BuildCard<Colossus>(); CustomCard.BuildCard<Crahdow>(); CustomCard.BuildCard<Cybranasaurus>(); CustomCard.BuildCard<Darkenoid>(); CustomCard.BuildCard<Disruptor>(); CustomCard.BuildCard<DynamicPowerShunt>(); CustomCard.BuildCard<Fatboy>(); CustomCard.BuildCard<Fistoosh>(); CustomCard.BuildCard<HalfBaked>(); CustomCard.BuildCard<Harden>(); CustomCard.BuildCard<Harvog>(); CustomCard.BuildCard<Hunker>(); CustomCard.BuildCard<Jackhammer>(); CustomCard.BuildCard<JumpJets>(); CustomCard.BuildCard<Loyalist>(); CustomCard.BuildCard<LoyaltyGun>(); CustomCard.BuildCard<Magnetron>(); CustomCard.BuildCard<Megalith>(); CustomCard.BuildCard<Nuke>(); CustomCard.BuildCard<Overcharge>(); CustomCard.BuildCard<Poseidon>(); CustomCard.BuildCard<Pulinsmash>(); CustomCard.BuildCard<QuantumForceBlast>(); CustomCard.BuildCard<QuantumSponge>(); CustomCard.BuildCard<RadarJammer>(); CustomCard.BuildCard<RateOfFire>(); CustomCard.BuildCard<Recycler>(); CustomCard.BuildCard<RockHead>(); CustomCard.BuildCard<RogueNanites>(); CustomCard.BuildCard<Shotja>(); CustomCard.BuildCard<StackedCannons>(); CustomCard.BuildCard<SuperTriton>(); CustomCard.BuildCard<Titan>(); CustomCard.BuildCard<Tml>(); CustomCard.BuildCard<Training>(); CustomCard.BuildCard<Urchinow>(); CustomCard.BuildCard<Wilfindja>(); Instance = this; } private void LoadCardArt() { List<string> assetNames = new List<string> { "ClusterBomb", "Colossus", "Darkenoid", "Disruptor", "Magnetron", "Megalith", "Nuke", "Poseidon", "Shotja", "Tml" }; List<string> assetNames2 = new List<string> { "Afterburn", "Brackman", "Buhbledow", "ChromeShield", "Crahdow", "Cybranasaurus", "DynamicPowerShunt", "Fatboy", "FieldEngineer", "Fistoosh", "HalfBaked", "Harden", "Harvog", "Hunker", "Jackhammer", "JumpJets", "Loyalist", "LoyaltyGun", "Overcharge", "Poseidon", "Pulinsmash", "QuantumForceBlast", "QuantumSponge", "RadarJammer", "RateOfFire", "Recycler", "RockHead", "RogueNanites", "StackedCannons", "SuperTriton", "Titan", "Training", "Urchinow", "Wilfindja" }; List<string> assetNames3 = new List<string> { "BombBouncer" }; CardArt.LoadArt("Supcom2Art_1", assetNames); CardArt.LoadArt("Supcom2Art_2", assetNames2); CardArt.LoadArt("sc2test", assetNames3); } public static void Log(string word) { Debug.Log((object)word); } public static (GameObject AddToProjectile, GameObject effect, Explosion explosion) LoadExplosion(string name, Gun? gun = null) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) GameObject val = (GameObject)Resources.Load("0 cards/Explosive bullet"); Gun component = val.GetComponent<Gun>(); if ((Object)(object)gun != (Object)null) { gun.soundGun.AddSoundImpactModifier(component.soundImpactModifier); } GameObject addToProjectile = component.objectsToSpawn[0].AddToProjectile; GameObject val2 = Object.Instantiate<GameObject>(component.objectsToSpawn[0].effect); val2.transform.position = new Vector3(1000f, 0f, 0f); ((Object)val2).hideFlags = (HideFlags)61; ((Object)val2).name = name; Object.DestroyImmediate((Object)(object)val2.GetComponent<RemoveAfterSeconds>()); Explosion component2 = val2.GetComponent<Explosion>(); return (addToProjectile, val2, component2); } public List<int> GetRoundWinners() { return new List<int>(GameModeManager.CurrentHandler.GetRoundWinners()); } private IEnumerator GameEnd(IGameModeHandler gm) { ResetEffects(); ISingletonEffect.GameEnd(); yield break; } private IEnumerator PointEnd(IGameModeHandler gm) { PickPhase = true; ResetEffects(); yield break; } private IEnumerator PointStart(IGameModeHandler gm) { PickPhase = false; ResetEffects(); yield break; } private IEnumerator RoundEnd(IGameModeHandler gm) { ResetEffects(); yield break; } private void ResetEffects() { AfterburnEffect[] array = Object.FindObjectsOfType<AfterburnEffect>(); foreach (AfterburnEffect afterburnEffect in array) { afterburnEffect.counterValue = 0f; ((ReversibleEffect)afterburnEffect).ClearModifiers(true); } BombBouncerEffect[] array2 = Object.FindObjectsOfType<BombBouncerEffect>(); foreach (BombBouncerEffect bombBouncerEffect in array2) { bombBouncerEffect.Charge = 0f; } CybranasaurusEffect[] array3 = Object.FindObjectsOfType<CybranasaurusEffect>(); foreach (CybranasaurusEffect cybranasaurusEffect in array3) { cybranasaurusEffect.yMax = -1000f; } HalfBakedEffect[] array4 = Object.FindObjectsOfType<HalfBakedEffect>(); foreach (HalfBakedEffect halfBakedEffect in array4) { halfBakedEffect.player.data.silenceTime = 0f; } HardenEffect[] array5 = Object.FindObjectsOfType<HardenEffect>(); foreach (HardenEffect hardenEffect in array5) { hardenEffect.counterValue = 0f; ((ReversibleEffect)hardenEffect).ClearModifiers(true); } JumpJetsEffect[] array6 = Object.FindObjectsOfType<JumpJetsEffect>(); foreach (JumpJetsEffect jumpJetsEffect in array6) { jumpJetsEffect.Refuel(); } LoyaltyGunEffectEnemy[] array7 = Object.FindObjectsOfType<LoyaltyGunEffectEnemy>(); foreach (LoyaltyGunEffectEnemy loyaltyGunEffectEnemy in array7) { loyaltyGunEffectEnemy.counterValue = 0f; ((ReversibleEffect)loyaltyGunEffectEnemy).ClearModifiers(true); } OverchargeEffect[] array8 = Object.FindObjectsOfType<OverchargeEffect>(); foreach (OverchargeEffect overchargeEffect in array8) { overchargeEffect.counterValue = 0f; ((ReversibleEffect)overchargeEffect).ClearModifiers(true); ((CounterReversibleEffect)overchargeEffect).Reset(); } RadarJammerEffectEnemy[] array9 = Object.FindObjectsOfType<RadarJammerEffectEnemy>(); foreach (RadarJammerEffectEnemy radarJammerEffectEnemy in array9) { radarJammerEffectEnemy.counterValue = 0f; ((ReversibleEffect)radarJammerEffectEnemy).ClearModifiers(true); } } } public static class ExtensionMethods { private static readonly float MAX_SPEED = 0.01f; public static void RemovePlayerDiedAction(this PlayerManager pm, Action<Player, int> listener) { Action<Player, int> source = (Action<Player, int>)ExtensionMethods.GetFieldValue((object)pm, "PlayerDiedAction"); source = (Action<Player, int>)Delegate.Remove(source, listener); } public static void SetListCount<T>(this List<T> list, int count) where T : new() { int count2 = list.Count; if (count > count2) { for (int i = 0; i < count - count2; i++) { list.Add(new T()); } } else if (count2 > count) { for (int j = 0; j < count2 - count; j++) { list.RemoveAt(0); } } } public static void LoadArt(this Dictionary<string, GameObject> CardArt, string bundleName, List<string> assetNames) { AssetBundle val = AssetUtils.LoadAssetBundleFromResources(bundleName, typeof(Supcom2).Assembly); foreach (string assetName in assetNames) { GameObject val2 = val.LoadAsset<GameObject>("C_" + assetName); if ((Object)(object)val2 != (Object)null) { CardArt.Add(assetName, val2); } } } public static Color Color(this Player player) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) return player.GetTeamColors().color; } public static bool Simulated(this Player player) { return (bool)ExtensionMethods.GetFieldValue((object)player.data.playerVel, "simulated"); } public static bool StandingStill(this Player player, ref Vector3 lastPosition) { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) if (player.data.isGrounded || player.data.isWallGrab) { float num = ((Component)player).transform.position.x - lastPosition.x; num = ((num > 0f) ? num : (0f - num)); float num2 = ((Component)player).transform.position.y - lastPosition.y; num2 = ((num2 > 0f) ? num2 : (0f - num2)); lastPosition = ((Component)player).transform.position; return num * num + num2 * num2 < MAX_SPEED; } lastPosition = ((Component)player).transform.position; return false; } public static IEnumerable<Player> VisibleEnemies(this Player player) { Player player2 = player; return PlayerManager.instance.players.Where((Player enemy) => !enemy.data.dead && enemy.teamID != player2.teamID && enemy.Simulated() && PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)player2.data).transform.position), enemy).canSee); } public static int CurrentAmmo(this GunAmmo gunAmmo) { return (int)ExtensionMethods.GetFieldValue((object)gunAmmo, "currentAmmo"); } public static int CurrentAmmoAdd(this GunAmmo gunAmmo, int add) { if (add == 0) { return 0; } int num = gunAmmo.CurrentAmmo(); int num2 = num + add; if (num2 < 0) { num2 = 0; } if (num2 > gunAmmo.maxAmmo) { num2 = gunAmmo.maxAmmo; } ExtensionMethods.SetFieldValue((object)gunAmmo, "currentAmmo", (object)num2); return num2 - num; } public static Gun Gun(this Player player) { return player.data.weaponHandler.gun; } public static GunAmmo GunAmmo(this Gun gun) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown return (GunAmmo)ExtensionMethods.GetFieldValue((object)gun, "gunAmmo"); } public static float ReloadTime(this GunAmmo gunAmmo) { return (gunAmmo.reloadTime + gunAmmo.reloadTimeAdd) * gunAmmo.reloadTimeMultiplier; } public static void SetActiveBullets(this GunAmmo gunAmmo, bool forceTurnOn = false) { typeof(GunAmmo).InvokeMember("SetActiveBullets", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, gunAmmo, new object[1] { forceTurnOn }); } public static void UpdateAmmo(this Gun gun) { GunAmmo val = gun.GunAmmo(); int num = val.CurrentAmmo(); if (num <= 0) { return; } if (gun.isReloading) { float num2 = (float)ExtensionMethods.GetFieldValue((object)val, "reloadCounter"); float num3 = val.ReloadTime() - num2; ExtensionMethods.SetFieldValue((object)val, "freeReloadCounter", (object)num3); ExtensionMethods.SetFieldValue((object)val, "reloadCounter", (object)num2); val.ReloadAmmo(true); ExtensionMethods.SetFieldValue((object)val, "currentAmmo", (object)num); } for (int num4 = ((Component)val.populate).transform.childCount - 1; num4 >= 0; num4--) { if (((Component)((Component)val.populate).transform.GetChild(num4)).gameObject.activeSelf) { Object.Destroy((Object)(object)((Component)((Component)val.populate).transform.GetChild(num4)).gameObject); } } val.populate.times = val.CurrentAmmo(); val.populate.DoPopulate(); val.SetActiveBullets(forceTurnOn: true); } public static void SetTeamColor(this List<Laser> lasers, Player player, float brightness_mult = 1f) { Player player2 = player; lasers.ForEach(delegate(Laser l) { //IL_0007: 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) l.Color = player2.Color() * brightness_mult; }); } public static void SetTeamColor(this List<Laser> lasers, GameObject gameObjectMono, float brightness_mult = 1f) { lasers.SetTeamColor(gameObjectMono.GetComponentInParent<Player>(), brightness_mult); } public static T IncrementCardEffect<T>(this Player player) where T : Component, ISingletonEffect { T val = ((Component)player).gameObject.GetComponent<T>(); if ((Object)(object)val == (Object)null) { val = ((Component)player).gameObject.AddComponent<T>(); } val.CardAmount++; ISingletonEffect.All.Add((Object)(object)val); return val; } public static T? DecrementCardEffect<T>(this Player player) where T : Component, ISingletonEffect { T component = ((Component)player).gameObject.GetComponent<T>(); component.CardAmount--; if (component.CardAmount < 1) { Object.Destroy((Object)(object)component); ISingletonEffect.All.Remove((Object)(object)component); return default(T); } return component; } } public interface ISingletonEffect { static readonly List<Object> All = new List<Object>(); int CardAmount { get; set; } static void GameEnd() { foreach (Object item in All) { Object.Destroy(item); } } } public class Laser { private Color _color = Color.magenta; private Material _material = new Material(Shader.Find("UI/Default")); private float _width = 0.3f; private float _z = -5f; private readonly LineRenderer line; private readonly Vector3[] cords = (Vector3[])(object)new Vector3[2]; public Color Color { get { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) return _color; } set { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) _color = value; ((Renderer)line).material.color = Color; } } public Material Material { get { return _material; } set { _material = value; ((Renderer)line).material = Material; } } public string Name { get { return ((Object)line).name; } set { ((Object)line).name = value; } } public float Width { get { return _width; } set { _width = value; line.startWidth = Width; line.endWidth = Width; } } public float Z { get { return _z; } set { _z = value; cords[0].z = Z; cords[1].z = Z; } } public Laser() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) line = new GameObject().AddComponent<LineRenderer>(); line.startColor = Color.white; line.endColor = Color.white; line.useWorldSpace = true; ((Renderer)line).material.color = Color; ((Renderer)line).material = Material; Name = "Laser"; line.startWidth = Width; line.endWidth = Width; cords[0].z = Z; cords[1].z = Z; } ~Laser() { Object.Destroy((Object)(object)line); } public void Draw(float x1, float y1, float x2, float y2) { cords[0].x = x1; cords[0].y = y1; cords[1].x = x2; cords[1].y = y2; line.SetPositions(cords); } public void Draw(Vector3 a, Vector3 b) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) Draw(a.x, a.y, b.x, b.y); } public void DrawHidden() { Draw(100f, 100f, 100f, 100f); } } public class Polygon { private int _edges = 3; public float Size = 1f; private float a = MathF.PI * 2f / 3f; public int Edges { get { return _edges; } set { _edges = value; a = MathF.PI * 2f / (float)_edges; } } public void Draw(float x, float y, List<Laser> lasers, float angle = 0f) { float num = x + Size * Mathf.Cos((float)(lasers.Count - 1) * a - angle); float num2 = y + Size * Mathf.Sin((float)(lasers.Count - 1) * a - angle); for (int i = 0; i < lasers.Count; i++) { float x2 = num; float y2 = num2; float num3 = (float)i * a - angle; num = x + Size * Mathf.Cos(num3); num2 = y + Size * Mathf.Sin(num3); lasers[i].Draw(x2, y2, num, num2); } } } public static class RNG { public enum Distribution { Uniform, Exponential } private static uint seed = 3877386580u; private const decimal m = 0.0000000000000000000542101086m; private const double d = 5.421010862427522E-20; private const float f = 2.3283064E-10f; public static bool NextBool() { return (NextUInt() & 1) == 1; } public static byte NextByte() { return BitConverter.GetBytes(NextUInt())[0]; } public static byte[] NextBytes(int size) { byte[] array = new byte[size]; byte[] array2 = new byte[4]; for (int i = 0; i < size; i++) { if (i % 4 == 0) { array2 = BitConverter.GetBytes(NextUInt()); } array[i] = array2[i % 4]; } return array; } public static decimal NextDecimal(Distribution distribution = Distribution.Uniform) { decimal num = (decimal)NextULong() * 0.0000000000000000000542101086m; return distribution switch { Distribution.Uniform => num, Distribution.Exponential => num * NextDecimal(), _ => throw new NotImplementedException($"NextDecimal() {distribution} Distribution not implemented"), }; } public static decimal NextDecimal(decimal min, decimal max, Distribution distribution = Distribution.Uniform) { return NextDecimal(distribution) * (max - min) + min; } public static double NextDouble(Distribution distribution = Distribution.Uniform) { double num = (double)NextULong() * 5.421010862427522E-20; if (num == double.NaN || num == double.NegativeInfinity || num == double.PositiveInfinity) { num = NextDouble(); } return distribution switch { Distribution.Uniform => num, Distribution.Exponential => num * NextDouble(), _ => throw new NotImplementedException($"NextDouble() {distribution} Distribution not implemented"), }; } public static double NextDouble(double min, double max, Distribution distribution = Distribution.Uniform) { return NextDouble(distribution) * (max - min) + min; } public static float NextFloat(Distribution distribution = Distribution.Uniform) { float num = (float)NextUInt() * 2.3283064E-10f; if (num == float.NaN || num == float.NegativeInfinity || num == float.PositiveInfinity) { num = NextFloat(); } return distribution switch { Distribution.Uniform => num, Distribution.Exponential => num * NextFloat(), _ => throw new NotImplementedException($"NextFloat() {distribution} Distribution not implemented"), }; } public static float NextFloat(float min, float max, Distribution distribution = Distribution.Uniform) { return NextFloat(distribution) * (max - min) + min; } public static int NextInt() { return (int)NextUInt(); } public static int NextInt(int min, int max) { uint max2 = (uint)(max - min); uint num = NextUInt(0u, max2); return (int)num + min; } public static uint NextUInt() { uint num = (seed >> 27) ^ (seed >> 11) ^ (seed >> 6) ^ (seed >> 5); seed = (seed << 1) | (num & 1u); return seed; } public static uint NextUInt(uint min, uint max) { uint num = max - min; ulong num2 = (ulong)(((long)num + 1L) * NextUInt()) / 4294967295uL; return (num2 > num) ? (num + min) : ((uint)(int)num2 + min); } public static long NextLong() { return (long)NextULong(); } public static ulong NextULong() { return BitConverter.ToUInt64(NextBytes(8), 0); } public static short NextShort() { return (short)NextUShort(); } public static ushort NextUShort() { return BitConverter.ToUInt16(NextBytes(2), 0); } public static void Reset() { seed = 3877386580u; } private static uint NextBinary() { uint num = 0u; for (int i = 0; i < 32; i++) { num |= (NextUInt() & 1) << i; } return num; } } } namespace Supcom2Cards.RoundsEffects { public class BuhbledowEffect : HitEffect, ISingletonEffect { public int CardAmount { get; set; } = 0; public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer) { Block block = damagedPlayer.data.block; if (!block.IsBlocking() && block.IsOnCD()) { block.counter *= 0.5f; } } } public class ClusterBombEffect : HitSurfaceEffect, ISingletonEffect { public Explosion Explosion; public ObjectsToSpawn ExplosionToSpawn; public Gun gun; public static SoundEvent sound; public int CardAmount { get; set; } = 0; private void Explode(Vector2 position) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) double num = RNG.NextDouble(0.0, Math.PI * 2.0); Vector2 val = new Vector2((float)Math.Cos(num), (float)Math.Sin(num)) * (float)RNG.NextInt(0, ClusterBomb.EXPLOSION_SPREAD); GameObject val2 = Object.Instantiate<GameObject>(ExplosionToSpawn.effect, Vector2.op_Implicit(position + val), Quaternion.identity); Object.Destroy((Object)(object)val2, 2f); SoundManager.Instance.Play(sound, ((Component)this).transform); } public override void Hit(Vector2 position, Vector2 normal, Vector2 velocity) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) Explosion.damage = ClusterBomb.EXPLOSION_DMG_MULT * gun.damage; ((MonoBehaviour)Supcom2.Instance).StartCoroutine(IDoExplosions(position)); } public IEnumerator IDoExplosions(Vector2 position) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < ClusterBomb.EXPLOSION_AMOUNT * CardAmount; i++) { Explode(position); int delay = (int)RNG.NextFloat(1f, ClusterBomb.FRAMES_MAX); for (int frame = 0; frame < delay; frame++) { yield return null; } } } } public class CrahdowEffect : HitEffect, ISingletonEffect { public Player player; public int CardAmount { get; set; } = 0; public void Start() { player = ((Component)this).gameObject.GetComponentInParent<Player>(); } public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer) { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) if (player.data.view.IsMine) { float num = 0.3f; HunkerEffect component = ((Component)damagedPlayer).gameObject.GetComponent<HunkerEffect>(); if ((Object)(object)component != (Object)null) { num *= 2f; } Block block = damagedPlayer.data.block; if (!block.IsBlocking() && !(block.sinceBlock < num) && !damagedPlayer.data.isGrounded && !damagedPlayer.data.isWallGrab) { ((Damagable)damagedPlayer.data.healthHandler).CallTakeDamage(Vector2.up * (float)(Math.Pow(Crahdow.DMG_BOOST, CardAmount) - 1.0) * ((Vector2)(ref damage)).magnitude, Vector2.op_Implicit(((Component)damagedPlayer.data).transform.position), (GameObject)null, player, true); } } } } public class FistooshEffect : HitEffect, ISingletonEffect { public Player player; public int CardAmount { get; set; } = 0; public void Start() { player = ((Component)this).gameObject.GetComponentInParent<Player>(); } public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer) { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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) if (player.data.view.IsMine) { float num = 0.3f; HunkerEffect component = ((Component)damagedPlayer).gameObject.GetComponent<HunkerEffect>(); if ((Object)(object)component != (Object)null) { num *= 2f; } Block block = damagedPlayer.data.block; if (!block.IsBlocking() && !(block.sinceBlock < num) && (damagedPlayer.data.isGrounded || damagedPlayer.data.isWallGrab)) { ((Damagable)damagedPlayer.data.healthHandler).CallTakeDamage(Vector2.up * (float)(Math.Pow(Fistoosh.DMG_BOOST, CardAmount) - 1.0) * ((Vector2)(ref damage)).magnitude, Vector2.op_Implicit(((Component)damagedPlayer.data).transform.position), (GameObject)null, player, true); } } } } public class LoyaltyGunEffect : HitEffect, ISingletonEffect { public int CardAmount { get; set; } = 0; public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer) { LoyaltyGunEffectEnemy orAddComponent = ExtensionMethods.GetOrAddComponent<LoyaltyGunEffectEnemy>(((Component)damagedPlayer).gameObject, false); orAddComponent.counterValue = 2f * (float)CardAmount; SoundManager.Instance.Play(damagedPlayer.data.playerSounds.soundCharacterDamageScreenEdge, ((Component)damagedPlayer).transform); } } public class LoyaltyGunEffectEnemy : CounterReversibleEffect { public float counterValue = 0f; public override CounterStatus UpdateCounter() { //IL_0035: 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_0038: Unknown result type (might be due to invalid IL or missing references) counterValue -= TimeHandler.deltaTime; if (counterValue > 0f) { return (CounterStatus)0; } counterValue = 0f; return (CounterStatus)2; } public override void UpdateEffects() { ((ReversibleEffect)this).characterStatModifiersModifier.movementSpeed_mult = -1f; } public override void OnApply() { } public override void Reset() { } public override void OnStart() { PlayerManager.instance.AddPlayerDiedAction((Action<Player, int>)PlayerDied); } public override void OnOnDestroy() { PlayerManager.instance.RemovePlayerDiedAction(PlayerDied); } private void PlayerDied(Player p, int idk) { if ((Object)(object)p == (Object)(object)((ReversibleEffect)this).player) { counterValue = 0f; ((ReversibleEffect)this).ClearModifiers(true); } } } public class QuantumForceBlastEffect : WasHitEffect, ISingletonEffect { public Player Owner; public int CardAmount { get; set; } = 0; public override void WasDealtDamage(Vector2 damage, bool selfDamage) { SoundManager.Instance.Play(Owner.data.playerSounds.soundCharacterDamageScreenEdge, ((Component)this).transform); } } public class RadarJammerEffect : HitEffect, ISingletonEffect { public int CardAmount { get; set; } = 0; public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer) { RadarJammerEffectEnemy orAddComponent = ExtensionMethods.GetOrAddComponent<RadarJammerEffectEnemy>(((Component)damagedPlayer).gameObject, false); orAddComponent.counterValue = 4f * (float)CardAmount; orAddComponent.spread_add = RadarJammer.BULLET_SPREAD * (float)CardAmount; SoundManager.Instance.Play(damagedPlayer.data.playerSounds.soundCharacterDamageScreenEdge, ((Component)damagedPlayer).transform); } } public class RadarJammerEffectEnemy : CounterReversibleEffect { public float counterValue = 0f; public float spread_add = RadarJammer.BULLET_SPREAD; public override CounterStatus UpdateCounter() { //IL_0035: 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_0038: Unknown result type (might be due to invalid IL or missing references) counterValue -= TimeHandler.deltaTime; if (counterValue > 0f) { return (CounterStatus)0; } counterValue = 0f; return (CounterStatus)2; } public override void UpdateEffects() { ((ReversibleEffect)this).gunStatModifier.spread_add = spread_add; } public override void OnApply() { } public override void Reset() { } public override void OnStart() { PlayerManager.instance.AddPlayerDiedAction((Action<Player, int>)PlayerDied); } public override void OnOnDestroy() { PlayerManager.instance.RemovePlayerDiedAction(PlayerDied); } private void PlayerDied(Player p, int idk) { if ((Object)(object)p == (Object)(object)((ReversibleEffect)this).player) { counterValue = 0f; ((ReversibleEffect)this).ClearModifiers(true); } } } public class RecyclerEffect : HitEffect, ISingletonEffect { public Player Owner; public int CardAmount { get; set; } = 0; public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer) { if (!((Object)(object)this == (Object)null || selfDamage) && damagedPlayer.Gun().GunAmmo().CurrentAmmo() > 0) { int add = -damagedPlayer.Gun().GunAmmo().CurrentAmmoAdd(-Recycler.AMMO_STEAL * CardAmount); damagedPlayer.Gun().UpdateAmmo(); Owner.Gun().GunAmmo().CurrentAmmoAdd(add); Owner.Gun().UpdateAmmo(); } } } } namespace Supcom2Cards.MonoBehaviours { public class AfterburnEffect : CounterReversibleEffect, ISingletonEffect { public float counterValue = 0f; public int CardAmount { get; set; } = 0; public override CounterStatus UpdateCounter() { //IL_0035: 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_0038: Unknown result type (might be due to invalid IL or missing references) counterValue -= TimeHandler.deltaTime; if (counterValue > 0f) { return (CounterStatus)0; } counterValue = 0f; return (CounterStatus)2; } public override void UpdateEffects() { ((ReversibleEffect)this).characterStatModifiersModifier.movementSpeed_mult = 2f; } public override void OnApply() { } public override void Reset() { } public override void OnStart() { Block block = ((ReversibleEffect)this).block; block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, new Action<BlockTriggerType>(OnBlock)); PlayerManager.instance.AddPlayerDiedAction((Action<Player, int>)PlayerDied); } public override void OnOnDestroy() { Block block = ((ReversibleEffect)this).block; block.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(block.BlockAction, new Action<BlockTriggerType>(OnBlock)); PlayerManager.instance.RemovePlayerDiedAction(PlayerDied); } private void OnBlock(BlockTriggerType trigger) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Invalid comparison between Unknown and I4 //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 if ((int)trigger == 0 || (int)trigger == 3 || (int)trigger == 2) { counterValue += 2f * (float)CardAmount; SoundManager.Instance.Play(((ReversibleEffect)this).player.data.block.soundBlockStatusEffect, ((Component)((ReversibleEffect)this).block).transform); } } private void PlayerDied(Player p, int idk) { if ((Object)(object)p == (Object)(object)((ReversibleEffect)this).player) { counterValue = 0f; ((ReversibleEffect)this).ClearModifiers(true); } } } public class BombBouncerEffect : MonoBehaviour, ISingletonEffect { private float _charge = 0f; public ObjectsToSpawn? Explosion; public Explosion ExplosionData; public Player player; public Block block; private CustomHealthBar chargeBar; public static SoundEvent sound; public int CardAmount { get; set; } public float Charge { get { return _charge; } set { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) _charge = value; if (_charge >= ChargeMax) { _charge = ChargeMax; } chargeBar.SetColor((_charge < ChargeMax) ? BombBouncer.COLOR_UNCHARGED : BombBouncer.COLOR_CHARGED); } } public float ChargeMax => player.data.maxHealth * (float)CardAmount * 1f; public void Start() { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: 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) player = ((Component)this).gameObject.GetComponentInParent<Player>(); block = ((Component)player).GetComponent<Block>(); Block obj = block; obj.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(obj.BlockAction, new Action<BlockTriggerType>(OnBlock)); CharacterStatModifiers stats = player.data.stats; stats.WasDealtDamageAction = (Action<Vector2, bool>)Delegate.Combine(stats.WasDealtDamageAction, new Action<Vector2, bool>(OnDamage)); PlayerManager.instance.AddPlayerDiedAction((Action<Player, int>)PlayerDied); Transform transform = ((Component)((Component)player).GetComponentInChildren<PlayerWobblePosition>()).transform; GameObject val = new GameObject("Bomb Bouncer Charge Bar"); val.transform.SetParent(transform); chargeBar = val.AddComponent<CustomHealthBar>(); ((Component)chargeBar).transform.localPosition = Vector3.up * 0.25f; ((Component)chargeBar).transform.localScale = Vector3.one; chargeBar.SetColor(BombBouncer.COLOR_UNCHARGED); } public void Update() { if (!player.data.dead) { chargeBar.SetValues(Charge, ChargeMax); } } private void OnBlock(BlockTriggerType trigger) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) if (!(Charge <= 0f) && Explosion != null) { Explosion.effect.GetComponent<Explosion>().damage = Charge; Charge = 0f; GameObject val = Object.Instantiate<GameObject>(Explosion.effect, ((Component)player.data).transform.position, Quaternion.identity); Transform transform = val.transform; transform.localScale *= 2f * (0.25f * (float)CardAmount + 0.75f); Object.Destroy((Object)(object)val, 2f); } } private void OnDamage(Vector2 damage, bool selfDamage) { Charge += ((Vector2)(ref damage)).magnitude * 1f; } public void OnDestroy() { Block obj = block; obj.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(obj.BlockAction, new Action<BlockTriggerType>(OnBlock)); CharacterStatModifiers stats = player.data.stats; stats.WasDealtDamageAction = (Action<Vector2, bool>)Delegate.Remove(stats.WasDealtDamageAction, new Action<Vector2, bool>(OnDamage)); PlayerManager.instance.RemovePlayerDiedAction(PlayerDied); } private void PlayerDied(Player p, int idk) { if ((Object)(object)p == (Object)(object)player) { Charge = 0f; } } } public class ChromeShieldEffect : MonoBehaviour, ISingletonEffect { public Player player; public Block block; public int CardAmount { get; set; } = 0; public void Start() { player = ((Component)this).gameObject.GetComponentInParent<Player>(); block = ((Component)player).GetComponent<Block>(); CharacterStatModifiers stats = player.data.stats; stats.WasDealtDamageAction = (Action<Vector2, bool>)Delegate.Combine(stats.WasDealtDamageAction, new Action<Vector2, bool>(OnDamage)); } public void OnDestroy() { CharacterStatModifiers stats = player.data.stats; stats.WasDealtDamageAction = (Action<Vector2, bool>)Delegate.Remove(stats.WasDealtDamageAction, new Action<Vector2, bool>(OnDamage)); } private void OnDamage(Vector2 damage, bool selfDamage) { if (!block.IsOnCD() && player.data.silenceTime < 0.01f && HalfBakedEffect.TryBlock(player)) { CharacterData data = player.data; data.health += ((Vector2)(ref damage)).magnitude; QuantumSpongeEffect component = ((Component)player).gameObject.GetComponent<QuantumSpongeEffect>(); if ((Object)(object)component != (Object)null) { component.ChromeShielded = true; } block.TryBlock(); blocked(); } } private void blocked() { SoundManager.Instance.Play(block.soundBlockBlocked, ((Component)block).transform); } } public class CybranasaurusEffect : MonoBehaviour, ISingletonEffect { public Player player; private static readonly float divisor = 0.30769232f; private static SoundEvent sound; public float yMax = -1000f; private List<Laser> lasers = new List<Laser>(5); private Polygon p = new Polygon(); private readonly float JUMP_MAX_INV = 1f / 15f; private float spin = 0f; public int CardAmount { get; set; } public void FixedUpdate() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) if (CardAmount < 1) { return; } lasers.ForEach(delegate(Laser l) { l.DrawHidden(); }); if (!player.Simulated()) { yMax = -1000f; return; } float y = ((Component)player).transform.position.y; yMax = ((y > yMax) ? y : yMax); spin += TimeHandler.fixedDeltaTime * 200f; if (spin > 60f) { spin -= 60f; } Draw(); } private void Draw() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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) float num = yMax - ((Component)player).transform.position.y; num = Mathf.Clamp(num, 0f, 15f); if (!(num < 4f)) { Color color = Color.yellow; if (num > 14.25f) { color = Color.red; } lasers.ForEach(delegate(Laser l) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) l.Color = color; }); float num2 = num * JUMP_MAX_INV; p.Size = num2 * 4f; float num3 = spin * (MathF.PI / 30f); p.Draw(((Component)player).transform.position.x, ((Component)player).transform.position.y, lasers, num2 * num3); } } public void Start() { player = ((Component)this).gameObject.GetComponentInParent<Player>(); PlayerJump jump = player.data.jump; jump.JumpAction = (Action)Delegate.Combine(jump.JumpAction, new Action(OnJump)); CharacterData data = player.data; data.TouchGroundAction = (Action<float, Vector3, Vector3, Transform>)Delegate.Combine(data.TouchGroundAction, new Action<float, Vector3, Vector3, Transform>(OnTouchGround)); CharacterData data2 = player.data; data2.TouchWallAction = (Action<float, Vector3, Vector3>)Delegate.Combine(data2.TouchWallAction, new Action<float, Vector3, Vector3>(OnTouchWall)); PlayerManager.instance.AddPlayerDiedAction((Action<Player, int>)PlayerDied); sound = player.data.playerSounds.soundCharacterLandBig; lasers.SetListCount(5); lasers.ForEach(delegate(Laser l) { l.Width = 0.3f; }); p.Edges = 5; } public void OnJump() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) yMax = ((Component)player).transform.position.y; } public void OnTouchGround(float sinceGrounded, Vector3 pos, Vector3 groundNormal, Transform groundTransform) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) Damage(); yMax = ((Component)player).transform.position.y; } public void OnTouchWall(float sinceWallGrab, Vector3 pos, Vector3 normal) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) Damage(); yMax = ((Component)player).transform.position.y; } private void Damage() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) float num = yMax - ((Component)player).transform.position.y; num = Mathf.Clamp(num, 0f, 15f); if (num < 4f) { return; } Explode(); float num2 = num * JUMP_MAX_INV; float num3 = player.data.health * 1f * num2; if (!player.data.view.IsMine) { return; } IEnumerable<Player> enumerable = PlayerManager.instance.players.Where((Player enemy) => !enemy.data.dead && enemy.teamID != player.teamID && enemy.Simulated()); foreach (Player item in enumerable) { float num4 = Vector3.Distance(((Component)player).transform.position, ((Component)item).transform.position); if (!(num4 > 5.25f)) { if (num4 > 2f) { num3 *= 1f - Mathf.Pow((num4 - 2f) * divisor, 2f); } ((Damagable)item.data.healthHandler).CallTakeDamage(Vector2.up * num3, Vector2.op_Implicit(((Component)item.data).transform.position), (GameObject)null, player, true); } } } private void Explode() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) GameObject val = (GameObject)Resources.Load("0 cards/Explosive bullet"); GameObject val2 = Object.Instantiate<GameObject>(val.GetComponent<Gun>().objectsToSpawn[0].effect); ((Object)val2).name = "cybranasaurusExplosion"; val2.transform.position = ((Component)player).transform.position; } public void OnDestroy() { CharacterData data = player.data; data.TouchGroundAction = (Action<float, Vector3, Vector3, Transform>)Delegate.Remove(data.TouchGroundAction, new Action<float, Vector3, Vector3, Transform>(OnTouchGround)); CharacterData data2 = player.data; data2.TouchWallAction = (Action<float, Vector3, Vector3>)Delegate.Remove(data2.TouchWallAction, new Action<float, Vector3, Vector3>(OnTouchWall)); PlayerManager.instance.RemovePlayerDiedAction(PlayerDied); } private void PlayerDied(Player p, int idk) { if ((Object)(object)p == (Object)(object)player) { lasers.ForEach(delegate(Laser l) { l.DrawHidden(); }); } } } public class DarkenoidEffect : MonoBehaviour, ISingletonEffect { private int _cardAmount = 0; public Player player; public Gun gun; public static SoundEvent sound; private IEnumerable<Player> enemies; private readonly float beamDmg = 40f; private readonly List<Laser> lasers = new List<Laser>(5); private int layerMask = LayerMask.GetMask(new string[2] { "Default", "IgnorePlayer" }); private Dictionary<Player, float> playersDMG = new Dictionary<Player, float>(); public int CardAmount { get { return _cardAmount; } set { _cardAmount = value; int count = 5 * _cardAmount; lasers.SetListCount(count); lasers.ForEach(delegate(Laser l) { l.Width = 0.15f; }); lasers.SetTeamColor(((Component)this).gameObject, 2.5f); } } public void Start() { player = ((Component)this).gameObject.GetComponentInParent<Player>(); gun = player.Gun(); sound = player.data.playerSounds.soundCharacterJumpEnsnare; PlayerManager.instance.AddPlayerDiedAction((Action<Player, int>)PlayerDied); enemies = PlayerManager.instance.players.Where((Player p) => !p.data.dead && p.teamID != player.teamID); } public void OnDestroy() { PlayerManager.instance.RemovePlayerDiedAction(PlayerDied); } public void FixedUpdate() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) if (CardAmount < 1) { return; } lasers.ForEach(delegate(Laser l) { l.DrawHidden(); }); playersDMG.Clear(); if (player.Simulated()) { float x = ((Component)player).transform.position.x; float y = ((Component)player).transform.position.y; float num = x - (float)(lasers.Count - 1) * 0.075f; for (int i = 0; i < lasers.Count; i++) { float num2 = num + (float)i * 0.075f * 2f; RaycastHit2D val = Physics2D.Raycast(new Vector2(num2, y), Vector2.down, 1000f, layerMask); float num3 = (((Object)(object)((RaycastHit2D)(ref val)).collider == (Object)null) ? (-1000f) : ((RaycastHit2D)(ref val)).point.y); lasers[i].Draw(num2, y, num2, num3); CalculateDamage(num2, y, num3, beamDmg * TimeHandler.fixedDeltaTime * gun.damage); } FinalizeDamage(player); } } private void CalculateDamage(float bX, float pY, float hitY, float dmg) { //IL_0048: 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) foreach (Player enemy in enemies) { if (enemy.data.dead) { continue; } float num = bX - 1f; float num2 = bX + 1f; float x = ((Component)enemy).transform.position.x; float y = ((Component)enemy).transform.position.y; if (x < num || x > num2 || y > pY || y < hitY) { continue; } if (player.data.view.IsMine) { if (!playersDMG.ContainsKey(enemy)) { playersDMG.Add(enemy, dmg); } else { playersDMG[enemy] = dmg; } } SoundManager.Instance.Play(sound, ((Component)enemy).transform); } } private void FinalizeDamage(Player damagingPlayer) { //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_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 (!player.data.view.IsMine) { return; } foreach (KeyValuePair<Player, float> item in playersDMG) { Player key = item.Key; float value = item.Value; if (value > 0f) { ((Damagable)key.data.healthHandler).CallTakeDamage(value * Vector2.up, Vector2.op_Implicit(((Component)key.data).transform.position), (GameObject)null, damagingPlayer, true); } } } private void PlayerDied(Player p, int idk) { if ((Object)(object)p == (Object)(object)player) { lasers.ForEach(delegate(Laser l) { l.DrawHidden(); }); } } } public class DynamicPowerShuntEffect : MonoBehaviour, ISingletonEffect { private int _cardAmount = 0; public Player player; public Block block; private bool standingStill = false; private float counterMult; private Vector3 lastPosition = new Vector3(0f, 0f, 0f); private float delay = 0.1f; public int CardAmount { get { return _cardAmount; } set { _cardAmount = value; double num = 1.0 / Math.Pow(0.25, _cardAmount); counterMult = (float)num; } } public void FixedUpdate() { if (standingStill) { delay -= Time.fixedDeltaTime; if (delay <= 0f) { Block obj = block; obj.counter += Time.fixedDeltaTime * (counterMult - 1f); } } else { delay = 0.1f; } standingStill = player.StandingStill(ref lastPosition); } public void Start() { player = ((Component)this).gameObject.GetComponentInParent<Player>(); block = ((Component)player).GetComponent<Block>(); } } public class HalfBakedEffect : MonoBehaviour, ISingletonEffect { public Player player; public Block block; private uint chance = 1073741824u; private GeneralInput input; public int CardAmount { get; set; } = 0; public void Start() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown player = ((Component)this).gameObject.GetComponentInParent<Player>(); block = ((Component)player).GetComponent<Block>(); input = (GeneralInput)ExtensionMethods.GetFieldValue((object)block, "input"); } public void Update() { if (input.shieldWasPressed && !input.silencedInput && CanBlock()) { TryBlock(player); } } public static bool TryBlock(Player player) { HalfBakedEffect component = ((Component)player).GetComponent<HalfBakedEffect>(); if ((Object)(object)component == (Object)null) { return true; } if (RNG.NextUInt() < component.chance) { component.FailBlock(); return false; } return true; } private void FailBlock() { CharacterData data = player.data; data.silenceTime += 2f * (float)CardAmount; Block obj = block; obj.sinceBlock += 0.6f; block.counter = 0f; SoundManager.Instance.Play(player.data.playerSounds.soundCharacterDamageScreenEdge, ((Component)player).transform); } private bool CanBlock() { return block.counter < 0.01f || !block.IsOnCD(); } } public class HardenEffect : CounterReversibleEffect, ISingletonEffect { public float counterValue = 0f; public int CardAmount { get; set; } = 0; public override CounterStatus UpdateCounter() { //IL_0035: 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_0038: Unknown result type (might be due to invalid IL or missing references) counterValue -= TimeHandler.deltaTime; if (counterValue > 0f) { return (CounterStatus)0; } counterValue = 0f; return (CounterStatus)2; } public override void UpdateEffects() { ((ReversibleEffect)this).gunStatModifier.attackSpeed_mult = 0.3333f; ((ReversibleEffect)this).gunStatModifier.projectileSpeed_mult = 2f; } public override void OnApply() { } public override void Reset() { } public override void OnStart() { Block block = ((ReversibleEffect)this).block; block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, new Action<BlockTriggerType>(OnBlock)); PlayerManager.instance.AddPlayerDiedAction((Action<Player, int>)PlayerDied); } public override void OnOnDestroy() { Block block = ((ReversibleEffect)this).block; block.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(block.BlockAction, new Action<BlockTriggerType>(OnBlock)); PlayerManager.instance.RemovePlayerDiedAction(PlayerDied); } private void OnBlock(BlockTriggerType trigger) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Invalid comparison between Unknown and I4 //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 if ((int)trigger == 0 || (int)trigger == 3 || (int)trigger == 2) { counterValue += 2.5f * (float)CardAmount; SoundManager.Instance.Play(((ReversibleEffect)this).player.data.block.soundBlockStatusEffect, ((Component)((ReversibleEffect)this).block).transform); } } private void PlayerDied(Player p, int idk) { if ((Object)(object)p == (Object)(object)((ReversibleEffect)this).player) { counterValue = 0f; ((ReversibleEffect)this).ClearModifiers(true); } } } public class HunkerEffect : CounterReversibleEffect, ISingletonEffect { private bool modifiersActive = false; public int CardAmount { get; set; } = 0; public override void OnUpdate() { Block block = ((ReversibleEffect)this).block; block.sinceBlock -= TimeHandler.deltaTime; Block block2 = ((ReversibleEffect)this).block; block2.sinceBlock += TimeHandler.deltaTime / 2f / (float)CardAmount; ((CounterReversibleEffect)this).OnUpdate(); } public override CounterStatus UpdateCounter() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (!modifiersActive && ((ReversibleEffect)this).block.IsBlocking()) { return (CounterStatus)0; } if (!((ReversibleEffect)this).block.IsBlocking()) { ((CounterReversibleEffect)this).Reset(); return (CounterStatus)2; } return (CounterStatus)1; } public override void UpdateEffects() { ((ReversibleEffect)this).characterStatModifiersModifier.movementSpeed_mult = 0.25f; } public override void OnApply() { modifiersActive = true; } public override void OnRemove() { modifiersActive = false; } public override void Reset() { modifiersActive = false; } public override void OnStart() { ((ReversibleEffect)this).applyImmediately = false; } } public class JackhammerEffect : CounterReversibleEffect, ISingletonEffect { private bool modifiersActive = false; private bool standingStill = false; private Vector3 lastPosition = new Vector3(0f, 0f, 0f); private float delay = 0.1f; public int CardAmount { get; set; } = 0; public override CounterStatus UpdateCounter() { //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) if (!Supcom2.PickPhase && !modifiersActive && standingStill) { delay -= Time.deltaTime; if (delay < 0f) { SoundManager.Instance.Play(((ReversibleEffect)this).player.data.playerSounds.soundCharacterLandBig, ((Component)((ReversibleEffect)this).player).transform); SoundManager.Instance.Play(((ReversibleEffect)this).player.data.healthHandler.soundDamagePassive, ((Component)((ReversibleEffect)this).player).transform); return (CounterStatus)0; } } else if (modifiersActive && (Supcom2.PickPhase || !standingStill)) { delay = 0.1f; return (CounterStatus)2; } return (CounterStatus)1; } public override void UpdateEffects() { ((ReversibleEffect)this).gunStatModifier.damage_mult = 3f; ((ReversibleEffect)this).characterDataModifier.maxHealth_mult = 3f; } public override void OnApply() { modifiersActive = true; } public override void OnRemove() { modifiersActive = false; } public override void Reset() { modifiersActive = false; } public override void OnStart() { } public override void OnFixedUpdate() { standingStill = ((ReversibleEffect)this).player.StandingStill(ref lastPosition); } } public class JumpJetsEffect : InAirJumpEffect, ISingletonEffect { private int _cardAmount = 0; private CustomHealthBar fuelBar; private GeneralInput input; public int CardAmount { get { return _cardAmount; } set { _cardAmount = value; ((InAirJumpEffect)this).AddJumps(10f); } } private float jumps => (float)ExtensionMethods.GetFieldValue((object)this, "jumps"); private float currentJumps { get { return (float)ExtensionMethods.GetFieldValue((object)this, "currentjumps"); } set { ExtensionMethods.SetFieldValue((object)this, "currentjumps", (object)value); } } public override void OnStart() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) ((InAirJumpEffect)this).OnStart(); ((InAirJumpEffect)this).SetJumpMult(0.25f); ((InAirJumpEffect)this).SetContinuousTrigger(true); ((InAirJumpEffect)this).SetResetOnWallGrab(true); ((InAirJumpEffect)this).SetCostPerJump(1f); ((InAirJumpEffect)this).SetInterval(0.025f); Transform transform = ((Component)((Component)((ReversibleEffect)this).player).GetComponentInChildren<PlayerWobblePosition>()).transform; GameObject val = new GameObject("JumpJets Fuel Bar"); val.transform.SetParent(transform); fuelBar = val.AddComponent<CustomHealthBar>(); ((Component)fuelBar).transform.localPosition = Vector3.down * 0.25f; ((Component)fuelBar).transform.localScale = Vector3.one; fuelBar.SetColor(Color.gray); input = ((Component)((ReversibleEffect)this).player).GetComponent<GeneralInput>(); Refuel(); } public override void OnUpdate() { ((InAirJumpEffect)this).OnUpdate(); if (!((ReversibleEffect)this).player.data.dead) { fuelBar.SetValues(currentJumps - 1f, jumps - 1f); } if (input.jumpIsPressed && !((ReversibleEffect)this).player.data.isGrounded && !((ReversibleEffect)this).player.data.isWallGrab && currentJumps > 0f) { SoundManager.Instance.Play(((ReversibleEffect)this).player.data.healthHandler.soundDamagePassive, ((Component)((ReversibleEffect)this).player).transform); } } public override void OnOnDestroy() { ((InAirJumpEffect)this).OnOnDestroy(); Object.Destroy((Object)(object)((Component)fuelBar).gameObject); } public void Refuel() { currentJumps = jumps; } } public class MagnetronEffect : MonoBehaviour, ISingletonEffect { public Player player; public Block block; private bool active = false; private float currentForce = 0f; private float timeStarted = 0f; private Player[] enemies; public int CardAmount { get; set; } = 0; public void Activate(float force) { currentForce = force; if (!active) { enemies = PlayerManager.instance.players.Where((Player p) => p.teamID != player.teamID).ToArray(); timeStarted = Time.time; active = true; } } public void FixedUpdate() { if (CardAmount >= 1 && player.Simulated()) { if (active && Time.time - timeStarted > 3f * (float)CardAmount) { active = false; } if (active) { Damage(); } } } private void Damage() { //IL_003d: 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_00aa: 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_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_00c8: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0111: 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) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) if (!player.data.view.IsMine) { return; } Player[] array = enemies; Vector2 val4 = default(Vector2); foreach (Player val in array) { Vector3 val2 = ((Component)val).transform.position - ((Component)player).transform.position; float magnitude = ((Vector3)(ref val2)).magnitude; ((Vector3)(ref val2)).Normalize(); float num = magnitude * magnitude; if (num < 20f) { num = 20f; } if (num > float.MaxValue) { num = float.MaxValue; } Vector3 val3 = currentForce / num * val2 * TimeHandler.fixedDeltaTime; val.data.healthHandler.CallTakeForce(new Vector2(val3.x, 0.1f * val3.y), (ForceMode2D)1, true, false, 0f); ((Vector2)(ref val4))..ctor(((Component)player).transform.position.x, ((Component)player).transform.position.y); if (magnitude <= 3f && PlayerManager.instance.CanSeePlayer(val4, val).canSee) { ((Damagable)val.data.healthHandler).CallTakeDamage(Vector2.up * 150f * (float)CardAmount * TimeHandler.fixedDeltaTime, Vector2.op_Implicit(((Component)val.data).transform.position), (GameObject)null, (Player)null, true); player.data.healthHandler.Heal(200f * (float)CardAmount * TimeHandler.fixedDeltaTime); } } } public void Start() { player = ((Component)this).gameObject.GetComponentInParent<Player>(); block = ((Component)player).GetComponent<Block>(); Block obj = block; obj.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(obj.BlockAction, new Action<BlockTriggerType>(OnBlock)); } public void OnDestroy() { Block obj = block; obj.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(obj.BlockAction, new Action<BlockTriggerType>(OnBlock)); } private void OnBlock(BlockTriggerType trigger) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Invalid comparison between Unknown and I4 //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 if ((int)trigger == 0 || (int)trigger == 3 || (int)trigger == 2) { Activate((player.data.aimDirection.y > 0f) ? 750000f : (-500000f)); } } } public class MegalithEffect : MonoBehaviour, ISingletonEffect { private int _cardAmount = 0; public Player player; public Block block; private readonly List<Laser> lasers = new List<Laser>(2); public int CardAmount { get { return _cardAmount; } set { //IL_0035: Unknown result type (might be due to invalid IL or missing references) _cardAmount = value; lasers.SetListCount(2 * _cardAmount); foreach (Laser laser in lasers) { laser.Color = Color.red; laser.Width = 0.1f; } } } public void FixedUpdate() { //IL_011c: 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_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) if (CardAmount < 1) { return; } lasers.ForEach(delegate(Laser l) { l.DrawHidden(); }); if (!player.Simulated()) { return; } Player[] array = (from enemy in player.VisibleEnemies() orderby Vector3.Distance(((Component)enemy).transform.position, ((Component)player).transform.position) select enemy).ToArray(); int num = array.Length; if (num < 1) { return; } int num2 = 2 * _cardAmount / num; int num3 = 2 * _cardAmount % num; bool isMine = player.data.view.IsMine; for (int i = 0; i < lasers.Count && i < num; i++) { int num4 = num2 + ((i < num3) ? 1 : 0); lasers[i].Width = 0.1f * (float)num4; lasers[i].Draw(((Component)player).transform.position, ((Component)array[i]).transform.position); if (isMine) { float num5 = 5f + 0.05f * array[i].data.maxHealth * (float)num4; ((Damagable)array[i].data.healthHandler).CallTakeDamage(Vector2.up * num5 * TimeHandler.fixedDeltaTime, Vector2.op_Implicit(((Component)array[i].data).transform.position), (GameObject)null, player, true); } } } public void Start() { player = ((Component)this).gameObject.GetComponentInParent<Player>(); block = ((Component)player).GetComponent<Block>(); PlayerManager.instance.AddPlayerDiedAction((Action<Player, int>)PlayerDied); } public void OnDestroy() { PlayerManager.instance.RemovePlayerDiedAction(PlayerDied); } private void PlayerDied(Player p, int idk) { if ((Object)(object)p == (Object)(object)player) { lasers.ForEach(delegate(Laser r) { r.DrawHidden(); }); } } } public class OverchargeEffect : CounterReversibleEffect, ISingletonEffect { public float counterValue = 0f; private readonly ObjectsToSpawn?[] explosionToSpawn = (ObjectsToSpawn?[])(object)new ObjectsToSpawn[1]; public int CardAmount { get; set; } = 0; public override CounterStatus UpdateCounter() { //IL_003c: 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_003f: Unknown result type (might be due to invalid IL or missing references) counterValue -= TimeHandler.deltaTime; if (counterValue > 0f) { return (CounterStatus)0; } counterValue = 0f; ((CounterReversibleEffect)this).Reset(); return (CounterStatus)2; } public override void UpdateEffects() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown ((ReversibleEffect)this).gunStatModifier.damage_mult = 1.5f; ((ReversibleEffect)this).gunStatModifier.attackSpeed_mult = 0.5f; ((ReversibleEffect)this).gunStatModifier.projectileSize_add = 2f; if (explosionToSpawn[0] == null) { var (addToProjectile, effect, val) = Supcom2.LoadExplosion("explosionOvercharge"); explosionToSpawn[0] = new ObjectsToSpawn { AddToProjectile = addToProjectile, direction = (Direction)0, effect = effect, normalOffset = 0.1f, scaleFromDamage = 0.5f, scaleStackM = 0.7f, scaleStacks = true, spawnAsChild = false, spawnOn = (SpawnOn)0, stacks = 0, stickToAllTargets = false, stickToBigTargets = false, zeroZ = false }; ((ReversibleEffect)this).gun.objectsToSpawn = ((ReversibleEffect)this).gun.objectsToSpawn.Concat<ObjectsToSpawn>(explosionToSpawn).ToArray(); } } public override void OnApply() { } public override void Reset() { if (explosionToSpawn[0] != null) { ((ReversibleEffect)this).gun.objectsToSpawn = ((ReversibleEffect)this).gun.objectsToSpawn.Except<ObjectsToSpawn>(explosionToSpawn).ToArray(); explosionToSpawn[0] = null; } } public override void OnStart() { Block block = ((ReversibleEffect)this).block; block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, new Action<BlockTriggerType>(OnBlock)); PlayerManager.instance.AddPlayerDiedAction((Action<Player, int>)PlayerDied); } public override void OnOnDestroy() { Block block = ((ReversibleEffect)this).block; block.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(block.BlockAction, new Action<BlockTriggerType>(OnBlock)); PlayerManager.instance.RemovePlayerDiedAction(PlayerDied); } private void OnBlock(BlockTriggerType trigger) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Invalid comparison between Unknown and I4 //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 if ((int)trigger == 0 || (int)trigger == 3 || (int)trigger == 2) { counterValue += 2.5f * (float)CardAmount; SoundManager.Instance.Play(((ReversibleEffect)this).player.data.block.soundBlockStatusEffect, ((Component)((ReversibleEffect)this).block).transform); } } private void PlayerDied(Player p, int idk) { if ((Object)(object)p == (Object)(object)((ReversibleEffect)this).player) { counterValue = 0f; ((ReversibleEffect)this).ClearModifiers(true); ((CounterReversibleEffect)this).Reset(); } } } public class QuantumSpongeEffect : MonoBehaviour, ISingletonEffect { public bool ChromeShielded = false; public Player player; public Block block; public int CardAmount { get; set; } = 0; private void Recharge() { if (ChromeShielded) { ChromeShielded = false; } else if (block.IsOnCD() && block.counter < 0.5f * block.Cooldown()) { block.counter = 0.5f * block.Cooldown(); } } public void Start() { player = ((Component)this).gameObject.GetComponentInParent<Player>(); block = ((Component)player).GetComponent<Block>(); CharacterStatModifiers stats = player.data.stats; stats.WasDealtDamageAction = (Action<Vector2, bool>)Delegate.Combine(stats.WasDealtDamageAction, new Action<Vector2, bool>(OnDamage)); } public void OnDestroy() { CharacterStatModifiers stats = player.data.stats; stats.WasDealtDamageAction = (Action<Vector2, bool>)Delegate.Remove(stats.WasDealtDamageAction, new Action<Vector2, bool>(OnDamage)); } private void OnDamage(Vector2 damage, bool selfDamage) { ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)Supcom2.Instance, 1, (Action)Recharge); } } public class RogueNanitesEffect : MonoBehaviour, ISingletonEffect { public Player player; public Block block; public int CardAmount { get; set; } = 0; public void Start() { player = ((Component)this).gameObject.GetComponentInParent<Player>(); block = ((Component)player).GetComponent<Block>(); Block obj = block; obj.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(obj.BlockAction, new Action<BlockTriggerType>(OnBlock)); } public void OnDestroy() { Block obj = block; obj.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(obj.BlockAction, new Action<BlockTriggerType>(OnBlock)); } private void OnBlock(BlockTriggerType trigger) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 if ((int)trigger == 0) { player.data.healthHandler.Heal(0.25f * player.data.maxHealth * (float)CardAmount); SoundManager.Instance.Play(player.data.block.soundBlockStatusEffect, ((Component)block).transform); } } } public class VeterancyEffect : ReversibleEffect, ISingletonEffect { public static readonly float RankIconsHeight = 2.1f; public static readonly float RankIconsWidth = 1.8f; private int _rank = 0; private static readonly float dx = RankIconsWidth / 5f; private readonly List<VeterancyRankIcon> rankIcons = new List<VeterancyRankIcon>(); private static readonly LastSourceOfDamageList lastSourcesOfDamage = new LastSourceOfDamageList(); public int CardAmount { get; set; } = 0; public int Rank { get { return _rank; } set { _rank = value; ((ReversibleEffect)this).ClearModifiers(true); base.gunStatModifier.damage_mult = GetMult(); base.characterDataModifier.maxHealth_mult = GetMult(); ((ReversibleEffect)this).ApplyModifiers(); CharacterData data = base.player.data; data.health *= GetMult(); rankIcons.SetListCount(_rank); } } public override void OnUpdate() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) if (CardAmount < 1 || !base.player.Simulated()) { return; } int count = rankIcons.Count; Vector3 position = ((Component)base.player).transform.position; float num = position.x + RankIconsWidth / 2f - VeterancyRankIcon.Size; float num2 = position.y + RankIconsHeight - 2f * VeterancyRankIcon.Size; for (int i = 0; i < count; i++) { if (i % 5 == 0) { num -= RankIconsWidth; num2 += 2f * VeterancyRankIcon.Size; } num += dx; rankIcons[i].Draw(num, num2); } } public override void OnStart() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown ((ReversibleEffect)this).SetLivesToEffect(int.MaxValue); CharacterStatModifiers.DealtDamage += new hook_DealtDamage(OnDealtDamage); PlayerManager.instance.AddPlayerDiedAction((Action<Player, int>)PlayerDied); } public override void OnOnDestroy() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown CharacterStatModifiers.DealtDamage -= new hook_DealtDamage(OnDealtDamage); PlayerManager.instance.RemovePlayerDiedAction(PlayerDied); } private void OnDealtDamage(orig_DealtDamage orig, CharacterStatModifiers self, Vector2 damage, bool selfDamage, Player damagedPlayer) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) CharacterData val = (CharacterData)ExtensionMethods.GetFieldValue((object)self, "data"); if (!selfDamage && !((Object)(object)val == (Object)null)) { lastSourcesOfDamage[damagedPlayer] = val.player; orig.Invoke(self, damage, selfDamage, damagedPlayer); } } private float GetMult() { return 1f + (float)Rank * 0.2f; } private void PlayerDied(Player p, int idk) { if ((Object)(object)p == (Object)(object)base.player) { rankIcons.ForEach(delegate(VeterancyRankIcon r) { r.DrawHidden(); }); } else if (p.teamID != base.player.teamID && Rank < 5 * CardAmount && (Object)(object)lastSourcesOfDamage[p] == (Object)(object)base.player) { Rank++; lastSourcesOfDamage[p] = null; } } } public class VeterancyRankIcon { public static Color Color = Color.yellow; public static Material Material = new Material(Shader.Find("UI/Default")); public static float Size = 0.2f; public static float Width = 0.15f; public static float Z = -5f; private readonly LineRenderer lineL; private readonly Vector3[] cordsL = (Vector3[])(object)new Vector3[2]; private readonly LineRenderer lineR; private readonly Vector3[] cordsR = (Vector3[])(object)new Vector3[2]; private static int id = 0; public VeterancyRankIcon() { //IL_0021: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) lineL = new GameObject().AddComponent<LineRenderer>(); ((Object)lineL).name = $"VeterancyIconLine_{id}L"; lineL.startWidth = Width; lineL.endWidth = Width; lineL.startColor = Color.white; lineL.endColor = Color.white; ((Renderer)lineL).material = Material; ((Renderer)lineL).material.color = Color; lineL.useWorldSpace = true; lineR = new GameObject().AddComponent<LineRenderer>(); ((Object)lineR).name = $"VeterancyIconLine_{id++}R"; lineR.startWidth = Width; lineR.endWidth = Width; lineR.startColor = Color.white; lineR.endColor = Color.white; ((Renderer)lineR).material = Material; ((Renderer)lineR).material.color = Color; lineR.useWorldSpace = true; cordsL[0].z = Z; cordsL[1].z = Z; cordsR[0].z = Z; cordsR[1].z = Z; } ~VeterancyRankIcon() { Object.Destroy((Object)(object)lineL); Object.Destroy((Object)(object)lineR); } public void Draw(float x, float y) { cordsL[0].x = x - Size; cordsL[0].y = y + Size; cordsL[1].x = x; cordsL[1].y = y; cordsR[0].x = x + Size; cordsR[0].y = y + Size; cordsR[1].x = x; cordsR[1].y = y; lineL.SetPositions(cordsL); lineR.SetPositions(cordsR); } public void DrawHidden() { cordsL[0].x = 100f; cordsL[0].y = 100f; cordsL[1].x = 100f; cordsL[1].y = 100f; cordsR[0].x = 100f; cordsR[0].y = 100f; cordsR[1].x = 100f; cordsR[1].y = 100f; lineL.SetPositions(cordsL); lineR.SetPositions(cordsR); } } public class LastSourceOfDamageList : Dictionary<Player, Player?> { public new Player? this[Player player] { get { return ContainsKey(player) ? base[player] : null; } set { if (ContainsKey(player)) { base[player] = value; } else { Add(player, value); } } } } public class WilfindjaEffect : MonoBehaviour, ISingletonEffect { private int _cardAmount = 0; public Player player; public Gun gun; private float counter = 0f; private const float DT = 0.1f; private float spin = 0f; private readonly List<Polygon> drones = new List<Polygon>(12); private readonly List<Laser> lasers = new List<Laser>(36); public int CardAmount { get { return _cardAmount; } set { _cardAmount = value; drones.SetListCount(12 * _cardAmount); drones.ForEach(delegate(Polygon d) { d.Size = 0.3f; }); lasers.SetListCount(3 * drones.Count); lasers.ForEach(delegate(Laser l) { l.Width = 0.075f; }); lasers.SetTeamColor(((Component)this).gameObject, 1.5f); } } public void Start() { player = ((Component)this).gameObject.GetComponentInParent<Player>(); gun = player.data.weaponHandler.gun; PlayerManager.instance.AddPlayerDiedAction((Action<Player, int>)PlayerDied); } public void OnDestroy() { PlayerManager.instance.RemovePlayerDiedAction(PlayerDied); } public void FixedUpdate() { if (CardAmount < 1) { return; } if (!player.Simulated()) { lasers.ForEach(delegate(Laser l) { l.DrawHidden(); }); return; } counter -= TimeHandler.fixedDeltaTime; spin += TimeHandler.fixedDeltaTime * 45f; if (spin > 60f) { spin -= 60f; } Draw(); if (player.data.view.IsMine && counter < 0f) { Damage(); counter = 0.1f; } } private void Draw() { //IL_006f: 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) float num = spin * (MathF.PI / 30f); float num2 = 0f; int num3 = 0; for (int i = 0; i < drones.Count; i++) { int num4 = i / 12; if (num4 != num3) { num2 = 0f; num3 = num4; } float layerAmplitude = GetLayerAmplitude(num4); num2 += MathF.PI / 6f; float num5 = num2 + num * ((float)num4 * 0.25f + 1f); float x = ((Component)player).transform.position.x + layerAmplitude * Mathf.Cos(num5); float y = ((Component)player).transform.position.y + layerAmplitude * Mathf.Sin(num5); drones[i].Draw(x, y, lasers.GetRange(i * 3, 3), num5 * 3f); } } private void Damage() { //IL_003d: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) IEnumerable<Player> enumerable = PlayerManager.instance.players.Where((Player p) => !p.data.dead && p.teamID != player.teamID); foreach (Player item in enumerable) { float num = Vector3.Distance(((Component)player).transform.position, ((Component)item).transform.position); for (int i = 0; i < CardAmount; i++) { float layerAmplitude = GetLayerAmplitude(i); float num2 = layerAmplitude - 2.25f; float num3 = layerAmplitude + 2.25f; if (num > num2 && num < num3) { float num4 = 55f * gun.damage; ((Damagable)item.data.healthHandler).CallTakeDamage(Vector2.up * num4 * 0.1f, Vector2.op_Implicit(((Component)item.data).transform.position), (GameObject)null, player, true); } } } } private void PlayerDied(Player p, int idk) { if ((Object)(object)p == (Object)(object)player) { lasers.ForEach(delegate(Laser l) { l.DrawHidden(); }); } } private float GetLayerAmplitude(int layer) { return 7f * ((float)layer * 0.5f + 1f); } } } namespace Supcom2Cards.Cards { internal class Afterburn : CustomCard { public const float DURATION = 2f; public const float MOVEMENTSPEED_MULT = 2f; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { block.cdAdd = 0.5f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { player.IncrementCardEffect<AfterburnEffect>(); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { player.DecrementCardEffect<AfterburnEffect>(); } protected override string GetTitle() { return "Afterburn"; } protected override string GetDescription() { return $"Blocking doubles Movement Speed for {2f} (extra) seconds"; } protected override GameObject GetCardArt() { Supcom2.CardArt.TryGetValue("Afterburn", out GameObject value); return value; } protected override Rarity GetRarity() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (Rarity)1; } protected override CardInfoStat[] GetStats() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Movement speed if active", amount = $"+{100f}%", simepleAmount = (SimpleAmount)3 }, new CardInfoStat { positive = false, stat = "Block cooldown", amount = "+0.5s", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (CardThemeColorType)2; } public override string GetModName() { return "SC2"; } } internal class BombBouncer : CustomCard { public static readonly Color COLOR_CHARGED = Color.red; public static readonly Color COLOR_UNCHARGED = Color.yellow; public const float CHARGE_MULT = 1f; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { statModifiers.health = 1.3f; block.cdAdd = 0.5f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //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_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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown BombBouncerEffect bombBouncerEffect = player.IncrementCardEffect<BombBouncerEffect>(); if (bombBouncerEffect.CardAmount == 1) { (GameObject AddToProjectile, GameObject effect, Explosion explosion) tuple = Supcom2.LoadExplosion("explosionBombBouncer"); GameObject item = tuple.AddToProjectile; GameObject item2 = tuple.effect; bombBouncerEffect.Explosion = new ObjectsToSpawn { AddToProjectile = item, direction = (Direction)0, effect = item2, normalOffset = 0.1f, scaleFromDamage = 0.5f, scaleStackM = 0.7f, scaleStacks = true, spawnAsChild = false, spawnOn = (SpawnOn)0, stacks = 0, stickToAllTargets = false, stickToBigTargets = false, zeroZ = false }; ExtensionMethods.GetOrAddComponent<SpawnedAttack>(item2, false).spawner = player; } } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { player.DecrementCardEffect<BombBouncerEffect>(); } protected override string GetTitle() { return "Bomb Bouncer"; } protected override string GetDescription() { return "Damage you take will be released\nin a big explosion next block\n"; } protected override GameObject GetCardArt() { Supcom2.CardArt.TryGetValue("BombBouncer", out GameObject value); return value; } protected override Rarity GetRarity() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (Rarity)1; } protected override CardInfoStat[] GetStats() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[3] { new CardInfoStat { positive = true, stat = "Max charge", amount = $"+{100f}%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "HP", amount = "+30%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Block cooldown", amount = "+0.5s", simepleAmount = (SimpleAmount)0 } }; } protected override CardThemeColorType GetTheme() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (CardThemeColorType)0; } public override string GetModName() { return "SC2"; } } internal class Brackman : CustomCard { private readonly ObjectsToSpawn[] explosionToSpawn = (ObjectsToSpawn[])(object)new ObjectsToSpawn[1]; public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { cardInfo.allowMultiple = false; gun.reloadTime = 0.7f; gun.damage = 0.85f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { //IL_003a: Unknown result type (might be due to invalid IL or missing refere