Please disclose if your mod was created primarily using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of sylwiisorb v1.8.2
Sylwi's Charm.dll
Decompiled 5 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("Sylwi's Charm")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Sylwi's Charm")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("565ae970-41fd-48cd-90e7-10edb1394458")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace SylwiisCharm; [BepInPlugin("com.miha.sylwiisorb", "Sylwiis Orb", "1.8.1")] public class SylwiisOrbPlugin : BaseUnityPlugin { private class OrbState { public GameObject orb; public Light orbLight; public bool isRushingOut = false; public Vector3 rushOutTarget; public Vector3 lastPlayerPos; public bool hasLastPlayerPos; public Vector3 currentVelocity = Vector3.zero; public float targetSpeed = 0f; public float noiseTimeX; public float noiseTimeY; public float noiseTimeZ; public float baseHeight = 2.3f; public float hoverRadius = 2.2f; public float minSeparation = 1.3f; public float pulseSpeed; public float pulseOffset; public float pulseStrength = 0.35f; public float spawnRushTimer = 0f; public float spawnRushSpeed = 10f; } private const KeyCode DefaultSummonKey = 289; private const float TeleportSnapDistance = 50f; private KeyCode summonKey = (KeyCode)289; private readonly Dictionary<ZDOID, OrbState> orbs = new Dictionary<ZDOID, OrbState>(); private const string RpcSpawn = "SylwiisOrb_Spawn"; private const string RpcDismiss = "SylwiisOrb_Dismiss"; private bool rpcsRegistered = false; private ZDOID localPlayerZDOID = ZDOID.None; private void Update() { //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0076: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_0207: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) if (!rpcsRegistered && ZRoutedRpc.instance != null) { RegisterRPCs(); rpcsRegistered = true; } if (IsTextInputFocused()) { return; } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null) { localPlayerZDOID = ((Character)localPlayer).GetZDOID(); if (((Character)localPlayer).IsDead()) { ImmediateDespawnOrb(localPlayerZDOID); } if (ZInput.GetKeyDown(summonKey, true)) { ZDOID val = localPlayerZDOID; OrbState value; bool flag = orbs.TryGetValue(val, out value) && (Object)(object)value.orb != (Object)null && !value.isRushingOut; int num = Random.Range(int.MinValue, int.MaxValue); if (!flag) { RPC_SpawnOrb(0L, val, num); if (ZRoutedRpc.instance != null) { ZPackage val2 = new ZPackage(); val2.Write(val); val2.Write(num); ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "SylwiisOrb_Spawn", new object[1] { val2 }); } } else { RPC_DismissOrb(0L, val, num); if (ZRoutedRpc.instance != null) { ZPackage val3 = new ZPackage(); val3.Write(val); val3.Write(num); ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "SylwiisOrb_Dismiss", new object[1] { val3 }); } } } } else { localPlayerZDOID = ZDOID.None; } List<Player> allPlayers = Player.GetAllPlayers(); foreach (KeyValuePair<ZDOID, OrbState> item in orbs.ToList()) { ZDOID ownerId = item.Key; OrbState value2 = item.Value; if ((Object)(object)value2.orb == (Object)null) { orbs.Remove(ownerId); continue; } Player val4 = ((IEnumerable<Player>)allPlayers).FirstOrDefault((Func<Player, bool>)((Player p) => ((Character)p).GetZDOID() == ownerId)); if ((Object)(object)val4 == (Object)null) { ImmediateDespawnOrb(ownerId); continue; } UpdateOrbMovement(value2, val4); UpdateOrbGlow(value2); } } private void RegisterRPCs() { ZRoutedRpc.instance.Register<ZPackage>("SylwiisOrb_Spawn", (Action<long, ZPackage>)delegate(long sender, ZPackage pkg) { //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_0011: Unknown result type (might be due to invalid IL or missing references) ZDOID ownerId2 = pkg.ReadZDOID(); int seed2 = pkg.ReadInt(); RPC_SpawnOrb(sender, ownerId2, seed2); }); ZRoutedRpc.instance.Register<ZPackage>("SylwiisOrb_Dismiss", (Action<long, ZPackage>)delegate(long sender, ZPackage pkg) { //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_0011: Unknown result type (might be due to invalid IL or missing references) ZDOID ownerId = pkg.ReadZDOID(); int seed = pkg.ReadInt(); RPC_DismissOrb(sender, ownerId, seed); }); ((BaseUnityPlugin)this).Logger.LogInfo((object)"SylwiisOrb: RPCs registered"); } private bool IsTextInputFocused() { if ((Object)(object)Chat.instance != (Object)null && Chat.instance.HasFocus()) { return true; } if (Console.IsVisible()) { return true; } return false; } private void ImmediateDespawnOrb(ZDOID ownerId) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (orbs.TryGetValue(ownerId, out var value)) { if ((Object)(object)value.orb != (Object)null) { Object.Destroy((Object)(object)value.orb); } orbs.Remove(ownerId); } } private void RPC_SpawnOrb(long sender, ZDOID ownerId, int seed) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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) Player val = ((IEnumerable<Player>)Player.GetAllPlayers()).FirstOrDefault((Func<Player, bool>)((Player p) => ((Character)p).GetZDOID() == ownerId)); if (!((Object)(object)val == (Object)null)) { if (!orbs.TryGetValue(ownerId, out var value)) { value = new OrbState(); orbs[ownerId] = value; } if (!((Object)(object)value.orb != (Object)null)) { SpawnOrb(value, val, seed); } } } private void RPC_DismissOrb(long sender, ZDOID ownerId, int seed) { //IL_0007: 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) if (orbs.TryGetValue(ownerId, out var value) && !((Object)(object)value.orb == (Object)null)) { StartRushOut(value, ownerId, seed); } } private void SpawnOrb(OrbState s, Player owner, int seed) { //IL_0018: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: 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_01fb: 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_020f: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Expected O, but got Unknown //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Expected O, but got Unknown //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Expected O, but got Unknown //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_04f5: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0581: Unknown result type (might be due to invalid IL or missing references) //IL_0591: Unknown result type (might be due to invalid IL or missing references) //IL_05b5: Unknown result type (might be due to invalid IL or missing references) //IL_05ba: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_05da: Unknown result type (might be due to invalid IL or missing references) //IL_05e7: Unknown result type (might be due to invalid IL or missing references) //IL_05ee: Unknown result type (might be due to invalid IL or missing references) //IL_05f5: Unknown result type (might be due to invalid IL or missing references) //IL_0601: Unknown result type (might be due to invalid IL or missing references) //IL_0606: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_0620: Unknown result type (might be due to invalid IL or missing references) //IL_0629: Unknown result type (might be due to invalid IL or missing references) //IL_0635: Unknown result type (might be due to invalid IL or missing references) //IL_063a: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Unknown result type (might be due to invalid IL or missing references) //IL_06b6: Unknown result type (might be due to invalid IL or missing references) //IL_06bb: Unknown result type (might be due to invalid IL or missing references) //IL_06be: Unknown result type (might be due to invalid IL or missing references) //IL_06c3: Unknown result type (might be due to invalid IL or missing references) //IL_06c7: Unknown result type (might be due to invalid IL or missing references) //IL_06cc: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06d3: Unknown result type (might be due to invalid IL or missing references) //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06de: Unknown result type (might be due to invalid IL or missing references) //IL_06e3: Unknown result type (might be due to invalid IL or missing references) //IL_0717: Unknown result type (might be due to invalid IL or missing references) //IL_0719: Unknown result type (might be due to invalid IL or missing references) //IL_071d: Unknown result type (might be due to invalid IL or missing references) //IL_0722: Unknown result type (might be due to invalid IL or missing references) //IL_0727: Unknown result type (might be due to invalid IL or missing references) //IL_072b: Unknown result type (might be due to invalid IL or missing references) //IL_0730: Unknown result type (might be due to invalid IL or missing references) //IL_0735: Unknown result type (might be due to invalid IL or missing references) //IL_0738: Unknown result type (might be due to invalid IL or missing references) //IL_073a: Unknown result type (might be due to invalid IL or missing references) //IL_078b: Unknown result type (might be due to invalid IL or missing references) //IL_0797: Unknown result type (might be due to invalid IL or missing references) //IL_07ae: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_0825: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) s.orb = GameObject.CreatePrimitive((PrimitiveType)0); s.orb.transform.localScale = Vector3.one * 0.3f; Collider component = s.orb.GetComponent<Collider>(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } s.orbLight = s.orb.AddComponent<Light>(); s.orbLight.type = (LightType)2; s.orbLight.color = Color.white; s.orbLight.intensity = 2f; s.orbLight.range = 8f; ParticleSystem val = s.orb.AddComponent<ParticleSystem>(); MainModule main = val.main; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.45f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0.15f); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(0.4f, 0.6f, 1f, 1f)); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; EmissionModule emission = val.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f); ((EmissionModule)(ref emission)).rateOverDistance = MinMaxCurve.op_Implicit(40f); ShapeModule shape = val.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).radius = 0.05f; ColorOverLifetimeModule colorOverLifetime = val.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val2 = new Gradient(); val2.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(new Color(0.4f, 0.6f, 1f, 1f), 0f), new GradientColorKey(new Color(0.4f, 0.6f, 1f, 1f), 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[2] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val2); SizeOverLifetimeModule sizeOverLifetime = val.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true; AnimationCurve val3 = new AnimationCurve(); val3.AddKey(0f, 1f); val3.AddKey(1f, 0f); ((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, val3); Renderer component2 = s.orb.GetComponent<Renderer>(); Material val4 = null; GameObject val5 = (((Object)(object)ZNetScene.instance != (Object)null) ? ZNetScene.instance.GetPrefab("staff_iceshard_projectile") : null); if ((Object)(object)val5 != (Object)null) { Renderer componentInChildren = val5.GetComponentInChildren<Renderer>(true); if ((Object)(object)componentInChildren != (Object)null && (Object)(object)componentInChildren.sharedMaterial != (Object)null) { val4 = componentInChildren.sharedMaterial; } } if ((Object)(object)val4 != (Object)null) { component2.material = new Material(val4); } else { Material material = component2.material; material.color = Color.black; if (material.HasProperty("_Metallic")) { material.SetFloat("_Metallic", 0f); } if (material.HasProperty("_Glossiness")) { material.SetFloat("_Glossiness", 0f); } Color val6 = default(Color); ((Color)(ref val6))..ctor(0.4f, 0.6f, 1f, 1f); material.EnableKeyword("_EMISSION"); material.SetColor("_EmissionColor", val6 * 20f); } GameObject val7 = GameObject.CreatePrimitive((PrimitiveType)0); val7.transform.SetParent(s.orb.transform); val7.transform.localPosition = Vector3.zero; val7.transform.localScale = s.orb.transform.localScale * 1.15f; MeshRenderer component3 = val7.GetComponent<MeshRenderer>(); Material val8 = new Material(component2.material); val8.color = new Color(val8.color.r, val8.color.g, val8.color.b, 0.25f); val8.SetColor("_EmissionColor", val8.color * 10f); val8.globalIlluminationFlags = (MaterialGlobalIlluminationFlags)1; val8.EnableKeyword("_EMISSION"); val8.SetInt("_SrcBlend", 5); val8.SetInt("_DstBlend", 1); val8.SetInt("_ZWrite", 0); val8.DisableKeyword("_ALPHATEST_ON"); val8.EnableKeyword("_ALPHABLEND_ON"); val8.renderQueue = 3000; ((Renderer)component3).material = val8; Object.Destroy((Object)(object)val7.GetComponent<Collider>()); DynamicGI.SetEmissive((Renderer)(object)component3, val8.color * 10f); Material material2 = component2.material; material2.SetFloat("_Mode", 3f); material2.SetInt("_SrcBlend", 5); material2.SetInt("_DstBlend", 10); material2.SetInt("_ZWrite", 0); material2.DisableKeyword("_ALPHATEST_ON"); material2.EnableKeyword("_ALPHABLEND_ON"); material2.DisableKeyword("_ALPHAPREMULTIPLY_ON"); material2.renderQueue = 3000; Color color = material2.color; color.a = 0.6f; material2.color = color; ParticleSystemRenderer component4 = ((Component)val).GetComponent<ParticleSystemRenderer>(); ((Renderer)component4).material = material2; component4.renderMode = (ParticleSystemRenderMode)0; MainModule main2 = val.main; ((MainModule)(ref main2)).startSize = new MinMaxCurve(0.05f, 0.15f); ((MainModule)(ref main2)).startLifetime = MinMaxCurve.op_Implicit(0.35f); ((MainModule)(ref main2)).startColor = MinMaxGradient.op_Implicit(new Color(color.r, color.g, color.b, 0.35f)); ((MainModule)(ref main2)).simulationSpace = (ParticleSystemSimulationSpace)1; EmissionModule emission2 = val.emission; ((EmissionModule)(ref emission2)).rateOverDistance = MinMaxCurve.op_Implicit(80f); ShapeModule shape2 = val.shape; ((ShapeModule)(ref shape2)).shapeType = (ParticleSystemShapeType)4; ((ShapeModule)(ref shape2)).radius = 0.15f; ((ShapeModule)(ref shape2)).angle = 15f; ((ShapeModule)(ref shape2)).position = new Vector3(0f, 0f, -0.15f); ParticleSystemRenderer component5 = ((Component)val).GetComponent<ParticleSystemRenderer>(); ((Renderer)component5).material = material2; component5.renderMode = (ParticleSystemRenderMode)0; component5.alignment = (ParticleSystemRenderSpace)1; component5.sortMode = (ParticleSystemSortMode)1; Random random = new Random(seed); Vector3 position = ((Component)owner).transform.position; Vector3 val9 = ((Character)owner).GetLookDir(); Vector3 normalized = ((Vector3)(ref val9)).normalized; val9 = Vector3.Cross(Vector3.up, normalized); Vector3 normalized2 = ((Vector3)(ref val9)).normalized; float num = Mathf.Lerp(100f, 150f, (float)random.NextDouble()); float num2 = Mathf.Lerp(-20f, 20f, (float)random.NextDouble()); Vector3 val10 = position + normalized * num + normalized2 * num2; float groundY = GetGroundY(val10, position.y); s.baseHeight = 2.3f; s.hoverRadius = 2.2f; s.minSeparation = 1.3f; float num3 = s.baseHeight + Mathf.Lerp(-0.3f, 0.3f, (float)random.NextDouble()); Vector3 position2 = default(Vector3); ((Vector3)(ref position2))..ctor(val10.x, groundY + num3, val10.z); s.orb.transform.position = position2; s.spawnRushTimer = Mathf.Lerp(2f, 3f, (float)random.NextDouble()); s.spawnRushSpeed = num / Mathf.Max(0.8f, s.spawnRushTimer); s.noiseTimeX = Random.value * 100f; s.noiseTimeY = Random.value * 100f; s.noiseTimeZ = Random.value * 100f; s.currentVelocity = Vector3.zero; s.targetSpeed = 0f; s.hasLastPlayerPos = false; s.pulseSpeed = Mathf.Lerp(0.6f, 1.2f, (float)random.NextDouble()); s.pulseOffset = Mathf.Lerp(0f, (float)Math.PI * 2f, (float)random.NextDouble()); s.pulseStrength = 0.35f; s.isRushingOut = false; } private void StartRushOut(OrbState s, ZDOID ownerId, int seed) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_00bd: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)s.orb == (Object)null)) { Player val = ((IEnumerable<Player>)Player.GetAllPlayers()).FirstOrDefault((Func<Player, bool>)((Player p) => ((Character)p).GetZDOID() == ownerId)); if (!((Object)(object)val == (Object)null)) { s.isRushingOut = true; Random random = new Random(seed); double num = Math.PI * 2.0 * random.NextDouble(); float num2 = 120f; Vector2 val2 = new Vector2((float)Math.Cos(num), (float)Math.Sin(num)) * num2; Vector3 rushOutTarget = ((Component)val).transform.position + new Vector3(val2.x, 0f, val2.y); s.rushOutTarget = rushOutTarget; s.rushOutTarget.y = GetGroundY(s.rushOutTarget, ((Component)val).transform.position.y) + s.baseHeight; float num3 = s.spawnRushSpeed * 0.6f; float num4 = Vector3.Distance(s.orb.transform.position, s.rushOutTarget); s.spawnRushTimer = num4 / Mathf.Max(0.8f, num4 / num3); s.spawnRushSpeed = num3; } } } private void UpdateOrbMovement(OrbState s, Player owner) { //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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //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_004d: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0074: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_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_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: 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_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_00fd: 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_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_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: 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) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_042d: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)s.orb == (Object)null) { return; } float deltaTime = Time.deltaTime; Vector3 position = ((Component)owner).transform.position; float groundY = GetGroundY(new Vector3(position.x, 0f, position.z), position.y); Vector3 val = new Vector3(position.x, groundY, position.z) + Vector3.up * s.baseHeight; float num = Vector3.Distance(s.orb.transform.position, val); if (num > 50f && s.spawnRushTimer <= 0f && !s.isRushingOut) { s.orb.transform.position = val; s.currentVelocity = Vector3.zero; s.targetSpeed = 0f; s.lastPlayerPos = val; return; } Vector3 val2 = Vector3.zero; if (s.hasLastPlayerPos) { val2 = (position - s.lastPlayerPos) / Mathf.Max(deltaTime, 0.0001f); } s.lastPlayerPos = position; s.hasLastPlayerPos = true; float magnitude = ((Vector3)(ref val2)).magnitude; Vector3 val3 = val; s.noiseTimeX += deltaTime * 0.25f; s.noiseTimeY += deltaTime * 0.25f; s.noiseTimeZ += deltaTime * 0.25f; Vector3 val4 = new Vector3((Mathf.PerlinNoise(s.noiseTimeX, 0f) - 0.5f) * 2f, (Mathf.PerlinNoise(s.noiseTimeY, 1f) - 0.5f) * 2f, (Mathf.PerlinNoise(s.noiseTimeZ, 2f) - 0.5f) * 2f) * s.hoverRadius; Vector3 val5 = val3 + val4; float num2 = Mathf.Max(3f, magnitude + 2.5f); bool flag = s.spawnRushTimer > 0f; if (flag) { num2 = s.spawnRushSpeed; s.spawnRushTimer -= deltaTime; } s.targetSpeed = Mathf.Lerp(s.targetSpeed, num2, deltaTime * 2f); Vector3 val6 = Vector3.SmoothDamp(s.orb.transform.position, val5, ref s.currentVelocity, 0.25f, s.targetSpeed); if (s.isRushingOut) { Vector3 val7 = s.rushOutTarget - s.orb.transform.position; Vector3 normalized = ((Vector3)(ref val7)).normalized; val6 = s.orb.transform.position + normalized * s.spawnRushSpeed * deltaTime; float groundY2 = GetGroundY(new Vector3(val6.x, 0f, val6.z), position.y); float num3 = groundY2 + s.baseHeight - 0.2f; if (val6.y < num3) { val6.y = num3; } if (Vector3.Distance(val6, s.rushOutTarget) < 1f) { Object.Destroy((Object)(object)s.orb); s.orb = null; s.isRushingOut = false; return; } } if (flag) { float num4 = groundY + s.baseHeight - 0.2f; if (val6.y < num4) { val6.y = num4; } } Vector3 val8 = position + Vector3.up * (s.baseHeight - 0.4f); Vector3 val9 = val6 - val8; float magnitude2 = ((Vector3)(ref val9)).magnitude; if (magnitude2 < s.minSeparation) { Vector3 val10 = ((magnitude2 > 0.001f) ? ((Vector3)(ref val9)).normalized : Vector3.up); val6 = val8 + val10 * s.minSeparation; } float groundY3 = GetGroundY(new Vector3(val6.x, 0f, val6.z), position.y); float num5 = groundY3 + 0.2f; if (val6.y < num5) { val6.y = num5; } s.orb.transform.position = val6; s.orb.transform.Rotate(0f, 25f * deltaTime, 0f, (Space)0); } private void UpdateOrbGlow(OrbState s) { if (!((Object)(object)s.orbLight == (Object)null)) { float num = Mathf.Sin(Time.time * s.pulseSpeed + s.pulseOffset) * s.pulseStrength + 1f; s.orbLight.intensity = 2f * num; } } private float GetGroundY(Vector3 xzPos, float fallbackY) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_0095: 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_00a2: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) float result = fallbackY; if ((Object)(object)ZoneSystem.instance != (Object)null) { try { result = ZoneSystem.instance.GetGroundHeight(xzPos); } catch { Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(xzPos.x, fallbackY + 200f, xzPos.z); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, 400f, LayerMask.GetMask(new string[2] { "terrain", "Default" }))) { result = ((RaycastHit)(ref val2)).point.y; } } } else { Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(xzPos.x, fallbackY + 200f, xzPos.z); RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(val3, Vector3.down, ref val4, 400f, LayerMask.GetMask(new string[2] { "terrain", "Default" }))) { result = ((RaycastHit)(ref val4)).point.y; } } return result; } }