Decompiled source of ZenCards v0.20.0
ZenCards.dll
Decompiled 20 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using InControl; using ModdingUtils.Extensions; using ModdingUtils.MonoBehaviours; using ModdingUtils.Utils; using Photon.Pun; using UnboundLib; using UnboundLib.Cards; using UnboundLib.GameModes; using UnboundLib.Networking; using UnityEngine; using UnityEngine.UI; using ZenCards.Cards; using ZenCards.Core; using ZenCards.Effects; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("0.0.0.0")] namespace ZenCards { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.zen.rounds.zencards", "ZenCards", "0.20.0")] [BepInProcess("Rounds.exe")] public class Plugin : BaseUnityPlugin { public const string ModId = "com.zen.rounds.zencards"; public const string ModName = "ZenCards"; public const string Version = "0.20.0"; public const string ModInitials = "Zen"; internal static Plugin Instance; internal static ConfigEntry<KeyCode> BulberKey; internal static ConfigEntry<float> SoundVolume; internal static ConfigEntry<KeyCode> SusanKey; internal static ConfigEntry<KeyCode> SeraphKey; internal static ConfigEntry<KeyCode> SharknadoKey; internal static ConfigEntry<KeyCode> MjolnirKey; internal static ConfigEntry<KeyCode> PoseidonKey; private void Awake() { //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown Instance = this; BulberKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "Bulber key", (KeyCode)113, "Key that rips a boulder out of the ground (Bulber card)."); SusanKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "Susan Storm key", (KeyCode)101, "Key that places a temporary force-field platform (Susan Storm card)."); SeraphKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "Seraph key", (KeyCode)101, "Key that starts the Seraph ascension (Seraph card). Same as Susan Storm by default - change one if you have both."); SharknadoKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "Sharknado key", (KeyCode)122, "Key that summons the Sharknado (once per round)."); PoseidonKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "Poseidon key", (KeyCode)120, "Key that drops water on the closest enemy (Poseidon card)."); MjolnirKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "Mjolnir key", (KeyCode)325, "Throws Mjolnir, press again to teleport to it. Mouse2 = middle mouse / scroll-wheel click."); SoundVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Audio", "Sound volume", 0.6f, "Volume of ZenCards sound effects (Momo's monkey noises). 0 = off, 1 = full."); Harmony val = new Harmony("com.zen.rounds.zencards"); Type[] types = typeof(Plugin).Assembly.GetTypes(); foreach (Type type in types) { if (type.GetCustomAttributes(typeof(HarmonyPatch), inherit: false).Length != 0) { try { val.CreateClassProcessor(type).Patch(); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)("Harmony patch " + type.Name + " failed: " + ex.Message)); } } } } private void Start() { ZenCleanup.Register(); DeathWatch.Ensure(); DeathCards.Register(); Zombie.Register(); NecroGraves.Ensure(); AmmoGamble.Register(); GoodPickSync.Register(); CustomCard.BuildCard<SparkDroneCard>(); CustomCard.BuildCard<PhantomDaggersCard>(); CustomCard.BuildCard<CtrlZCard>(); CustomCard.BuildCard<BulberCard>(); CustomCard.BuildCard<HonkCard>(); CustomCard.BuildCard<NotTheBeesCard>(); CustomCard.BuildCard<FallingPianoCard>(); CustomCard.BuildCard<WedgieCard>(); CustomCard.BuildCard<KarenCard>(); CustomCard.BuildCard<OprahCard>(); CustomCard.BuildCard<MomoCard>(); CustomCard.BuildCard<SnackRunCard>(); CustomCard.BuildCard<HighFiveCard>(); CustomCard.BuildCard<ZombieCard>(); CustomCard.BuildCard<FuckThisCard>(); CustomCard.BuildCard<NecromancerCard>(); CustomCard.BuildCard<TurtleShellCard>(); CustomCard.BuildCard<DialUpCard>(); CustomCard.BuildCard<UfoCard>(); CustomCard.BuildCard<SusanStormCard>(); CustomCard.BuildCard<ThiccumsCard>(); CustomCard.BuildCard<AmmoGamblingCard>(); CustomCard.BuildCard<CorkscrewRoundsCard>(); CustomCard.BuildCard<OrbitRoundsCard>(); CustomCard.BuildCard<TumbleweedRoundsCard>(); CustomCard.BuildCard<RubberDuckyRoundsCard>(); CustomCard.BuildCard<SeraphCard>(); CustomCard.BuildCard<YugeBoolitCard>(); CustomCard.BuildCard<ThxForBlockCard>(); CustomCard.BuildCard<NerfGunCard>(); CustomCard.BuildCard<ClamSlamCard>(); CustomCard.BuildCard<DupeTroopCard>(); CustomCard.BuildCard<RatCard>(); CustomCard.BuildCard<HeADemonCard>(); CustomCard.BuildCard<AntiBlockbuildCard>(); CustomCard.BuildCard<SharknadoCard>(); CustomCard.BuildCard<TopUpCard>(); CustomCard.BuildCard<PanaceaCard>(); CustomCard.BuildCard<MjolnirCard>(); CustomCard.BuildCard<PoseidonCard>(); CustomCard.BuildCard<OsirisCard>(); CustomCard.BuildCard<PandorasBoxCard>(); CustomCard.BuildCard<RedrawCard>(); CustomCard.BuildCard<SplitDecisionCard>(); CustomCard.BuildCard<TripleThreatCard>(); CustomCard.BuildCard<DisplacementCard>(); CustomCard.BuildCard<SnakeShotCard>(); CustomCard.BuildCard<BullseyeCard>(); CustomCard.BuildCard<ClawMachineCard>(); CustomCard.BuildCard<GoodBoyCard>(); CustomCard.BuildCard<GoodGirlCard>(); CustomCard.BuildCard<ParaplegicCard>(); CustomCard.BuildCard<PoltergeistCard>(); CustomCard.BuildCard<BoomerangRoundsCard>(); CustomCard.BuildCard<MeatYeetCard>(); CustomCard.BuildCard<BulletHellDiaryCard>(); CustomCard.BuildCard<StalkerRoundsCard>(); CustomCard.BuildCard<PaperAirplaneCard>(); CustomCard.BuildCard<OrganDonorCard>(); CustomCard.BuildCard<NokiaCard>(); CustomCard.BuildCard<EmotionalDamageCard>(); CustomCard.BuildCard<AbsoluteUnitCard>(); CustomCard.BuildCard<GottaGoFastCard>(); } } } namespace ZenCards.Effects { public class Necromancer : BlockAbility { public const float Reach = 1.6f; public const float ReviveHealth = 0.5f; internal static readonly Color Purple = new Color(0.65f, 0.4f, 1f, 1f); internal bool used; protected override float BaseCooldown => 0f; protected override void Start() { base.Start(); ZenCleanup.OnRoundReset += ResetUse; } protected override void OnDestroy() { ZenCleanup.OnRoundReset -= ResetUse; base.OnDestroy(); } private void ResetUse() { used = false; } protected override bool OnBlockOwner() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) if (used) { return false; } Vector2 val = Vector2.op_Implicit(((Component)player).transform.position); foreach (KeyValuePair<int, Vector2> deathSpot in NecroGraves.DeathSpots) { Player val2 = ZenUtil.GetPlayer(deathSpot.Key); if (!((Object)(object)val2 == (Object)null) && val2.data.dead && val2.teamID == player.teamID && !((Object)(object)val2 == (Object)(object)player) && !(Vector2.Distance(val, deathSpot.Value) > 1.6f + ZenUtil.HitRadius(player))) { Vector2 val3 = deathSpot.Value + Vector2.up * 1f; NetworkingManager.RPC(typeof(Necromancer), "RPCA_Raise", new object[4] { player.playerID, val2.playerID, val3.x, val3.y }); return true; } } return false; } [UnboundRPC] private static void RPCA_Raise(int necroId, int deadId, float x, float y) { //IL_0040: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) Player val = ZenUtil.GetPlayer(necroId); Player val2 = ZenUtil.GetPlayer(deadId); if ((Object)(object)val != (Object)null) { Necromancer[] componentsInChildren = ((Component)val).GetComponentsInChildren<Necromancer>(true); if (componentsInChildren.Length != 0) { componentsInChildren[0].used = true; } } if (!((Object)(object)val2 == (Object)null)) { Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(x, y); ZenUtil.ReviveAt(val2, val3, 0.5f); NecroGraves.DeathSpots.Remove(deadId); ZenFx.Burst(Vector2.op_Implicit(val3), new Color(Purple.r, Purple.g, Purple.b, 0.8f), 0.4f, 4.5f, 0.4f); ZenFx.Puff(Vector2.op_Implicit(val3), Purple, 16, 8f, 0.25f, 0.8f); ZenFx.Puff(Vector2.op_Implicit(val3), new Color(0.3f, 0.25f, 0.2f), 10, 6f, 0.25f); } } internal static bool CanRaise(Player p) { if ((Object)(object)p == (Object)null || !ZenUtil.IsActive(p)) { return false; } Necromancer[] componentsInChildren = ((Component)p).GetComponentsInChildren<Necromancer>(true); if (componentsInChildren.Length != 0) { return !componentsInChildren[0].used; } return false; } } public class NecroGraves : MonoBehaviour, IZenPersistent { internal static readonly Dictionary<int, Vector2> DeathSpots = new Dictionary<int, Vector2>(); private static NecroGraves instance; private readonly Dictionary<int, SpriteRenderer> stones = new Dictionary<int, SpriteRenderer>(); public static void Ensure() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)instance != (Object)null)) { GameObject val = new GameObject("Zen_NecroGraves"); val.transform.SetParent(ZenSprites.Root, false); instance = val.AddComponent<NecroGraves>(); DeathWatch.OnDied += delegate(Player victim, Vector2 where, Player killer) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) DeathSpots[victim.playerID] = ZenUtil.GroundBelow(where, 10f); }; ZenCleanup.OnReset += delegate { DeathSpots.Clear(); }; } } private void Update() { //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)PlayerManager.instance == (Object)null) { return; } foreach (Player p in PlayerManager.instance.players) { if ((Object)(object)p == (Object)null) { continue; } bool num = p.data.dead && DeathSpots.ContainsKey(p.playerID) && PlayerManager.instance.players.Any((Player m) => (Object)(object)m != (Object)null && (Object)(object)m != (Object)(object)p && m.teamID == p.teamID && Necromancer.CanRaise(m)); stones.TryGetValue(p.playerID, out var value); if (num) { if ((Object)(object)value == (Object)null) { value = ZenSprites.MakeSprite("Zen_NecroStone", ZenSprites.Load("Spr_Tombstone.png", 1.2f), Vector2.op_Implicit(DeathSpots[p.playerID] + Vector2.up * 0.55f), Necromancer.Purple, 12); stones[p.playerID] = value; } float num2 = 0.75f + Mathf.Sin(Time.time * 4f) * 0.25f; value.color = new Color(Necromancer.Purple.r * num2 + 0.2f, Necromancer.Purple.g * num2 + 0.2f, 1f, 1f); } else if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)((Component)value).gameObject); stones.Remove(p.playerID); } } } } public class TurtleShell : BlockAbility { public const float CooldownSeconds = 8f; public const float MaxTime = 5f; public const float HoldToActivate = 0.5f; public const float Thorns = 0.33f; private float held; internal static readonly Color Green = new Color(0.35f, 0.75f, 0.3f, 1f); internal bool inShell; private float shellTime; private bool exitSent; private SpriteRenderer shell; private float MaxShell => 5f * ((base.Stacks >= 2) ? 1.5f : 1f); protected override float BaseCooldown => 8f; protected override Color PipColor => Green; internal static bool IsShelled(Player p) { if ((Object)(object)p == (Object)null) { return false; } TurtleShell[] componentsInChildren = ((Component)p).GetComponentsInChildren<TurtleShell>(); if (componentsInChildren.Length != 0) { return componentsInChildren[0].inShell; } return false; } protected override bool OnBlockOwner() { return false; } [UnboundRPC] private static void RPCA_Shell(int playerId, bool enter) { Player val = ZenUtil.GetPlayer(playerId); TurtleShell[] array = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponentsInChildren<TurtleShell>() : null); if (array != null && array.Length != 0) { if (enter) { array[0].Enter(); } else { array[0].Exit(); } } } private void Enter() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) inShell = true; shellTime = 0f; exitSent = false; if ((Object)(object)shell == (Object)null) { shell = ZenSprites.MakeSprite("Zen_TurtleShell", ZenSprites.Load("Spr_Shell.png", 3.6f), ((Component)player).transform.position, Color.white, 16); } ZenFx.Puff(((Component)player).transform.position, Green, 8, 5f, 0.2f, 0.4f); } private void Exit() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) if (inShell) { inShell = false; if (ZenUtil.IsMine(player)) { cooldownLeft = base.Cooldown; } if ((Object)(object)shell != (Object)null) { Object.Destroy((Object)(object)((Component)shell).gameObject); } if ((Object)(object)player != (Object)null) { ZenFx.Puff(((Component)player).transform.position, Green, 6, 4f, 0.2f, 0.3f); } } } protected override void Update() { //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: 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_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) base.Update(); if ((Object)(object)player == (Object)null) { return; } if (!inShell) { bool flag = ZenUtil.IsMine(player) && ZenUtil.IsActive(player) && player.data.playerActions != null && ((OneAxisInputControl)player.data.playerActions.Block).IsPressed; held = (flag ? (held + Time.deltaTime) : 0f); if (held >= 0.5f && base.Ready) { held = 0f; NetworkingManager.RPC(typeof(TurtleShell), "RPCA_Shell", new object[2] { player.playerID, true }); } return; } shellTime += Time.deltaTime; Traverse obj = Traverse.Create((object)player.data.playerVel).Field("velocity"); Vector2 value = obj.GetValue<Vector2>(); obj.SetValue((object)new Vector2(0f, Mathf.Min(value.y, 0f))); if ((Object)(object)shell != (Object)null) { float num = Mathf.Max(0.6f, ((Component)player).transform.localScale.x); ((Component)shell).transform.position = ((Component)player).transform.position + Vector3.up * 0.49f * num; ((Component)shell).transform.localScale = new Vector3(num, num * (1f + Mathf.Sin(shellTime * 6f) * 0.03f), 1f); ((Component)shell).transform.rotation = Quaternion.Euler(0f, 0f, Mathf.Sin(shellTime * 3f) * 4f); } if (ZenUtil.IsMine(player) && !exitSent && (player.data.playerActions == null || !((OneAxisInputControl)player.data.playerActions.Block).IsPressed || shellTime >= MaxShell || !ZenUtil.IsActive(player))) { exitSent = true; NetworkingManager.RPC(typeof(TurtleShell), "RPCA_Shell", new object[2] { player.playerID, false }); } } protected override void ResetSpawns() { inShell = false; if ((Object)(object)shell != (Object)null) { Object.Destroy((Object)(object)((Component)shell).gameObject); } } } [HarmonyPatch(typeof(HealthHandler), "DoDamage", new Type[] { typeof(Vector2), typeof(Vector2), typeof(Color), typeof(GameObject), typeof(Player), typeof(bool), typeof(bool), typeof(bool) })] internal static class TurtleShellDamagePatch { [ThreadStatic] private static bool reflecting; private static bool Prefix(HealthHandler __instance, Vector2 damage, Player damagingPlayer) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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) Player component = ((Component)__instance).GetComponent<Player>(); if (!TurtleShell.IsShelled(component)) { return true; } if (!reflecting && (Object)(object)damagingPlayer != (Object)null && (Object)(object)damagingPlayer != (Object)(object)component && damagingPlayer.teamID != component.teamID && ZenUtil.IsActive(damagingPlayer) && ((Vector2)(ref damage)).magnitude > 0.01f) { reflecting = true; try { Vector2 val = -damage * 0.33f; damagingPlayer.data.healthHandler.DoDamage(val, Vector2.op_Implicit(((Component)damagingPlayer).transform.position), TurtleShell.Green, (GameObject)null, component, false, true, true); } finally { reflecting = false; } } return false; } } [HarmonyPatch(typeof(Gun), "Attack")] internal static class TurtleShellGunPatch { private static bool Prefix(Gun __instance, ref bool __result) { Player player = __instance.player; if (!TurtleShell.IsShelled(player) && ((Object)(object)player == (Object)null || !ZenUtil.NoShoot.Contains(player.playerID))) { return true; } __result = false; return false; } } public class DialUpRound : BulletMod { public const float ConnectTime = 1f; public const float SlowFactor = 0.12f; public const float FastFactor = 2.5f; public const float LifeAfterBoost = 2.5f; private Vector2 dir; private bool boosted; protected override void OnBulletStart() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) KeepAlive(); dir = AimedDirection(); move.gravity = 0f; move.velocity = Vector2.op_Implicit(dir * startSpeed * 0.12f); } protected override void OnBulletUpdate() { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) if (!boosted) { move.velocity = Vector2.op_Implicit(dir * startSpeed * 0.12f); if (age >= 1f) { boosted = true; move.velocity = Vector2.op_Implicit(dir * startSpeed * 2.5f); ZenFx.Burst(bullet.transform.position, new Color(0.5f, 0.9f, 1f, 0.8f), 0.2f, 1.6f, 0.2f); } } else { move.velocity = Vector2.op_Implicit(dir * startSpeed * 2.5f); if (age > 3.5f) { Kill(); } } } } public class Ufo : StackingEffect { public const float GravityMult = 0.25f; public const float MaxTimeAboveMap = 4f; private Player owner; private OutOfBoundsHandler oob; private float aboveTime; private SpriteRenderer saucer; private float t; private void Start() { owner = ((Component)this).GetComponentInParent<Player>(); } private OutOfBoundsHandler FindBorder() { if ((Object)(object)oob != (Object)null) { return oob; } OutOfBoundsHandler[] array = Object.FindObjectsOfType<OutOfBoundsHandler>(); foreach (OutOfBoundsHandler val in array) { CharacterData value = Traverse.Create((object)val).Field("data").GetValue<CharacterData>(); if ((Object)(object)value != (Object)null && (Object)(object)owner != (Object)null && (Object)(object)value == (Object)(object)owner.data) { oob = val; break; } } return oob; } private void Update() { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_015f: 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_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)owner == (Object)null) { return; } t += Time.deltaTime; if ((Object)(object)saucer == (Object)null) { saucer = ZenSprites.MakeSprite("Zen_Saucer", ZenSprites.Load("Spr_Saucer.png", 2.6f), ((Component)owner).transform.position, Color.white, 14); } float num = Mathf.Max(0.6f, ((Component)owner).transform.localScale.x); ((Component)saucer).transform.position = ((Component)owner).transform.position + Vector3.down * (0.75f * num) + Vector3.up * Mathf.Sin(t * 4f) * 0.05f; ((Component)saucer).transform.localScale = new Vector3(num, num, 1f); ((Component)saucer).transform.rotation = Quaternion.Euler(0f, 0f, Mathf.Sin(t * 2.5f) * 5f); OutOfBoundsHandler val = FindBorder(); if (!((Object)(object)val == (Object)null)) { Vector3 val2 = OutOfBoundsHandlerExtensions.BoundsPointFromWorldPosition(val, ((Component)owner).transform.position); bool flag = val2.x <= 0f || val2.x >= 1f || val2.y <= 0f; if (val2.y > 1f && !flag) { aboveTime += Time.deltaTime; } else { aboveTime = 0f; } ((Behaviour)val).enabled = flag || aboveTime > 4f; } } private void OnDisable() { if ((Object)(object)oob != (Object)null) { ((Behaviour)oob).enabled = true; } if ((Object)(object)saucer != (Object)null) { Object.Destroy((Object)(object)((Component)saucer).gameObject); } } private void OnDestroy() { if ((Object)(object)oob != (Object)null) { ((Behaviour)oob).enabled = true; } if ((Object)(object)saucer != (Object)null) { Object.Destroy((Object)(object)((Component)saucer).gameObject); } } internal static void Equip(Player player, Gravity gravity) { InAirJumpEffect obj = ((Component)player).gameObject.GetComponent<InAirJumpEffect>() ?? ((Component)player).gameObject.AddComponent<InAirJumpEffect>(); obj.SetJumpMult(0.12f); obj.AddJumps(10000f); obj.SetCostPerJump(1f); obj.SetContinuousTrigger(true); obj.SetResetOnWallGrab(true); obj.SetInterval(0.08f); if ((Object)(object)gravity != (Object)null) { gravity.gravityForce *= 0.25f; } } internal static void Unequip(Player player, Gravity gravity) { InAirJumpEffect component = ((Component)player).gameObject.GetComponent<InAirJumpEffect>(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } if ((Object)(object)gravity != (Object)null) { gravity.gravityForce /= 0.25f; } } } public class SusanStorm : KeyAbility { public const int MaxPlatforms = 3; public const float Life = 3f; public const float Width = 2.6f; public const float Thickness = 0.35f; internal static readonly Color Field = new Color(0.55f, 0.85f, 1f, 1f); private static readonly Dictionary<int, List<GameObject>> placed = new Dictionary<int, List<GameObject>>(); protected override KeyCode Key => Plugin.SusanKey.Value; protected override float BaseCooldown => 0.2f; protected override bool ShowPip => false; protected override bool OnActivateOwner() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0074: Unknown result type (might be due to invalid IL or missing references) Vector2 val = Vector2.op_Implicit(((Component)player).transform.position) + Vector2.down * (ZenUtil.HitRadius(player) + 0.175f + 0.05f); NetworkingManager.RPC(typeof(SusanStorm), "RPCA_Place", new object[3] { player.playerID, val.x, val.y }); return true; } [UnboundRPC] private static void RPCA_Place(int ownerId, float x, float y) { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) if (!placed.TryGetValue(ownerId, out var value)) { value = (placed[ownerId] = new List<GameObject>()); } value.RemoveAll((GameObject g) => (Object)(object)g == (Object)null); while (value.Count >= 3) { if ((Object)(object)value[0] != (Object)null) { Object.Destroy((Object)(object)value[0]); } value.RemoveAt(0); } GameObject gameObject = ((Component)ZenSprites.MakeSprite("Zen_ForceField", ZenSprites.Load("Spr_ForceField.png", 2.6f), new Vector3(x, y, 0f), Field, 11)).gameObject; gameObject.layer = 0; gameObject.AddComponent<BoxCollider2D>().size = new Vector2(2.6f / Mathf.Max(0.001f, gameObject.transform.lossyScale.x), 0.35f); gameObject.AddComponent<ForcePlatform>(); value.Add(gameObject); ZenFx.Burst(Vector2.op_Implicit(new Vector2(x, y)), new Color(Field.r, Field.g, Field.b, 0.6f), 0.3f, 2.5f, 0.2f); } protected override void ResetSpawns() { if (!((Object)(object)player != (Object)null) || !placed.TryGetValue(player.playerID, out var value)) { return; } foreach (GameObject item in value) { if ((Object)(object)item != (Object)null) { Object.Destroy((Object)(object)item); } } value.Clear(); } } public class ForcePlatform : MonoBehaviour { private float age; private SpriteRenderer sr; private void Start() { sr = ((Component)this).GetComponent<SpriteRenderer>(); } private void Update() { //IL_009c: Unknown result type (might be due to invalid IL or missing references) age += Time.deltaTime; float num = 0.75f + Mathf.Sin(age * 10f) * 0.1f; if (age > 2.4f) { num *= ((Mathf.Repeat(age * 10f, 1f) > 0.4f) ? 1f : 0.25f); } if ((Object)(object)sr != (Object)null) { sr.color = new Color(SusanStorm.Field.r, SusanStorm.Field.g, SusanStorm.Field.b, num); } if (age >= 3f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public static class AmmoGamble { public const int Min = 3; public const int Max = 10; private static readonly Dictionary<int, Stack<int>> rolls = new Dictionary<int, Stack<int>>(); private static readonly Dictionary<int, int> pending = new Dictionary<int, int>(); private static bool registered; public static void Add(Player player, GunAmmo ammo) { int num = PlayerManager.instance.players.Sum((Player p) => ((Object)(object)p != (Object)null && p.data.currentCards != null) ? p.data.currentCards.Count : 0); int num2 = new Random(player.playerID * 7919 + num * 104729 + 12345).Next(3, 11); ammo.maxAmmo += num2; if (!rolls.TryGetValue(player.playerID, out var value)) { value = (rolls[player.playerID] = new Stack<int>()); } value.Push(num2); try { Traverse.Create((object)ammo).Method("ReDrawTotalBullets", Array.Empty<object>()).GetValue(); } catch { } pending.TryGetValue(player.playerID, out var value2); pending[player.playerID] = value2 + num2; } public static void Register() { if (!registered) { registered = true; GameModeManager.AddHook("PointStart", (Func<IGameModeHandler, IEnumerator>)OnPointStart); } } private static IEnumerator OnPointStart(IGameModeHandler gm) { if (pending.Count > 0) { ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)Plugin.Instance, 1f, (Action)ShowPending); } yield break; } private static void ShowPending() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair<int, int> item in pending.ToList()) { Player player = ZenUtil.GetPlayer(item.Key); if (!((Object)(object)player == (Object)null) && ZenUtil.IsActive(player)) { float num = Mathf.Max(0.7f, ((Component)player).transform.localScale.x); ZenFx.FloatText("+" + item.Value + " Bullets", ((Component)player).transform.position + Vector3.up * (1.8f * num + 0.6f), new Color(1f, 0.85f, 0.25f, 1f), 1.1f, 2.5f); pending.Remove(item.Key); } } } public static void Remove(Player player, GunAmmo ammo) { if (rolls.TryGetValue(player.playerID, out var value) && value.Count > 0) { ammo.maxAmmo = Mathf.Max(1, ammo.maxAmmo - value.Pop()); } } } public class CorkscrewRound : BulletMod { public const float Amplitude = 0.12f; public const float Frequency = 95f; private Vector2 origin; private Vector2 dir; private Vector2 side; private Transform tf; protected override void OnBulletStart() { //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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) dir = AimedDirection(); side = new Vector2(0f - dir.y, dir.x); move.gravity = 0f; move.velocity = Vector2.op_Implicit(dir * startSpeed); tf = bullet.transform; origin = OntoAimLine(Vector2.op_Implicit(tf.position), dir); } private void LateUpdate() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_003f: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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) if (base.Live && !((Object)(object)tf == (Object)null)) { move.velocity = Vector2.op_Implicit(dir * startSpeed); Vector2 val = origin + dir * startSpeed * age + side * 0.12f * Mathf.Sin(age * 95f); tf.position = new Vector3(val.x, val.y, tf.position.z); } } } public class OrbitRound : BulletMod { public const float Radius = 2.2f; public const float Spin = 400f; public const float OrbitTime = 2f; public const float LaunchSpeedMult = 1.4f; public const float LifeAfterLaunch = 3f; private static readonly Dictionary<int, int> fired = new Dictionary<int, int>(); private float angle; private float launchedAt = -1f; private RayCastTrail trail; private LayerMask wallMask; protected override void OnBulletStart() { //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_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) KeepAlive(); move.gravity = 0f; trail = bullet.GetComponentInChildren<RayCastTrail>(); if ((Object)(object)trail != (Object)null) { wallMask = trail.mask; trail.mask = trail.playerMask; } fired.TryGetValue(shooter.playerID, out var value); fired[shooter.playerID] = value + 1; Vector2 val = AimedDirection(); angle = Mathf.Atan2(val.y, val.x) * 57.29578f + (float)value * 47f; } protected override void OnBulletUpdate() { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)shooter == (Object)null || shooter.data.dead) { Kill(); return; } float num = Mathf.Max(0.001f, Time.deltaTime); if (launchedAt < 0f) { angle += 400f * num; float num2 = Mathf.Min(2.2f, 0.6f + age * 10f); Vector2 val = (Vector2.op_Implicit(((Component)shooter).transform.position) + new Vector2(Mathf.Cos(angle * ((float)Math.PI / 180f)), Mathf.Sin(angle * ((float)Math.PI / 180f))) * num2 - Vector2.op_Implicit(bullet.transform.position)) / num; move.velocity = Vector2.op_Implicit(Vector2.ClampMagnitude(val, 250f)); if (age >= 2f) { Launch(); } } else if (age > launchedAt + 3f) { Kill(); } } private void Launch() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0049: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) launchedAt = age; Vector2 val = Vector2.op_Implicit(((Component)shooter).transform.position); Vector2 val2 = ZenUtil.AimDirection(shooter); Vector2 val3 = Vector2.op_Implicit(bullet.transform.position) - val; float magnitude = ((Vector2)(ref val3)).magnitude; float num = 0.6f + ((Component)shooter).transform.localScale.x * 0.6f; if (magnitude > 0.01f) { RaycastHit2D val4 = Physics2D.Raycast(val, val3 / magnitude, magnitude + 0.2f, LayerMask.op_Implicit(wallMask)); if ((Object)(object)((RaycastHit2D)(ref val4)).collider != (Object)null) { float num2 = ((RaycastHit2D)(ref val4)).distance - 0.3f; Vector2 val5 = val + val3 / magnitude * num2; if (num2 < num) { RaycastHit2D val6 = Physics2D.Raycast(val, val2, num + 0.3f, LayerMask.op_Implicit(wallMask)); if ((Object)(object)((RaycastHit2D)(ref val6)).collider != (Object)null) { Kill(); return; } val5 = val + val2 * num; } bullet.transform.position = new Vector3(val5.x, val5.y, bullet.transform.position.z); if ((Object)(object)trail != (Object)null) { Traverse.Create((object)trail).Field("lastPos").SetValue((object)bullet.transform.position); } } } if ((Object)(object)trail != (Object)null) { trail.mask = wallMask; } Vector2 val7 = val + val2 * 14f - Vector2.op_Implicit(bullet.transform.position); Vector2 normalized = ((Vector2)(ref val7)).normalized; move.velocity = Vector2.op_Implicit(normalized * startSpeed * 1.4f); } } public class TumbleweedRound : BulletMod { protected override void OnBulletUpdate() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) Vector2 val = Vector2.op_Implicit(move.velocity); if (!(((Vector2)(ref val)).sqrMagnitude < 0.01f)) { Vector2 val2 = Vector2.op_Implicit(bullet.transform.position); float num = ((Vector2)(ref val)).magnitude * Time.deltaTime * 1.5f + 0.3f; RaycastHit2D val3 = Physics2D.Raycast(val2, ((Vector2)(ref val)).normalized, num, ZenUtil.GroundMask); if (!((Object)(object)((RaycastHit2D)(ref val3)).collider == (Object)null) && !(((RaycastHit2D)(ref val3)).normal.y < 0.6f) && !((Object)(object)((Component)((RaycastHit2D)(ref val3)).collider).GetComponentInParent<Player>() != (Object)null)) { GameObject val4 = new GameObject("Zen_Tumbleweed"); val4.transform.SetParent(ZenSprites.Root, false); val4.AddComponent<TumbleweedRoller>().Init(shooter, ((RaycastHit2D)(ref val3)).point + ((RaycastHit2D)(ref val3)).normal * 0.45f, (val.x >= 0f) ? 1f : (-1f)); Kill(); } } } } public class TumbleweedRoller : MonoBehaviour { public const float Radius = 0.45f; public const float Speed = 9f; public const float Life = 3.5f; public const float DamageFactor = 0.6f; public const float RehitDelay = 0.6f; private Player owner; private float dirX; private float age; private float vy; private float damage; private SpriteRenderer sr; private readonly Dictionary<int, float> lastHit = new Dictionary<int, float>(); public void Init(Player o, Vector2 at, float dx) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_0089: Unknown result type (might be due to invalid IL or missing references) owner = o; dirX = dx; ((Component)this).transform.position = Vector2.op_Implicit(at); damage = ZenUtil.BulletDamage(o) * 0.6f; sr = ZenSprites.MakeSprite("Zen_TumbleweedSprite", ZenSprites.Load("Spr_Tumbleweed.png", 1.08f), Vector2.op_Implicit(at), Color.white, 14); ((Component)sr).transform.SetParent(((Component)this).transform, true); ZenFx.Puff(Vector2.op_Implicit(at), new Color(0.8f, 0.7f, 0.5f), 6, 3f, 0.15f, 0.4f); } private void Update() { //IL_007f: 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_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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)owner == (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } age += Time.deltaTime; if (age > 3.5f) { ZenFx.Puff(((Component)this).transform.position, new Color(0.8f, 0.7f, 0.5f), 8, 4f, 0.15f, 0.4f); Object.Destroy((Object)(object)((Component)this).gameObject); return; } Vector2 val = Vector2.op_Implicit(((Component)this).transform.position); float deltaTime = Time.deltaTime; RaycastHit2D val2 = Physics2D.Raycast(val, new Vector2(dirX, 0f), 0.45f + 9f * deltaTime + 0.05f, ZenUtil.GroundMask); if ((Object)(object)((RaycastHit2D)(ref val2)).collider != (Object)null) { dirX = 0f - dirX; } val.x += dirX * 9f * deltaTime; RaycastHit2D val3 = Physics2D.Raycast(val + Vector2.up * 0.5f, Vector2.down, 1.35f, ZenUtil.GroundMask); if ((Object)(object)((RaycastHit2D)(ref val3)).collider != (Object)null && vy <= 0f) { val.y = ((RaycastHit2D)(ref val3)).point.y + 0.45f; vy = ((Mathf.Abs(Mathf.Sin(age * 7f)) > 0.97f) ? 6f : 0f); } else { vy -= 30f * deltaTime; val.y += vy * deltaTime; } ((Component)this).transform.position = Vector2.op_Implicit(val); if ((Object)(object)sr != (Object)null) { ((Component)sr).transform.position = Vector2.op_Implicit(val); ((Component)sr).transform.Rotate(0f, 0f, (0f - dirX) * 9f / 0.45f * 57.29578f * deltaTime); sr.color = new Color(1f, 1f, 1f, Mathf.Clamp01((3.5f - age) * 3f)); } if (!ZenUtil.IsMine(owner)) { return; } foreach (Player item in ZenUtil.Enemies(owner, val, 3f, needSight: false)) { if ((!lastHit.TryGetValue(item.playerID, out var value) || !(age - value < 0.6f)) && !(Vector2.Distance(val, Vector2.op_Implicit(((Component)item).transform.position)) > ZenUtil.HitRadius(item) + 0.45f)) { lastHit[item.playerID] = age; ZenUtil.Damage(owner, item, damage, new Vector2(dirX, 0.4f)); } } } } public class DuckRound : BulletMod { public const float Size = 1.8f; public const float Life = 6f; public const float FloatHeight = 0.45f; private float life = 6f; private Transform duck; private bool floating; private float dirX = 1f; private float speed; protected override void OnBulletStart() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) KeepAlive(); float worldWidth = 1.8f * ((base.Copies >= 2) ? 1.5f : 1f); if (base.Copies >= 2) { life = 9f; } SpriteRenderer val = ZenSprites.MakeSprite("Zen_Duck", ZenSprites.Load("Spr_Duck.png", worldWidth), bullet.transform.position, Color.white, 15); duck = ((Component)val).transform; duck.SetParent(((Component)this).transform, true); HideDefaultVisuals(duck); Vector2 val2 = Vector2.op_Implicit(move.velocity); dirX = ((val2.x >= 0f) ? 1f : (-1f)); speed = Mathf.Max(6f, startSpeed * 0.35f); } protected override void OnBulletUpdate() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) if (age > life) { Kill(); return; } Vector2 val = Vector2.op_Implicit(bullet.transform.position); float num = Mathf.Max(0.001f, Time.deltaTime); if (!floating) { Vector2 val2 = Vector2.op_Implicit(move.velocity); if (Mathf.Abs(val2.x) > 0.5f) { dirX = Mathf.Sign(val2.x); } RaycastHit2D val3 = Physics2D.Raycast(val, Vector2.down, 0.79999995f + Mathf.Max(0f, 0f - val2.y) * num, ZenUtil.GroundMask); if ((Object)(object)((RaycastHit2D)(ref val3)).collider != (Object)null && ((RaycastHit2D)(ref val3)).normal.y > 0.6f && val2.y <= 0f && (Object)(object)((Component)((RaycastHit2D)(ref val3)).collider).GetComponentInParent<Player>() == (Object)null) { floating = true; move.gravity = 0f; } } else { RaycastHit2D val4 = Physics2D.Raycast(val, new Vector2(dirX, 0f), 0.5f + speed * num, ZenUtil.GroundMask); if ((Object)(object)((RaycastHit2D)(ref val4)).collider != (Object)null) { dirX = 0f - dirX; } RaycastHit2D val5 = Physics2D.Raycast(new Vector2(val.x + dirX * speed * num, val.y + 0.8f), Vector2.down, 2.5f, ZenUtil.GroundMask); if ((Object)(object)((RaycastHit2D)(ref val5)).collider == (Object)null) { floating = false; move.gravity = 1f; move.velocity = new Vector3(dirX * speed, 0f, 0f); } else { float num2 = ((RaycastHit2D)(ref val5)).point.y + 0.45f + Mathf.Sin(age * 6f) * 0.15f; move.velocity = new Vector3(dirX * speed, Mathf.Clamp((num2 - val.y) / num, -40f, 40f), 0f); } } if ((Object)(object)duck != (Object)null) { duck.position = bullet.transform.position; duck.rotation = Quaternion.Euler(0f, 0f, Mathf.Sin(age * 6f + 1f) * 10f); Vector3 localScale = duck.localScale; duck.localScale = new Vector3(Mathf.Abs(localScale.x) * dirX, Mathf.Abs(localScale.y), 1f); } } } public class YugeRound : BulletMod { public const float Scale = 10f; private RayCastTrail hitbox; private bool grown; protected override void OnBulletStart() { TrailRenderer[] componentsInChildren = bullet.GetComponentsInChildren<TrailRenderer>(true); foreach (TrailRenderer obj in componentsInChildren) { obj.startWidth *= 10f; obj.endWidth *= 10f; } hitbox = bullet.GetComponentInChildren<RayCastTrail>(); } protected override void OnBulletUpdate() { if (!grown && !((Object)(object)hitbox == (Object)null)) { grown = true; RayCastTrail obj = hitbox; obj.size *= 10f; } } } public class NerfRound : BulletMod { private Transform dart; protected override void OnBulletStart() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) SpriteRenderer val = ZenSprites.MakeSprite("Zen_NerfDart", ZenSprites.Load("Spr_NerfDart.png", 1.5f), bullet.transform.position, Color.white, 15); dart = ((Component)val).transform; dart.SetParent(((Component)this).transform, true); HideDefaultVisuals(dart); } protected override void OnBulletUpdate() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)dart == (Object)null)) { dart.position = bullet.transform.position; Vector2 val = Vector2.op_Implicit(move.velocity); if (((Vector2)(ref val)).sqrMagnitude > 0.01f) { dart.rotation = Quaternion.Euler(0f, 0f, Mathf.Atan2(val.y, val.x) * 57.29578f); } } } } public class Seraph : KeyAbility { public const float RiseTime = 1.3f; public const float ChargeTime = 3f; public const float CooldownSeconds = 15f; public const int EyesPerExtraCopy = 2; public const int Eyes = 5; public const float EyeDamageFactor = 1f; public const float EyeSpeed = 11f; public const float EyeTurn = 95f; public const float EyeLife = 5f; internal static readonly Color Holy = new Color(1f, 0.92f, 0.55f, 1f); protected override KeyCode Key => Plugin.SeraphKey.Value; protected override float BaseCooldown => 15f; protected override Color PipColor => Holy; internal int EyeCount => 5 + 2 * Mathf.Max(0, base.Stacks - 1); protected override bool OnActivateOwner() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ZenUtil.GetEffect<SeraphFx>(player) != (Object)null) { return false; } Vector2 val = OpenSpotNearCenter(player); NetworkingManager.RPC(typeof(Seraph), "RPCA_Ascend", new object[3] { player.playerID, val.x, val.y }); return true; } private static Vector2 OpenSpotNearCenter(Player p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) Vector2 val = Vector2.zero; if (ZenUtil.ScreenBounds(out var min, out var max)) { val = (min + max) * 0.5f; } float num = ZenUtil.HitRadius(p) + 1.2f; for (float num2 = 0f; num2 < 14f; num2 += 0.75f) { int num3 = ((num2 == 0f) ? 1 : 16); for (int i = 0; i < num3; i++) { float num4 = (float)i * (float)Math.PI * 2f / (float)num3; Vector2 val2 = val + new Vector2(Mathf.Cos(num4), Mathf.Sin(num4)) * num2; Collider2D[] array = Physics2D.OverlapCircleAll(val2, num, ZenUtil.GroundMask); if (array == null || !array.Any((Collider2D h) => (Object)(object)h != (Object)null && (Object)(object)((Component)h).GetComponentInParent<Player>() == (Object)null)) { return val2; } } } return val; } [UnboundRPC] private static void RPCA_Ascend(int ownerId, float x, float y) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) Player val = ZenUtil.GetPlayer(ownerId); if (!((Object)(object)val == (Object)null)) { GameObject val2 = new GameObject("Zen_Seraph"); val2.transform.SetParent(ZenSprites.Root, false); val2.AddComponent<SeraphFx>().Init(val, new Vector2(x, y)); } } [UnboundRPC] private static void RPCA_Release(int ownerId, string targetIds, float damage) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) Player val = ZenUtil.GetPlayer(ownerId); if (!((Object)(object)val == (Object)null)) { int[] array = (from x in targetIds.Split(new char[1] { ',' }) where x.Length > 0 select x).Select(int.Parse).ToArray(); int num = array.Length; Vector2 val2 = Vector2.op_Implicit(((Component)val).transform.position); float num2 = ((num <= 5) ? 38f : (152f / (float)(num - 1))); for (int num3 = 0; num3 < num; num3++) { float num4 = (90f + ((float)num3 - (float)(num - 1) * 0.5f) * num2) * ((float)Math.PI / 180f); ((Component)ZenSprites.MakeSprite("Zen_SeraphEye", ZenSprites.Load("Spr_Eye.png", 0.9f), Vector2.op_Implicit(val2), Color.white, 17)).gameObject.AddComponent<SeraphEye>().Init(val, ZenUtil.GetPlayer(array[num3]), new Vector2(Mathf.Cos(num4), Mathf.Sin(num4)), damage, num3); } ZenFx.Burst(Vector2.op_Implicit(val2), Holy, 1f, 9f, 0.5f); ZenFx.Burst(Vector2.op_Implicit(val2), Color.white, 0.5f, 5f, 0.3f); } } [UnboundRPC] private static void RPCA_EyeHit(int ownerId, int index) { SeraphEye[] array = Object.FindObjectsOfType<SeraphEye>(); foreach (SeraphEye seraphEye in array) { if ((Object)(object)seraphEye != (Object)null && seraphEye.OwnerId == ownerId && seraphEye.Index == index) { seraphEye.Pop(); } } } internal static void SendRelease(Player owner) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) Seraph effect = ZenUtil.GetEffect<Seraph>(owner); int num = (((Object)(object)effect != (Object)null) ? effect.EyeCount : 5); List<Player> list = ZenUtil.Enemies(owner, Vector2.op_Implicit(((Component)owner).transform.position), 9999f, needSight: false).ToList(); string[] array = new string[num]; for (int i = 0; i < num; i++) { array[i] = ((list.Count > 0) ? list[i % list.Count].playerID : (-1)).ToString(); } float num2 = ZenUtil.BulletDamage(owner) * 1f; NetworkingManager.RPC(typeof(Seraph), "RPCA_Release", new object[3] { owner.playerID, string.Join(",", array), num2 }); } internal static void SendEyeHit(Player owner, int index) { NetworkingManager.RPC(typeof(Seraph), "RPCA_EyeHit", new object[2] { owner.playerID, index }); } } public class SeraphFx : MonoBehaviour { private Player owner; private Vector2 start; private Vector2 spot; private float age; private bool released; private SpriteRenderer wings; private SpriteRenderer aura; private SpriteRenderer halo; public void Init(Player o, Vector2 target) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) owner = o; start = Vector2.op_Implicit(((Component)o).transform.position); spot = target; ZenUtil.NoShoot.Add(o.playerID); wings = ZenSprites.MakeSprite("Zen_SeraphWings", ZenSprites.Load("Spr_SeraphWings.png", 5f), Vector2.op_Implicit(start), new Color(1f, 1f, 1f, 0f), 13); aura = ZenSprites.MakeSprite("Zen_SeraphAura", ZenSprites.Circle, Vector2.op_Implicit(start), new Color(1f, 0.9f, 0.5f, 0f), 12); halo = ZenSprites.MakeSprite("Zen_SeraphHalo", ZenSprites.Load("Spr_Halo.png", 1.4f), Vector2.op_Implicit(start), new Color(1f, 1f, 1f, 0f), 18); SpriteRenderer[] array = (SpriteRenderer[])(object)new SpriteRenderer[3] { wings, aura, halo }; for (int i = 0; i < array.Length; i++) { ((Component)array[i]).transform.SetParent(((Component)this).transform, true); } } private void OnDestroy() { if ((Object)(object)owner != (Object)null) { ZenUtil.NoShoot.Remove(owner.playerID); } } private void Update() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)owner == (Object)null || !ZenUtil.IsActive(owner)) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } age += Time.deltaTime; float num = Mathf.Clamp01(age / 1.3f); float num2 = num * num * (3f - 2f * num); Vector2 val = Vector2.Lerp(start, spot, num2) + Vector2.up * Mathf.Sin(age * 3f) * 0.08f; ZenUtil.Teleport(owner, val); float num3 = Mathf.Clamp01((age - 1.3f) / 3f); float num4 = Mathf.Max(0.6f, ((Component)owner).transform.localScale.x); ((Component)wings).transform.position = Vector2.op_Implicit(val); ((Component)wings).transform.localScale = new Vector3(num4 * (0.4f + num * 0.6f) * (1f + Mathf.Sin(age * 5f) * 0.04f), num4 * (0.4f + num * 0.6f), 1f); wings.color = new Color(1f, 1f, 1f, num); ((Component)aura).transform.position = Vector2.op_Implicit(val); float num5 = 1.5f + num3 * 9f; ((Component)aura).transform.localScale = new Vector3(num5, num5, 1f); aura.color = new Color(1f, 0.9f, 0.5f, 0.15f + num3 * 0.35f + Mathf.Sin(age * 10f) * 0.05f); ((Component)halo).transform.position = Vector2.op_Implicit(val + Vector2.up * (1.1f * num4)); halo.color = new Color(1f, 1f, 1f, num); if (num3 > 0f && Random.value < 0.25f) { ZenFx.Puff(Vector2.op_Implicit(val + Random.insideUnitCircle * num5 * 0.5f), Seraph.Holy, 1, 1.5f, 0.12f, 0.6f); } if (!released && age >= 4.3f) { released = true; if (ZenUtil.IsMine(owner)) { Seraph.SendRelease(owner); } Object.Destroy((Object)(object)((Component)this).gameObject, 0.3f); } } } public class SeraphEye : MonoBehaviour { internal int OwnerId; internal int Index; private Player owner; private Player target; private Vector2 vel; private float age; private float damage; private bool popped; public void Init(Player o, Player t, Vector2 dir, float dmg, int index) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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_00a6: Unknown result type (might be due to invalid IL or missing references) owner = o; target = t; vel = dir * 11f; damage = dmg; OwnerId = o.playerID; Index = index; TrailRenderer obj = ((Component)this).gameObject.AddComponent<TrailRenderer>(); ((Renderer)obj).material = ZenSprites.LineMaterial; obj.time = 0.25f; obj.startWidth = 0.45f; obj.endWidth = 0f; obj.startColor = new Color(1f, 0.9f, 0.5f, 0.8f); obj.endColor = new Color(1f, 0.9f, 0.5f, 0f); ((Renderer)obj).sortingLayerName = "MostFront"; ((Renderer)obj).sortingOrder = 16; } public void Pop() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (!popped) { popped = true; ZenFx.Burst(((Component)this).transform.position, Seraph.Holy, 0.3f, 2f, 0.25f); Object.Destroy((Object)(object)((Component)this).gameObject); } } private void Update() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)owner == (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } age += Time.deltaTime; if (age > 5f) { Pop(); return; } Vector2 val = Vector2.op_Implicit(((Component)this).transform.position); if (age > 0.35f && (Object)(object)target != (Object)null && ZenUtil.IsActive(target)) { Vector2 val2 = Vector2.op_Implicit(((Component)target).transform.position) - val; float num = Mathf.Atan2(vel.y, vel.x) * 57.29578f; float num2 = Mathf.Atan2(val2.y, val2.x) * 57.29578f; float num3 = Mathf.MoveTowardsAngle(num, num2, 95f * Time.deltaTime) * ((float)Math.PI / 180f); vel = new Vector2(Mathf.Cos(num3), Mathf.Sin(num3)) * 11f; } Vector2 val3 = vel * Time.deltaTime; val += val3; ((Component)this).transform.position = Vector2.op_Implicit(val); ((Component)this).transform.rotation = Quaternion.Euler(0f, 0f, Mathf.Atan2(vel.y, vel.x) * 57.29578f); if (!ZenUtil.IsMine(owner)) { return; } foreach (Player item in ZenUtil.Enemies(owner, val, 3f, needSight: false)) { if (!(Vector2.Distance(val, Vector2.op_Implicit(((Component)item).transform.position)) > ZenUtil.HitRadius(item) + 0.35f)) { ZenUtil.Damage(owner, item, damage, vel); Seraph.SendEyeHit(owner, Index); Pop(); break; } } } } public static class BlockThief { private static readonly Dictionary<int, int> gained = new Dictionary<int, int>(); public static void Steal(Player me) { List<Player> list = (from p in PlayerManager.instance.players where (Object)(object)p != (Object)null && p.teamID != me.teamID && p.data.block.additionalBlocks > 0 orderby p.playerID select p).ToList(); if (list.Count > 0) { int num = PlayerManager.instance.players.Sum((Player p) => ((Object)(object)p != (Object)null && p.data.currentCards != null) ? p.data.currentCards.Count : 0); Random random = new Random(me.playerID * 31337 + num * 7919 + 4242); Block block = list[random.Next(list.Count)].data.block; block.additionalBlocks--; } Block block2 = me.data.block; block2.additionalBlocks++; gained.TryGetValue(me.playerID, out var value); gained[me.playerID] = value + 1; } public static void Undo(Player me) { if (gained.TryGetValue(me.playerID, out var value) && value > 0) { gained[me.playerID] = value - 1; me.data.block.additionalBlocks = Mathf.Max(0, me.data.block.additionalBlocks - 1); } } } public class ClamSlam : BlockAbility { public const float CooldownSeconds = 4f; public const float FallSpeed = 70f; public const float MinHeight = 4f; public const float MaxHeight = 15f; public const float FullRadius = 2f; public const float Radius = 5.25f; public const float Falloff = 0.3076923f; public const float RecoverTime = 1f; internal static readonly Color Pearl = new Color(0.95f, 0.9f, 1f, 1f); protected override float BaseCooldown => 4f; protected override Color PipColor => Pearl; protected override bool OnBlockOwner() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (player.data.isGrounded) { return false; } if (Object.FindObjectsOfType<ClamFx>().Any((ClamFx f) => (Object)(object)f != (Object)null && (Object)(object)f.Owner == (Object)(object)player)) { return false; } NetworkingManager.RPC(typeof(ClamSlam), "RPCA_Clam", new object[2] { player.playerID, ((Component)player).transform.position.y }); return true; } [UnboundRPC] private static void RPCA_Clam(int playerId, float startY) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Player val = ZenUtil.GetPlayer(playerId); if (!((Object)(object)val == (Object)null)) { GameObject val2 = new GameObject("Zen_Clam"); val2.transform.SetParent(ZenSprites.Root, false); val2.AddComponent<ClamFx>().Init(val, startY); } } [UnboundRPC] private static void RPCA_Slam(int playerId, float x, float y, float damage, float reach) { //IL_007b: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) Player val = ZenUtil.GetPlayer(playerId); ClamFx[] array = Object.FindObjectsOfType<ClamFx>(); foreach (ClamFx clamFx in array) { if ((Object)(object)clamFx != (Object)null && (Object)(object)clamFx.Owner == (Object)(object)val) { clamFx.Landed(); } } Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(x, y); float num = (((Object)(object)val != (Object)null) ? Mathf.Clamp01(damage / Mathf.Max(1f, val.data.maxHealth)) : 0.5f); ZenFx.Burst(Vector2.op_Implicit(val2), new Color(1f, 1f, 1f, 0.8f), 0.5f, 5.25f * reach * 2f * (0.6f + num * 0.6f)); ZenFx.Puff(Vector2.op_Implicit(val2), new Color(0.85f, 0.8f, 0.7f), 18, 9f + num * 8f, 0.3f, 0.6f); if ((Object)(object)val == (Object)null || !ZenUtil.IsMine(val) || damage <= 0f) { return; } foreach (Player item in ZenUtil.Enemies(val, val2, 5.25f * reach, needSight: false)) { float num2 = Vector2.Distance(val2, Vector2.op_Implicit(((Component)item).transform.position)); float num3 = damage; if (num2 > 2f * reach) { num3 *= 1f - Mathf.Pow((num2 - 2f * reach) * 0.3076923f / reach, 2f); } if (num3 > 0f) { float amount = num3; Vector2 val3 = Vector2.op_Implicit(((Component)item).transform.position) - val2; ZenUtil.Damage(val, item, amount, ((Vector2)(ref val3)).normalized + Vector2.up); } } } internal static void SendSlam(Player p, Vector2 at, float damage) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ClamSlam effect = ZenUtil.GetEffect<ClamSlam>(p); float num = (((Object)(object)effect != (Object)null && effect.Stacks >= 2) ? 1.5f : 1f); NetworkingManager.RPC(typeof(ClamSlam), "RPCA_Slam", new object[5] { p.playerID, at.x, at.y, damage, num }); } } public class ClamFx : MonoBehaviour { internal Player Owner; private float startY; private float age; private float landedAt = -1f; private bool slamSent; private SpriteRenderer clam; private readonly List<Renderer> hidden = new List<Renderer>(); public void Init(Player p, float y) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) Owner = p; startY = y; ZenUtil.NoShoot.Add(p.playerID); Renderer[] componentsInChildren = ((Component)p).GetComponentsInChildren<Renderer>(); foreach (Renderer val in componentsInChildren) { if (val.enabled) { val.enabled = false; hidden.Add(val); } } float num = Mathf.Max(0.6f, ((Component)p).transform.localScale.x); clam = ZenSprites.MakeSprite("Zen_ClamSprite", ZenSprites.Load("Spr_Clam.png", 2.2f * num), ((Component)p).transform.position, Color.white, 15); ((Component)clam).transform.SetParent(((Component)this).transform, true); ZenFx.Puff(((Component)p).transform.position, ClamSlam.Pearl, 8, 4f, 0.2f, 0.3f); } internal void Landed() { //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_0046: Unknown result type (might be due to invalid IL or missing references) if (!(landedAt >= 0f)) { landedAt = age; if ((Object)(object)clam != (Object)null) { SpriteRenderer obj = clam; Bounds bounds = clam.sprite.bounds; obj.sprite = ZenSprites.Load("Spr_ClamOpen.png", ((Bounds)(ref bounds)).size.x); } } } private void Restore() { foreach (Renderer item in hidden) { if ((Object)(object)item != (Object)null) { item.enabled = true; } } hidden.Clear(); if ((Object)(object)Owner != (Object)null) { ZenUtil.NoShoot.Remove(Owner.playerID); } } private void OnDestroy() { Restore(); } private void Update() { //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_004e: 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_0069: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Owner == (Object)null || !ZenUtil.IsActive(Owner)) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } age += Time.deltaTime; Vector2 val = Vector2.op_Implicit(((Component)Owner).transform.position); if ((Object)(object)clam != (Object)null) { ((Component)clam).transform.position = Vector2.op_Implicit(val); } if (landedAt < 0f) { ZenUtil.SetVelocity(Owner, Vector2.down * 70f); if ((Object)(object)clam != (Object)null) { ((Component)clam).transform.rotation = Quaternion.Euler(0f, 0f, Mathf.Sin(age * 40f) * 4f); } int num; if (!Owner.data.isGrounded) { RaycastHit2D val2 = Physics2D.Raycast(val, Vector2.down, ZenUtil.HitRadius(Owner) + 0.3f, ZenUtil.GroundMask); num = (((Object)(object)((RaycastHit2D)(ref val2)).collider != (Object)null) ? 1 : 0); } else { num = 1; } startY = Mathf.Max(startY, val.y); if (num != 0 && ZenUtil.IsMine(Owner) && !slamSent) { slamSent = true; float num2 = Mathf.Clamp(startY - val.y, 0f, 15f); float damage = ((num2 < 4f) ? 0f : (Owner.data.health * (num2 / 15f))); ClamSlam.SendSlam(Owner, val, damage); } if (age > 4f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } else { if ((Object)(object)clam != (Object)null) { float num3 = age - landedAt; float num4 = 1f + Mathf.Sin(Mathf.Min(num3, 0.3f) / 0.3f * (float)Math.PI) * 0.3f; ((Component)clam).transform.localScale = new Vector3(num4, 2f - num4, 1f); ((Component)clam).transform.rotation = Quaternion.identity; } if (age - landedAt >= 1f) { ZenFx.Puff(Vector2.op_Implicit(val), ClamSlam.Pearl, 8, 4f, 0.2f, 0.3f); Object.Destroy((Object)(object)((Component)this).gameObject); } } } } public class AntiBlock : StackingEffect { public const float PierceFactor = 1.5f; public const float EnemyCooldownMult = 1.25f; internal static readonly Color Red = new Color(1f, 0.3f, 0.15f, 1f); private Player owner; private void Start() { owner = ((Component)this).GetComponentInParent<Player>(); if ((Object)(object)owner != (Object)null) { Apply(owner); } } private static void Apply(Player owner) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown foreach (Player player in PlayerManager.instance.players) { if (!((Object)(object)player == (Object)null) && player.teamID != owner.teamID) { Block block = player.data.block; int num = ((block.additionalBlocks > 0) ? 1 : 0); block.additionalBlocks -= num; block.cdMultiplier *= 1.25f; GameObject val = new GameObject("Zen_AntiBlockMark"); val.transform.SetParent(((Component)player).transform, false); AntiBlockMark antiBlockMark = val.AddComponent<AntiBlockMark>(); antiBlockMark.OwnerId = owner.playerID; antiBlockMark.BlocksTaken = num; player.data.stats.objectsAddedToPlayer.Add(val); } } } internal static void Undo(Player owner) { AntiBlockMark[] array = Object.FindObjectsOfType<AntiBlockMark>(); foreach (AntiBlockMark antiBlockMark in array) { if (!((Object)(object)antiBlockMark == (Object)null) && antiBlockMark.OwnerId == owner.playerID) { Player componentInParent = ((Component)antiBlockMark).GetComponentInParent<Player>(); if ((Object)(object)componentInParent != (Object)null) { Block block = componentInParent.data.block; block.additionalBlocks += antiBlockMark.BlocksTaken; Block block2 = componentInParent.data.block; block2.cdMultiplier /= 1.25f; componentInParent.data.stats.objectsAddedToPlayer.Remove(((Component)antiBlockMark).gameObject); } Object.Destroy((Object)(object)((Component)antiBlockMark).gameObject); } } } } public class AntiBlockMark : MonoBehaviour { public int OwnerId; public int BlocksTaken; } [HarmonyPatch(typeof(Block), "blocked")] internal class AntiBlockPiercePatch { private static void Prefix(Block __instance, GameObject projectile, Vector3 forward, Vector3 hitPos) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b4: 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