using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using REPOLib.Modules; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyCompany("Matsu.MergedEnemyMod")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion("1.1.0")] [assembly: AssemblyProduct("Matsu.MergedEnemyMod")] [assembly: AssemblyTitle("Matsu.MergedEnemyMod")] [assembly: AssemblyVersion("1.1.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Matsu.MergedEnemyMod { internal static class FusionShared { private static ParticleScriptExplosion? _sharedExplosion; private static GameObject? _explosionPrefab; private static readonly List _noPlayers = new List(); private static FieldInfo? _healthCurrentField; private static FieldInfo? _impactDetectorField; private static MethodInfo? _hurtMultiplierMethod; private static FieldInfo? _explSizeField; private static FieldInfo? _explDmgField; private static FieldInfo? _explDmgEnemyField; private const string AuraLightName = "MatsuMutationAura"; private static PropertyInfo? _navAgentProp; private static FieldInfo? _navAgentField; private static MethodInfo? _navDisableMethod; private static FieldInfo? _wrapAgentField; private static FieldInfo? _damageResistanceField; private static FieldInfo? _damageResistanceTimerField; private static FieldInfo? _tumbleField; private static FieldInfo? _tumblePhysGrabObjectField; private static FieldInfo? _clientPositionField; private static FieldInfo? _clientPositionCurrentField; private static FieldInfo? _visualPositionField; private static FieldInfo? _isDisabledField; public static List AllPlayers() { GameDirector instance = GameDirector.instance; if (!((Object)(object)instance != (Object)null) || instance.PlayerList == null) { return _noPlayers; } return instance.PlayerList; } public static bool NearestPlayerWithin(Vector3 from, float range) { //IL_001e: 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) foreach (PlayerAvatar item in AllPlayers()) { if (!((Object)(object)item == (Object)null) && Vector3.Distance(from, ((Component)item).transform.position) <= range) { return true; } } return false; } public static List PlayersInRadius(Vector3 center, float radius) { //IL_0024: 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) List list = new List(); foreach (PlayerAvatar item in AllPlayers()) { if (!((Object)(object)item == (Object)null) && Vector3.Distance(center, ((Component)item).transform.position) <= radius) { list.Add(item); } } return list; } public static PlayerAvatar? NearestPlayer(Vector3 from, float maxDistance) { //IL_0022: 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) PlayerAvatar result = null; float num = maxDistance; foreach (PlayerAvatar item in AllPlayers()) { if (!((Object)(object)item == (Object)null)) { float num2 = Vector3.Distance(from, ((Component)item).transform.position); if (num2 <= num) { num = num2; result = item; } } } return result; } public static List PhysObjectsInRadius(Vector3 center, float radius) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) HashSet hashSet = new HashSet(); Collider[] array = Physics.OverlapSphere(center, radius); foreach (Collider val in array) { if (!((Object)(object)val == (Object)null)) { PhysGrabObject componentInParent = ((Component)val).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.rb != (Object)null && !componentInParent.grabbed && (Object)(object)((Component)componentInParent).GetComponentInParent() == (Object)null) { hashSet.Add(componentInParent); } } } return new List(hashSet); } private static void SetExplField(ParticlePrefabExplosion pe, ref FieldInfo? cache, string name, object val) { try { if ((object)cache == null) { cache = typeof(ParticlePrefabExplosion).GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } cache?.SetValue(pe, val); } catch { } } public static ParticlePrefabExplosion? ExplodeAuthoritative(Vector3 pos, float size, int playerDmg, int enemyDmg, PhysGrabObject? ignoreSelf = null, Enemy? enemyHost = null, float force = 1f) { //IL_002c: 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_0084: Unknown result type (might be due to invalid IL or missing references) ParticlePrefabExplosion val = null; if ((Object)(object)_sharedExplosion == (Object)null) { _sharedExplosion = Object.FindObjectOfType(true); } if ((Object)(object)_sharedExplosion != (Object)null) { try { val = _sharedExplosion.Spawn(pos, size, playerDmg, enemyDmg, force, false, false, 1f); } catch { val = null; } } if ((Object)(object)val == (Object)null) { if ((Object)(object)_explosionPrefab == (Object)null) { _explosionPrefab = Resources.Load("Effects/Part Prefab Explosion"); } if ((Object)(object)_explosionPrefab != (Object)null) { val = Object.Instantiate(_explosionPrefab, pos, Quaternion.identity).GetComponent(); if ((Object)(object)val != (Object)null) { SetExplField(val, ref _explSizeField, "explosionSize", size); SetExplField(val, ref _explDmgField, "explosionDamage", playerDmg); SetExplField(val, ref _explDmgEnemyField, "explosionDamageEnemy", enemyDmg); try { ParticleSystem particleFire = val.particleFire; if (particleFire != null) { particleFire.Play(); } ParticleSystem particleSmoke = val.particleSmoke; if (particleSmoke != null) { particleSmoke.Play(); } if ((Object)(object)val.light != (Object)null) { ((Behaviour)val.light).enabled = true; } } catch { } } } } if ((Object)(object)val != (Object)null && (Object)(object)val.HurtCollider != (Object)null) { try { if ((Object)(object)ignoreSelf != (Object)null && val.HurtCollider.ignoreObjects != null) { val.HurtCollider.ignoreObjects.Add(ignoreSelf); } if ((Object)(object)enemyHost != (Object)null) { val.HurtCollider.enemyHost = enemyHost; } } catch { } } return val; } public static void ApplyMutationGlow(Transform root, Color color) { //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_00c2: 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_0040: 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_006e: 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_0152: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)root == (Object)null) { return; } try { Transform val = root.Find("MatsuMutationAura"); Light val2; if ((Object)(object)val != (Object)null) { val2 = ((Component)val).GetComponent(); } else { GameObject val3 = new GameObject("MatsuMutationAura"); val3.transform.SetParent(root, false); val3.transform.localPosition = Vector3.zero; val2 = val3.AddComponent(); val2.type = (LightType)2; val2.shadows = (LightShadows)0; } if ((Object)(object)val2 != (Object)null) { val2.color = color; val2.range = Plugin.MutationAuraRange.Value; val2.intensity = Plugin.MutationAuraIntensity.Value; val2.renderMode = (LightRenderMode)1; } } catch { } float num = Mathf.Max(1f, Plugin.MutationAuraIntensity.Value * 0.6f); Color val4 = color * num; Renderer[] componentsInChildren = ((Component)root).GetComponentsInChildren(true); foreach (Renderer val5 in componentsInChildren) { if ((Object)(object)val5 == (Object)null || ((Object)((Component)val5).gameObject).name == "MatsuMutationAura") { continue; } Material[] materials = val5.materials; foreach (Material val6 in materials) { if ((Object)(object)val6 == (Object)null) { continue; } try { if (val6.HasProperty("_EmissionColor")) { val6.EnableKeyword("_EMISSION"); val6.globalIlluminationFlags = (MaterialGlobalIlluminationFlags)1; val6.SetColor("_EmissionColor", val4); } val6.SetFloat("_FresnelAmount", 1f); val6.SetFloat("_FresnelScale", 1f); val6.SetFloat("_FresnelPower", 5f); val6.SetFloat("_FresnelBias", 0f); val6.SetColor("_FresnelColor", color); val6.SetFloat("_FresnelEmission", 1f); } catch { } } } } public static void SetHealthCurrent(EnemyHealth health, int value) { try { if (_healthCurrentField == null) { _healthCurrentField = typeof(EnemyHealth).GetField("healthCurrent", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } _healthCurrentField?.SetValue(health, value); } catch { } } public static void ProtectValuable(PhysGrabObject pgo, float seconds) { try { if (pgo != null) { pgo.OverrideIndestructible(Mathf.Max(0.1f, seconds)); } } catch { } } public static void ExplodePlayerOnly(Vector3 pos, float size, int playerDamage, float force, Enemy? source = null) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) ParticlePrefabExplosion val = ExplodeAuthoritative(pos, size, playerDamage, 0, null, source, force); try { if ((Object)(object)val == (Object)null || (Object)(object)val.HurtCollider == (Object)null || val.HurtCollider.ignoreObjects == null) { return; } EnemyDirector instance = EnemyDirector.instance; if ((Object)(object)instance == (Object)null || instance.enemiesSpawned == null) { return; } foreach (EnemyParent item2 in instance.enemiesSpawned) { if (!((Object)(object)item2 == (Object)null)) { PhysGrabObject[] componentsInChildren = ((Component)item2).GetComponentsInChildren(true); foreach (PhysGrabObject item in componentsInChildren) { val.HurtCollider.ignoreObjects.Add(item); } } } } catch { } } public static void ExplodeGrenadePlayerOnly(Vector3 pos) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) ExplodePlayerOnly(pos, 0.8f, 50, 2f); } public static void FreezeAgent(Enemy enemy) { try { if ((Object)(object)enemy == (Object)null) { return; } object obj = null; if ((object)_navAgentProp == null) { _navAgentProp = typeof(Enemy).GetProperty("NavMeshAgent", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (_navAgentProp != null) { obj = _navAgentProp.GetValue(enemy); } if (obj == null) { if ((object)_navAgentField == null) { _navAgentField = typeof(Enemy).GetField("NavMeshAgent", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } obj = _navAgentField?.GetValue(enemy); } if (obj != null) { if ((object)_navDisableMethod == null) { _navDisableMethod = obj.GetType().GetMethod("Disable", new Type[1] { typeof(float) }); } _navDisableMethod?.Invoke(obj, new object[1] { 0.3f }); } } catch { } } public static NavMeshAgent? GetUnityAgent(Enemy? enemy) { try { if ((Object)(object)enemy == (Object)null) { return null; } object obj = null; if ((object)_navAgentProp == null) { _navAgentProp = typeof(Enemy).GetProperty("NavMeshAgent", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (_navAgentProp != null) { obj = _navAgentProp.GetValue(enemy); } if (obj == null) { if ((object)_navAgentField == null) { _navAgentField = typeof(Enemy).GetField("NavMeshAgent", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } obj = _navAgentField?.GetValue(enemy); } if (obj == null) { return null; } NavMeshAgent val = (NavMeshAgent)((obj is NavMeshAgent) ? obj : null); if (val != null) { return val; } if (_wrapAgentField == null) { FieldInfo[] fields = obj.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); foreach (FieldInfo fieldInfo in fields) { if (typeof(NavMeshAgent).IsAssignableFrom(fieldInfo.FieldType)) { _wrapAgentField = fieldInfo; break; } } } object? obj2 = _wrapAgentField?.GetValue(obj); return (NavMeshAgent?)((obj2 is NavMeshAgent) ? obj2 : null); } catch { return null; } } public static int GetHealthCurrent(EnemyHealth health) { try { if (_healthCurrentField == null) { _healthCurrentField = typeof(EnemyHealth).GetField("healthCurrent", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } return (_healthCurrentField != null) ? ((int)(_healthCurrentField.GetValue(health) ?? ((object)0))) : 0; } catch { return 0; } } public static void ApplyDamageResistanceAtLeast(EnemyHealth health, float resistance, float seconds) { try { if (!((Object)(object)health == (Object)null)) { if ((object)_damageResistanceField == null) { _damageResistanceField = typeof(EnemyHealth).GetField("damageResistance", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if ((object)_damageResistanceTimerField == null) { _damageResistanceTimerField = typeof(EnemyHealth).GetField("overrideDamageResistanceTimer", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } float num = (float)(_damageResistanceField?.GetValue(health) ?? ((object)0f)); float num2 = (float)(_damageResistanceTimerField?.GetValue(health) ?? ((object)0f)); health.OverrideDamageResistance(Mathf.Max(num, Mathf.Clamp(resistance, 0f, 0.9f)), Mathf.Max(num2, Mathf.Max(0.1f, seconds))); } } catch { } } public static void BoostThrownImpact(PhysGrabObject obj, float multiplier, float time) { try { if (_impactDetectorField == null) { _impactDetectorField = typeof(PhysGrabObject).GetField("impactDetector", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } object obj2 = _impactDetectorField?.GetValue(obj); if (obj2 != null) { if (_hurtMultiplierMethod == null) { _hurtMultiplierMethod = obj2.GetType().GetMethod("PlayerHurtMultiplier", BindingFlags.Instance | BindingFlags.Public); } _hurtMultiplierMethod?.Invoke(obj2, new object[2] { multiplier, time }); } } catch { } } public static bool TryGetSafeRandomPoint(Vector3 from, out Vector3 point) { //IL_001b: 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_00c7: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) int mask = LayerMask.GetMask(new string[1] { "Default" }); NavMeshHit val2 = default(NavMeshHit); RaycastHit val3 = default(RaycastHit); for (int i = 0; i < 16; i++) { LevelPoint val = SemiFunc.LevelPointGet(from, 0f, 9999f); if (!((Object)(object)val == (Object)null) && NavMesh.SamplePosition(((Component)val).transform.position + Random.insideUnitSphere * 3f, ref val2, 5f, -1) && Physics.Raycast(((NavMeshHit)(ref val2)).position + Vector3.up * 0.5f, Vector3.down, ref val3, 3f, mask, (QueryTriggerInteraction)1)) { point = ((RaycastHit)(ref val3)).point + Vector3.up * 0.6f; return true; } } point = from; return false; } public static PhysGrabObject? GetPlayerPhysGrabObject(PlayerAvatar player) { try { if ((object)_tumbleField == null) { _tumbleField = typeof(PlayerAvatar).GetField("tumble", BindingFlags.Instance | BindingFlags.NonPublic); } object obj = _tumbleField?.GetValue(player); if (obj == null) { return null; } if ((object)_tumblePhysGrabObjectField == null) { _tumblePhysGrabObjectField = obj.GetType().GetField("physGrabObject", BindingFlags.Instance | BindingFlags.NonPublic); } object? obj2 = _tumblePhysGrabObjectField?.GetValue(obj); return (PhysGrabObject?)((obj2 is PhysGrabObject) ? obj2 : null); } catch { return null; } } public static void SetPlayerClientPosition(PlayerAvatar player, Vector3 pos) { //IL_0050: 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) try { if ((object)_clientPositionField == null) { _clientPositionField = typeof(PlayerAvatar).GetField("clientPosition", BindingFlags.Instance | BindingFlags.NonPublic); } if ((object)_clientPositionCurrentField == null) { _clientPositionCurrentField = typeof(PlayerAvatar).GetField("clientPositionCurrent", BindingFlags.Instance | BindingFlags.NonPublic); } _clientPositionField?.SetValue(player, pos); _clientPositionCurrentField?.SetValue(player, pos); } catch { } } public static void SetPlayerVisualPosition(PlayerAvatarVisuals visuals, Vector3 pos) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) try { if ((object)_visualPositionField == null) { _visualPositionField = typeof(PlayerAvatarVisuals).GetField("visualPosition", BindingFlags.Instance | BindingFlags.NonPublic); } _visualPositionField?.SetValue(visuals, pos); } catch { } } public static bool IsPlayerDisabled(PlayerAvatar player) { try { if ((object)_isDisabledField == null) { _isDisabledField = typeof(PlayerAvatar).GetField("isDisabled", BindingFlags.Instance | BindingFlags.NonPublic); } return _isDisabledField != null && (bool)(_isDisabledField.GetValue(player) ?? ((object)false)); } catch { return false; } } public static bool IsLocalPlayer(PlayerAvatar player) { if ((Object)(object)player != (Object)null) { if (SemiFunc.IsMultiplayer()) { if ((Object)(object)player.photonView != (Object)null) { return player.photonView.IsMine; } return false; } return true; } return false; } public static void HurtOwnedPlayer(PlayerAvatar player, int damage, Vector3 source, Enemy? enemy = null) { if ((Object)(object)player == (Object)null || damage <= 0 || !IsLocalPlayer(player) || IsPlayerDisabled(player)) { return; } int num = -1; try { EnemyParent val = (((Object)(object)enemy != (Object)null) ? ((Component)enemy).GetComponentInParent() : null); if ((Object)(object)val != (Object)null && (Object)(object)EnemyDirector.instance != (Object)null) { num = EnemyDirector.instance.enemiesSpawned.IndexOf(val); } } catch { } try { PlayerHealth playerHealth = player.playerHealth; if (playerHealth != null) { playerHealth.Hurt(damage, false, num, false); } } catch { } } public static float DistanceToSegment(Vector3 point, Vector3 start, Vector3 end) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_0022: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0018: 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) Vector3 val = end - start; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude < 0.0001f) { return Vector3.Distance(point, start); } float num = Mathf.Clamp01(Vector3.Dot(point - start, val) / sqrMagnitude); return Vector3.Distance(point, start + val * num); } public static void SpawnWarningRing(Vector3 position, Color color, float startRadius, float endRadius, float seconds) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_00e1: 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) try { GameObject val = new GameObject("MatsuMutationWarningRing"); val.transform.position = position + Vector3.up * 0.06f; LineRenderer val2 = val.AddComponent(); val2.useWorldSpace = false; val2.loop = true; val2.positionCount = 49; val2.widthMultiplier = 0.065f; ((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val2).receiveShadows = false; for (int i = 0; i < val2.positionCount; i++) { float num = (float)i / 48f * (float)Math.PI * 2f; val2.SetPosition(i, new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num))); } Shader val3 = Shader.Find("Sprites/Default") ?? Shader.Find("Legacy Shaders/Particles/Alpha Blended") ?? Shader.Find("Unlit/Color"); Material val4 = ((!((Object)(object)val3 != (Object)null)) ? ((Material)null) : new Material(val3)); if ((Object)(object)val4 != (Object)null) { ((Renderer)val2).material = val4; } val.AddComponent().Initialize(val2, val4, color, Mathf.Max(0.05f, startRadius), Mathf.Max(0.05f, endRadius), Mathf.Max(0.05f, seconds)); } catch { } } public static Vector3 ProjectToGround(Vector3 position) { //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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_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_0059: 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_0063: Unknown result type (might be due to invalid IL or missing references) try { int mask = LayerMask.GetMask(new string[1] { "Default" }); RaycastHit val = default(RaycastHit); if (Physics.Raycast(position + Vector3.up * 4f, Vector3.down, ref val, 10f, mask, (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref val)).point + Vector3.up * 0.08f; } } catch { } return position; } } public class MutationWarningRing : MonoBehaviour { private LineRenderer? _line; private Material? _material; private Color _color; private float _startRadius; private float _endRadius; private float _duration; private float _elapsed; public void Initialize(LineRenderer line, Material? material, Color color, float startRadius, float endRadius, float duration) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) _line = line; _material = material; _color = color; _startRadius = startRadius; _endRadius = endRadius; _duration = duration; Apply(0f); } private void Update() { _elapsed += Time.deltaTime; float num = Mathf.Clamp01(_elapsed / _duration); Apply(num); if (num >= 1f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void Apply(float t) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_line == (Object)null)) { float num = Mathf.Lerp(_startRadius, _endRadius, t); ((Component)this).transform.localScale = new Vector3(num, 1f, num); Color val = default(Color); ((Color)(ref val))..ctor(_color.r, _color.g, _color.b, Mathf.Lerp(0.95f, 0.05f, t)); _line.startColor = val; _line.endColor = val; } } private void OnDestroy() { if ((Object)(object)_material != (Object)null) { Object.Destroy((Object)(object)_material); } } } public class BoomdayBoyFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(1f, 0.4f, 0f); private EnemyBirthdayBoy _birthday; private EnemyHealth? _health; private EnemyParent? _self; private Enemy? _enemy; private PhysGrabObject? _selfPhys; private PhotonView? _pv; private bool _fuseLit; private bool _deathDetonated; private bool _hpDone; private float _fuseTimer; private float _explodeCooldown; private float _balloonTimer; private float _proximityTimer; private float _glowTimer; private readonly List _orderedKeys = new List(); private readonly HashSet _seen = new HashSet(); private void Awake() { //IL_00b4: Unknown result type (might be due to invalid IL or missing references) _birthday = ((Component)this).GetComponent(); _self = ((Component)this).GetComponentInParent(); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _enemy = ((Component)this).GetComponent() ?? ((Component)this).GetComponentInParent(); _selfPhys = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(true); _pv = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } _balloonTimer -= Time.deltaTime; if (_balloonTimer <= 0f) { _balloonTimer = 0.2f; SyncAndTintBalloons(); } if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } EnsureHpDoubled(); if (_deathDetonated || (Object)(object)_birthday == (Object)null) { return; } HostBalloonContacts(); if (_explodeCooldown > 0f) { _explodeCooldown -= Time.deltaTime; } _proximityTimer -= Time.deltaTime; if (!_fuseLit && _explodeCooldown <= 0f && _proximityTimer <= 0f) { _proximityTimer = 0.25f; if (FusionShared.NearestPlayerWithin(((Component)this).transform.position, Plugin.BoomdayFuseRange.Value)) { _fuseLit = true; _fuseTimer = Plugin.BoomdayFuseTime.Value; } } if (_fuseLit) { _fuseTimer -= Time.deltaTime; if (_fuseTimer <= 0f) { ProximityExplode(); } } } private void EnsureHpDoubled() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } private void SyncAndTintBalloons() { //IL_004e: 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) if ((Object)(object)_birthday == (Object)null || _birthday.balloons == null) { return; } foreach (KeyValuePair balloon in _birthday.balloons) { if (!((Object)(object)balloon.Value == (Object)null) && _seen.Add(balloon.Key)) { _orderedKeys.Add(balloon.Key); TintBalloon(balloon.Value); } } } private void HostBalloonContacts() { //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_005a: 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_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_0090: 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_009d: 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_00b0: 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_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_0111: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_birthday == (Object)null || _birthday.balloons == null || _orderedKeys.Count == 0) { return; } float value = Plugin.BoomdayBalloonTouchRadius.Value; List list = null; foreach (Vector3 orderedKey in _orderedKeys) { if (!_birthday.balloons.TryGetValue(orderedKey, out var value2) || (Object)(object)value2 == (Object)null) { (list ?? (list = new List())).Add(orderedKey); continue; } Vector3 position = value2.transform.position; if (AnyPlayerWithin(position, value)) { ExplodeBalloon(value2, position); (list ?? (list = new List())).Add(orderedKey); } else if (AnyOtherEnemyWithin(position, value)) { PopBalloon(value2, position); (list ?? (list = new List())).Add(orderedKey); } } if (list == null) { return; } foreach (Vector3 item in list) { ForgetBalloon(item); } } private static bool AnyPlayerWithin(Vector3 pos, float radius) { //IL_001e: 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) foreach (PlayerAvatar item in FusionShared.AllPlayers()) { if (!((Object)(object)item == (Object)null) && Vector3.Distance(pos, ((Component)item).transform.position) <= radius) { return true; } } return false; } private bool AnyOtherEnemyWithin(Vector3 pos, float radius) { //IL_0046: 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) EnemyDirector instance = EnemyDirector.instance; if ((Object)(object)instance == (Object)null || instance.enemiesSpawned == null) { return false; } foreach (EnemyParent item in instance.enemiesSpawned) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item == (Object)(object)_self) && Vector3.Distance(pos, ((Component)item).transform.position) <= radius) { return true; } } return false; } private void ProximityExplode() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("BoomdayExplodeRPC", (RpcTarget)0, new object[3] { ((Component)this).transform.position, 1.3f, Plugin.BoomdayCoreDamage.Value }); } else { BoomdayExplodeRPC(((Component)this).transform.position, 1.3f, Plugin.BoomdayCoreDamage.Value); } AggroNearestPlayer(); StartBalloonChain(); _fuseLit = false; _explodeCooldown = Plugin.BoomdayExplodeCooldown.Value; } public void Detonate() { //IL_0077: 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) if (!_deathDetonated) { _deathDetonated = true; if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("BoomdayExplodeRPC", (RpcTarget)0, new object[3] { ((Component)this).transform.position, 1.6f, Plugin.BoomdayCoreDamage.Value }); } else { BoomdayExplodeRPC(((Component)this).transform.position, 1.6f, Plugin.BoomdayCoreDamage.Value); } StartBalloonChain(); } } [PunRPC] private void BoomdayExplodeRPC(Vector3 pos, float size, int damage) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) try { FusionShared.ExplodeAuthoritative(pos, size, damage, 0, _selfPhys, _enemy); } catch { } } public void ExplodeBalloonAt(Vector3 pos) { //IL_0056: 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) if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("BoomdayExplodeRPC", (RpcTarget)0, new object[3] { pos, 0.7f, Plugin.BoomdayBalloonDamage.Value }); } else { BoomdayExplodeRPC(pos, 0.7f, Plugin.BoomdayBalloonDamage.Value); } } private void AggroNearestPlayer() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) try { if (!((Object)(object)_birthday == (Object)null)) { PlayerAvatar val = FusionShared.NearestPlayer(((Component)this).transform.position, Plugin.BoomdayFuseRange.Value * 3f); if (!((Object)(object)val == (Object)null)) { _birthday.playerTarget = val; _birthday.UpdateState((State)6); } } } catch { } } private void StartBalloonChain() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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) if ((Object)(object)_birthday == (Object)null || _orderedKeys.Count == 0) { return; } List list = new List(); foreach (Vector3 orderedKey in _orderedKeys) { if (_birthday.balloons != null && _birthday.balloons.TryGetValue(orderedKey, out var value) && (Object)(object)value != (Object)null) { list.Add(value); _birthday.balloons.Remove(orderedKey); } } _orderedKeys.Clear(); _seen.Clear(); Plugin.Instance.StartBalloonChain(list, Plugin.BoomdayBalloonDamage.Value, ((Object)(object)_birthday != (Object)null) ? _birthday.balloonPopEffect : null, _pv); } private void ForgetBalloon(Vector3 key) { //IL_0017: 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_0031: Unknown result type (might be due to invalid IL or missing references) _birthday?.balloons?.Remove(key); _orderedKeys.Remove(key); _seen.Remove(key); } private void ExplodeBalloon(GameObject balloon, Vector3 bp) { //IL_0057: 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_0029: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("BoomdayExplodeRPC", (RpcTarget)0, new object[3] { bp, 0.7f, Plugin.BoomdayBalloonDamage.Value }); } else { BoomdayExplodeRPC(bp, 0.7f, Plugin.BoomdayBalloonDamage.Value); } BroadcastBoomdayVfx(bp, hasBalloonPop: true); Object.Destroy((Object)(object)balloon); } private void PopBalloon(GameObject balloon, Vector3 bp) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) BroadcastBoomdayVfx(bp, hasBalloonPop: true); Object.Destroy((Object)(object)balloon); } private void BroadcastBoomdayVfx(Vector3 pos, bool hasBalloonPop) { //IL_003b: 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) if (hasBalloonPop) { if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("BoomdayVfxRPC", (RpcTarget)0, new object[1] { pos }); } else { BoomdayVfxRPC(pos); } } } [PunRPC] private void BoomdayVfxRPC(Vector3 pos) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)_birthday != (Object)null && (Object)(object)_birthday.balloonPopEffect != (Object)null) { Object.Instantiate(_birthday.balloonPopEffect, pos, Quaternion.identity); } } catch { } } private void TintBalloon(GameObject balloon) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = balloon.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if (!((Object)(object)val == (Object)null)) { MaterialPropertyBlock val2 = new MaterialPropertyBlock(); val.GetPropertyBlock(val2); val2.SetColor("_Color", new Color(1f, 0.45f, 0f)); val2.SetColor("_EmissionColor", new Color(1f, 0.35f, 0f) * 1.5f); val.SetPropertyBlock(val2); } } } } public class PoltergeistFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(0.35f, 0.8f, 1f); private EnemyHealth? _health; private bool _hpDone; private float _throwCooldown; private float _playerFloatCooldown; private float _fieldTimer; private float _glowTimer; private float _inversionCooldown; private float _inversionUntil; private bool _inversionWasActive; private GameObject? _fieldSphere; private PhotonView? _pv; private Enemy? _enemy; private void Awake() { //IL_007b: Unknown result type (might be due to invalid IL or missing references) _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _pv = ((Component)this).GetComponent(); _enemy = ((Component)this).GetComponent() ?? ((Component)this).GetComponentInParent(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); _throwCooldown = Plugin.PoltergeistThrowInterval.Value; _inversionCooldown = Plugin.PoltergeistInversionInterval.Value; _playerFloatCooldown = Plugin.PoltergeistPlayerFloatInterval.Value; } private void Update() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } EnsureFieldSphere(); bool flag = Time.time < _inversionUntil; if (_inversionWasActive && !flag) { ResolveGravitySlam(); } _inversionWasActive = flag; if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } EnsureHpDoubled(); _inversionCooldown -= Time.deltaTime; if (_inversionCooldown <= 0f) { _inversionCooldown = Mathf.Max(2f, Plugin.PoltergeistInversionInterval.Value); float num = Mathf.Max(0.25f, Plugin.PoltergeistInversionSeconds.Value); if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("GravityInversionRPC", (RpcTarget)0, new object[1] { num }); } else { GravityInversionRPC(num); } } bool flag2 = Time.time < _inversionUntil; _fieldTimer -= Time.deltaTime; if (_fieldTimer <= 0f && !flag2) { _fieldTimer = 0.25f; foreach (PhysGrabObject item in FusionShared.PhysObjectsInRadius(((Component)this).transform.position, Plugin.PoltergeistRange.Value)) { if (!((Object)(object)item == (Object)null)) { try { item.OverrideZeroGravity(0.35f); item.OverrideDrag(1f, 0.35f); item.OverrideAngularDrag(1.5f, 0.35f); } catch { } } } } _playerFloatCooldown -= Time.deltaTime; if (_playerFloatCooldown <= 0f && !flag2) { _playerFloatCooldown = Plugin.PoltergeistPlayerFloatInterval.Value; foreach (PlayerAvatar item2 in FusionShared.PlayersInRadius(((Component)this).transform.position, Plugin.PoltergeistRange.Value)) { if (!((Object)(object)item2 == (Object)null)) { try { item2.ForceImpulse(Vector3.up * Plugin.PoltergeistPlayerFloatForce.Value); } catch { } } } } _throwCooldown -= Time.deltaTime; if (_throwCooldown <= 0f) { _throwCooldown = Plugin.PoltergeistThrowInterval.Value; ThrowValuableAtPlayer(); } } [PunRPC] private void GravityInversionRPC(float duration) { //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_0027: Unknown result type (might be due to invalid IL or missing references) _inversionUntil = Time.time + Mathf.Max(0.25f, duration); FusionShared.SpawnWarningRing(FusionShared.ProjectToGround(((Component)this).transform.position), Color.white, Mathf.Max(0.2f, Plugin.PoltergeistRange.Value), 0.15f, duration); } private void FixedUpdate() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_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_00fc: 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) if (Time.time >= _inversionUntil) { return; } Vector3 position = ((Component)this).transform.position; float radius = Mathf.Max(0.5f, Plugin.PoltergeistRange.Value); float num = Mathf.Max(0f, Plugin.PoltergeistSlamForce.Value); foreach (PlayerAvatar item in FusionShared.PlayersInRadius(position, radius)) { if (FusionShared.IsLocalPlayer(item) && !FusionShared.IsPlayerDisabled(item)) { PhysGrabObject playerPhysGrabObject = FusionShared.GetPlayerPhysGrabObject(item); if ((Object)(object)playerPhysGrabObject?.rb != (Object)null) { playerPhysGrabObject.rb.AddForce(Vector3.down * num, (ForceMode)5); } } } if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } foreach (PhysGrabObject item2 in FusionShared.PhysObjectsInRadius(position, radius)) { if ((Object)(object)item2?.rb != (Object)null) { item2.rb.AddForce(Vector3.down * num, (ForceMode)5); } } } private void ResolveGravitySlam() { //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_0021: 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_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_0075: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; float radius = Mathf.Max(0.5f, Plugin.PoltergeistRange.Value); foreach (PlayerAvatar item in FusionShared.PlayersInRadius(position, radius)) { if (FusionShared.IsLocalPlayer(item) && !FusionShared.IsPlayerDisabled(item)) { FusionShared.HurtOwnedPlayer(item, Mathf.Max(0, Plugin.PoltergeistSlamDamage.Value), position, _enemy); FusionShared.SpawnWarningRing(FusionShared.ProjectToGround(((Component)item).transform.position), Color.white, 1.4f, 0.1f, 0.25f); } } } private void EnsureHpDoubled() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } private void EnsureFieldSphere() { //IL_00c0: 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_00e5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_fieldSphere != (Object)null) { return; } try { EnemyParent componentInParent = ((Component)this).GetComponentInParent(); EnemyFloaterSphereEffect val = ((componentInParent != null) ? ((Component)componentInParent).GetComponentInChildren(true) : null) ?? ((Component)this).GetComponentInChildren(true); MeshRenderer val2 = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent() : null); Material val3 = (((Object)(object)val2 != (Object)null) ? ((Renderer)val2).sharedMaterial : null); if (!((Object)(object)val3 == (Object)null)) { GameObject val4 = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)val4).name = "MatsuPoltergeistField"; Collider component = val4.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } MeshRenderer component2 = val4.GetComponent(); ((Renderer)component2).sharedMaterial = val3; ((Renderer)component2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)component2).receiveShadows = false; val4.transform.SetParent(((Component)this).transform, false); val4.transform.localPosition = Vector3.zero; val4.transform.localScale = Vector3.one * (Plugin.PoltergeistRange.Value * 2f); _fieldSphere = val4; } } catch { _fieldSphere = null; } } private void ThrowValuableAtPlayer() { //IL_0006: 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_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: 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_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: 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_01da: 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_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: 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_0099: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar val = FusionShared.NearestPlayer(((Component)this).transform.position, Plugin.PoltergeistRange.Value * 1.5f); if ((Object)(object)val == (Object)null) { return; } PhysGrabObject val2 = null; float num = float.MaxValue; foreach (PhysGrabObject item in FusionShared.PhysObjectsInRadius(((Component)this).transform.position, Plugin.PoltergeistRange.Value)) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item.rb == (Object)null) && !((Object)(object)((Component)item).GetComponentInParent() == (Object)null)) { float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)item).transform.position); if (num2 < num) { num = num2; val2 = item; } } } if ((Object)(object)val2 == (Object)null || (Object)(object)val2.rb == (Object)null) { return; } Rigidbody rb = val2.rb; EnemyParent componentInParent = ((Component)this).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { Collider[] componentsInChildren = ((Component)componentInParent).GetComponentsInChildren(true); Collider[] componentsInChildren2 = ((Component)val2).GetComponentsInChildren(true); Collider[] array = componentsInChildren; foreach (Collider val3 in array) { if ((Object)(object)val3 == (Object)null) { continue; } Collider[] array2 = componentsInChildren2; foreach (Collider val4 in array2) { if ((Object)(object)val4 != (Object)null) { try { Physics.IgnoreCollision(val3, val4, true); } catch { } } } } } try { val2.ResetMass(); } catch { } float num3 = Mathf.Min(20f * rb.mass, 100f); try { val2.ResetIndestructible(); } catch { } Vector3 val5 = ((Component)val).transform.position + Vector3.up * 1f; Vector3 val6 = Vector3.Lerp(((Component)this).transform.forward, val5 - val2.centerPoint, 0.5f); rb.AddForce(val6 * num3, (ForceMode)1); rb.AddTorque(((Component)val2).transform.right * 0.5f, (ForceMode)1); FusionShared.BoostThrownImpact(val2, 5f, 2f); } } public class CleanupCrewFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(0.4f, 1f, 0.15f); private static FieldInfo? _headStateField; private EnemyBombThrower _thrower; private EnemyHealth? _health; private bool _hpDone; private float _glowTimer; private int _prevHeadState = -1; private void Awake() { _thrower = ((Component)this).GetComponent(); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } ApplyGlow(); Plugin.GetMeltdownHeadPrefabRef(); } private void Update() { _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; ApplyGlow(); } if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } EnsureHpDoubled(); if (!((Object)(object)_thrower == (Object)null) && !((Object)(object)_thrower.head == (Object)null)) { int num = ReadHeadState(_thrower.head); if (_prevHeadState != -1 && num == 1 && _prevHeadState != 1) { SpawnExtraHeads(); } _prevHeadState = num; } } private void SpawnExtraHeads() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) Transform headSpawnTransform = _thrower.headSpawnTransform; if ((Object)(object)headSpawnTransform == (Object)null) { Plugin.Log.LogWarning((object)"[MeltdownCrew] headSpawnTransform is null; can't spawn extras."); return; } Plugin.Log.LogInfo((object)"[MeltdownCrew] body launched its head — spawning 2 extra heads."); Plugin.SpawnMeltdownHead(headSpawnTransform.position, headSpawnTransform.rotation, headSpawnTransform.forward, Plugin.MeltdownSlowSpeed.Value); Plugin.SpawnMeltdownHead(headSpawnTransform.position, headSpawnTransform.rotation, headSpawnTransform.forward, Plugin.MeltdownFastSpeed.Value); } private void EnsureHpDoubled() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } private void ApplyGlow() { //IL_0006: 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) FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); if ((Object)(object)_thrower != (Object)null && (Object)(object)_thrower.head != (Object)null) { FusionShared.ApplyMutationGlow(((Component)_thrower.head).transform, AuraColor); } } private static int ReadHeadState(EnemyBombThrowerHead head) { try { if (_headStateField == null) { _headStateField = typeof(EnemyBombThrowerHead).GetField("currentState", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } object obj = _headStateField?.GetValue(head); return (obj != null) ? Convert.ToInt32(obj) : (-1); } catch { return -1; } } } public class MeltdownExtraHead : MonoBehaviour { private PhotonView? _pv; private Rigidbody? _rb; private ParticleScriptExplosion? _explosion; private float _factor = 1f; private bool _launched; private bool _exploding; private float _flightTimer; private float _destroyTimer; private void Awake() { _pv = ((Component)this).GetComponent(); _rb = ((Component)this).GetComponent()?.rb ?? ((Component)this).GetComponent(); _explosion = ((Component)this).GetComponent(); Animator component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { ((Behaviour)component).enabled = false; } } public void Launch(float factor, Vector3 forward) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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) _factor = factor; _flightTimer = Plugin.MeltdownHeadFlightSeconds.Value; _launched = true; if ((Object)(object)_rb != (Object)null) { _rb.isKinematic = false; Vector3 val = Vector3.Lerp(((Vector3)(ref forward)).normalized, Vector3.up, 0.3f); _rb.AddForce(val * 20f, (ForceMode)1); _rb.AddTorque(Vector3.right * 0.25f, (ForceMode)1); } } private void FixedUpdate() { //IL_0053: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: 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) if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } if (_exploding) { _destroyTimer -= Time.fixedDeltaTime; if (_destroyTimer <= 0f) { DestroySelf(); } } else { if (!_launched || (Object)(object)_rb == (Object)null) { return; } PlayerAvatar val = FusionShared.NearestPlayer(_rb.position, 40f); if ((Object)(object)val != (Object)null) { Vector3 val2 = ((Component)val).transform.position - _rb.position; val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude > 0.01f) { _rb.AddForce(((Vector3)(ref val2)).normalized * Plugin.MeltdownHomingForce.Value * Mathf.Max(0.5f, _factor), (ForceMode)0); } } float num = Plugin.MeltdownBaseSpeed.Value * _factor; Vector3 velocity = _rb.velocity; Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(velocity.x, 0f, velocity.z); if (((Vector3)(ref val3)).magnitude > num) { val3 = ((Vector3)(ref val3)).normalized * num; _rb.velocity = new Vector3(val3.x, velocity.y, val3.z); } _flightTimer -= Time.fixedDeltaTime; if (_flightTimer <= 0f) { _exploding = true; _destroyTimer = 0.3f; if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("ExplodeRPC", (RpcTarget)0, new object[1] { _rb.position }); } else { ExplodeRPC(_rb.position); } } } } [PunRPC] private void ExplodeRPC(Vector3 pos) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) try { ParticleScriptExplosion? explosion = _explosion; if (explosion != null) { explosion.Spawn(pos, 2f, Plugin.MeltdownHeadDamage.Value, 30, 4f, false, false, 1f); } } catch { } Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } } private void DestroySelf() { try { if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null && _pv.IsMine) { PhotonNetwork.Destroy(((Component)this).gameObject); } else { Object.Destroy((Object)(object)((Component)this).gameObject); } } catch { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class PlayerTeleportHelper : MonoBehaviour { private PhotonView? _pv; private PlayerAvatar? _avatar; private void Awake() { _pv = ((Component)this).GetComponent(); _avatar = ((Component)this).GetComponent(); } public static void Trigger(PlayerAvatar player, Vector3 pos, int damage, int enemyIndex) { //IL_005a: 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) PlayerTeleportHelper component = ((Component)player).GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)component._pv == (Object)null)) { if (SemiFunc.IsMultiplayer()) { component._pv.RPC("TeleportAndHurtRPC", (RpcTarget)0, new object[3] { pos, damage, enemyIndex }); } else { component.TeleportAndHurtRPC(pos, damage, enemyIndex); } } } public static void TriggerWithImpulse(PlayerAvatar player, Vector3 pos, int damage, int enemyIndex, Vector3 exitImpulse) { //IL_0064: 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_003a: 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) PlayerTeleportHelper component = ((Component)player).GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)component._pv == (Object)null)) { if (SemiFunc.IsMultiplayer()) { component._pv.RPC("TeleportHurtImpulseRPC", (RpcTarget)0, new object[4] { pos, damage, enemyIndex, exitImpulse }); } else { component.TeleportHurtImpulseRPC(pos, damage, enemyIndex, exitImpulse); } } } [PunRPC] private void TeleportHurtImpulseRPC(Vector3 pos, int damage, int enemyIndex, Vector3 exitImpulse) { //IL_0001: 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) TeleportAndHurtRPC(pos, damage, enemyIndex); if ((Object)(object)_avatar == (Object)null || !FusionShared.IsLocalPlayer(_avatar)) { return; } try { _avatar.ForceImpulse(exitImpulse); } catch { } } [PunRPC] private void TeleportAndHurtRPC(Vector3 pos, int damage, int enemyIndex) { //IL_007f: 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_00b4: 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_0030: 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_00de: 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_006a: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)_avatar == (Object)null) { return; } if (SemiFunc.IsMasterClientOrSingleplayer()) { PhysGrabObject playerPhysGrabObject = FusionShared.GetPlayerPhysGrabObject(_avatar); if ((Object)(object)playerPhysGrabObject != (Object)null) { playerPhysGrabObject.Teleport(pos, ((Component)_avatar).transform.rotation); if ((Object)(object)playerPhysGrabObject.rb != (Object)null) { playerPhysGrabObject.rb.velocity = Vector3.zero; playerPhysGrabObject.rb.angularVelocity = Vector3.zero; } } } ((Component)_avatar).transform.position = pos; FusionShared.SetPlayerClientPosition(_avatar, pos); if ((Object)(object)_avatar.playerAvatarVisuals != (Object)null) { ((Component)_avatar.playerAvatarVisuals).transform.position = pos; FusionShared.SetPlayerVisualPosition(_avatar.playerAvatarVisuals, pos); } if (SemiFunc.IsMasterClientOrSingleplayer()) { _avatar.playerHealth.HurtOther(damage, pos, false, enemyIndex, false); } } catch (Exception arg) { Plugin.Log.LogError((object)$"[Snatcher] teleport RPC error: {arg}"); } } } [HarmonyPatch(typeof(PlayerAvatar), "Start")] internal static class PlayerAvatar_Start_Patch { private static void Postfix(PlayerAvatar __instance) { try { if ((Object)(object)__instance != (Object)null && (Object)(object)((Component)__instance).GetComponent() == (Object)null) { ((Component)__instance).gameObject.AddComponent(); } } catch (Exception arg) { Plugin.Log.LogError((object)$"[Snatcher] PlayerAvatar_Start_Patch error: {arg}"); } } } public class SnatcherFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(0.6f, 0f, 0.85f); private static FieldInfo? _playerTargetField; private EnemyHidden _hidden; private EnemyParent? _self; private EnemyHealth? _health; private bool _hpDone; private float _glowTimer; private State _prevState; private bool _stateInitialized; private void Awake() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) _hidden = ((Component)this).GetComponent(); _self = ((Component)this).GetComponentInParent(); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } EnsureHpDoubled(); if ((Object)(object)_hidden == (Object)null) { return; } State currentState = _hidden.currentState; if (!_stateInitialized) { _prevState = currentState; _stateInitialized = true; } else { if (currentState == _prevState) { return; } if ((int)currentState == 7) { PlayerAvatar playerTarget = GetPlayerTarget(_hidden); if ((Object)(object)playerTarget != (Object)null && !FusionShared.IsPlayerDisabled(playerTarget) && FusionShared.TryGetSafeRandomPoint(((Component)playerTarget).transform.position, out var point)) { int enemyIndex = (((Object)(object)_self != (Object)null && (Object)(object)EnemyDirector.instance != (Object)null) ? EnemyDirector.instance.enemiesSpawned.IndexOf(_self) : (-1)); PlayerTeleportHelper.Trigger(playerTarget, point, Plugin.SnatcherDamage.Value, enemyIndex); Plugin.Log.LogInfo((object)"[Snatcher] Snatched a player to a random spot."); } } _prevState = currentState; } } private void EnsureHpDoubled() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } private static PlayerAvatar? GetPlayerTarget(EnemyHidden hidden) { try { if ((object)_playerTargetField == null) { _playerTargetField = typeof(EnemyHidden).GetField("playerTarget", BindingFlags.Instance | BindingFlags.NonPublic); } object? obj = _playerTargetField?.GetValue(hidden); return (PlayerAvatar?)((obj is PlayerAvatar) ? obj : null); } catch { return null; } } } public class PeeperFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(1f, 0.1f, 0.1f); private static FieldInfo? _targetPlayerField; private EnemyCeilingEye _eye; private EnemyHealth? _health; private bool _hpDone; private float _glowTimer; private PlayerAvatar? _lastTarget; private float _stareTimer; private int _consecutiveShots; private void Awake() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) _eye = ((Component)this).GetComponent(); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: 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_005b: Invalid comparison between Unknown and I4 _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } EnsureHpDoubled(); if ((Object)(object)_eye == (Object)null) { return; } PlayerAvatar val = (((int)_eye.currentState == 3) ? GetTarget(_eye) : null); if ((Object)(object)val == (Object)null) { _lastTarget = null; _stareTimer = 0f; _consecutiveShots = 0; return; } if ((Object)(object)val != (Object)(object)_lastTarget) { _lastTarget = val; _stareTimer = 0f; _consecutiveShots = 0; } _stareTimer += Time.deltaTime; float num = Mathf.Max(0.5f, Plugin.DeathgazeStareSeconds.Value); float num2 = Mathf.Clamp(Plugin.DeathgazeRepeatChargeMultiplier.Value, 0.25f, 1f); float num3 = Mathf.Max(Mathf.Clamp(Plugin.DeathgazeMinimumStareSeconds.Value, 0.5f, num), num * Mathf.Pow(num2, (float)_consecutiveShots)); if (_stareTimer >= num3) { _stareTimer = 0f; _consecutiveShots++; FireBeam(val); } } private void EnsureHpDoubled() { if (!_hpDone && !((Object)(object)_health == (Object)null) && SemiFunc.IsMasterClientOrSingleplayer()) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } private void FireBeam(PlayerAvatar target) { try { SemiLaser clownLaserPrefab = Plugin.GetClownLaserPrefab(); if ((Object)(object)clownLaserPrefab == (Object)null) { return; } Transform source = (((Object)(object)_eye.eyeTransform != (Object)null) ? _eye.eyeTransform : ((Component)this).transform); GameObject val = Object.Instantiate(((Component)clownLaserPrefab).gameObject); val.SetActive(true); SemiLaser component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Object.Destroy((Object)(object)val); return; } HurtCollider componentInChildren = val.GetComponentInChildren(true); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.enemyHost = ((Component)_eye).GetComponent(); componentInChildren.playerKill = false; componentInChildren.playerDamage = Plugin.DeathgazeBeamDamage.Value; componentInChildren.playerDamageCooldown = Plugin.DeathgazeBeamSeconds.Value + 1f; } EnemyParent componentInParent = ((Component)_eye).GetComponentInParent(); Transform ignoreRoot = ((componentInParent != null) ? ((Component)componentInParent).transform : null) ?? ((Component)this).transform; val.AddComponent().Init(component, source, target, Plugin.DeathgazeBeamSeconds.Value, ignoreRoot); } catch (Exception arg) { Plugin.Log.LogError((object)$"[Deathgaze] fire error: {arg}"); } } private static PlayerAvatar? GetTarget(EnemyCeilingEye eye) { try { if ((object)_targetPlayerField == null) { _targetPlayerField = typeof(EnemyCeilingEye).GetField("targetPlayer", BindingFlags.Instance | BindingFlags.NonPublic); } object? obj = _targetPlayerField?.GetValue(eye); return (PlayerAvatar?)((obj is PlayerAvatar) ? obj : null); } catch { return null; } } } public class PeeperBeam : MonoBehaviour { private static readonly int DefaultMask = LayerMask.GetMask(new string[1] { "Default" }); private SemiLaser _laser; private Transform _source; private PlayerAvatar? _target; private float _duration; private float _elapsed; private Transform? _ignoreRoot; private int _explicitDamage; private Enemy? _damageSource; private bool _damageApplied; public void Init(SemiLaser laser, Transform source, PlayerAvatar target, float duration, Transform? ignoreRoot, int explicitDamage = 0, Enemy? damageSource = null) { _laser = laser; _source = source; _target = target; _duration = duration; _ignoreRoot = ignoreRoot; _explicitDamage = explicitDamage; _damageSource = damageSource; } private void LateUpdate() { //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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //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_0087: 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_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_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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0143: 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_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) _elapsed += Time.deltaTime; if ((Object)(object)_laser == (Object)null || (Object)(object)_source == (Object)null || (Object)(object)_target == (Object)null || _elapsed >= _duration) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } Vector3 position = _source.position; Vector3 val = ((Component)_target).transform.position + Vector3.up * 1f; Vector3 val2 = val - position; float magnitude = ((Vector3)(ref val2)).magnitude; if (magnitude < 0.01f) { return; } val2 /= magnitude; Vector3 val3 = val; float num = magnitude; RaycastHit[] array = Physics.RaycastAll(position, val2, magnitude, DefaultMask, (QueryTriggerInteraction)1); for (int i = 0; i < array.Length; i++) { RaycastHit val4 = array[i]; if (!((Object)(object)((RaycastHit)(ref val4)).collider == (Object)null) && !(((RaycastHit)(ref val4)).distance < 0.6f) && (!((Object)(object)_ignoreRoot != (Object)null) || !((Component)((RaycastHit)(ref val4)).collider).transform.IsChildOf(_ignoreRoot)) && ((RaycastHit)(ref val4)).distance < num) { num = ((RaycastHit)(ref val4)).distance; val3 = ((RaycastHit)(ref val4)).point; } } _laser.LaserActive(position, val3, true); if (!_damageApplied && _explicitDamage > 0 && _elapsed >= 0.12f && num >= magnitude - 0.2f && FusionShared.IsLocalPlayer(_target)) { _damageApplied = true; FusionShared.HurtOwnedPlayer(_target, _explicitDamage, position, _damageSource); } } } public class DeadeyeFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(0.2f, 0.6f, 1f); private EnemyHunter _hunter; private EnemyHealth? _health; private PhotonView? _pv; private bool _hpDone; private float _glowTimer; private State _prevState; private bool _stateInit; private GameObject? _activeBeam; private void Awake() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) _hunter = ((Component)this).GetComponent(); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _pv = ((Component)this).GetComponent(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); Plugin.GetPhotonBlasterLaserPrefab(); } private void Update() { //IL_0030: 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_0095: 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_0087: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Invalid comparison between Unknown and I4 //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if ((Object)(object)_activeBeam != (Object)null && ((object)_activeBeam).Equals((object?)null)) { _activeBeam = null; } EnsureHpDoubled(); if ((Object)(object)_hunter == (Object)null) { return; } State currentState = _hunter.currentState; if (!_stateInit) { _prevState = currentState; _stateInit = true; } else if (currentState != _prevState) { if ((int)currentState == 6 && SemiFunc.IsMasterClientOrSingleplayer()) { SendBlaster(); } _prevState = currentState; } } private void EnsureHpDoubled() { if (!_hpDone && !((Object)(object)_health == (Object)null) && SemiFunc.IsMasterClientOrSingleplayer()) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } private void SendBlaster() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar val = FusionShared.NearestPlayer((((Object)(object)_hunter.gunTipTransform != (Object)null) ? _hunter.gunTipTransform : ((Component)this).transform).position, 60f); if (!((Object)(object)val == (Object)null)) { if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null && (Object)(object)val.photonView != (Object)null) { _pv.RPC("FireBlasterRPC", (RpcTarget)0, new object[1] { val.photonView.ViewID }); } else { FireBlaster(val); } } } [PunRPC] private void FireBlasterRPC(int playerViewId) { try { PhotonView val = PhotonView.Find(playerViewId); PlayerAvatar val2 = (((Object)(object)val != (Object)null) ? (((Component)val).GetComponent() ?? ((Component)val).GetComponentInParent() ?? ((Component)val).GetComponentInChildren()) : null); if ((Object)(object)val2 != (Object)null) { FireBlaster(val2); } } catch (Exception arg) { Plugin.Log.LogError((object)$"[Deadeye] target RPC error: {arg}"); } } private void FireBlaster(PlayerAvatar target) { try { if ((Object)(object)_activeBeam != (Object)null) { return; } SemiLaser photonBlasterLaserPrefab = Plugin.GetPhotonBlasterLaserPrefab(); if ((Object)(object)photonBlasterLaserPrefab == (Object)null) { return; } Transform source = (((Object)(object)_hunter.gunTipTransform != (Object)null) ? _hunter.gunTipTransform : ((Component)this).transform); GameObject val = (_activeBeam = Object.Instantiate(((Component)photonBlasterLaserPrefab).gameObject)); val.SetActive(true); SemiLaser component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Object.Destroy((Object)(object)val); return; } HurtCollider componentInChildren = val.GetComponentInChildren(true); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.enemyHost = ((Component)_hunter).GetComponent(); componentInChildren.playerKill = false; componentInChildren.playerDamage = 0; componentInChildren.playerDamageCooldown = Plugin.DeadeyeBeamSeconds.Value + 1f; } EnemyParent componentInParent = ((Component)_hunter).GetComponentInParent(); Transform ignoreRoot = ((componentInParent != null) ? ((Component)componentInParent).transform : null) ?? ((Component)this).transform; Enemy damageSource = ((Component)_hunter).GetComponent() ?? ((Component)_hunter).GetComponentInParent(); val.AddComponent().Init(component, source, target, Plugin.DeadeyeBeamSeconds.Value, ignoreRoot, Plugin.DeadeyeBeamDamage.Value, damageSource); } catch (Exception arg) { Plugin.Log.LogError((object)$"[Deadeye] fire error: {arg}"); } } } public class TricksterFusion : MonoBehaviour { private sealed class SplitBatch { internal Vector3 Position; internal float Expires; internal int Remaining; } internal static readonly Color AuraColor = new Color(0.6f, 0.3f, 0.9f); internal static readonly List ActiveDisguises = new List(); private static readonly List PendingSplitChildren = new List(); private EnemyHealth? _health; private EnemyGnome? _gnome; private PhotonView? _pv; private PhysGrabObject? _pgo; private bool _hpDone; private float _glowTimer; private bool _disguised; private float _calmTimer; private float _redisguiseAt; private int _lastHealthSeen = -1; private bool _splitUsed; private readonly List _hiddenRenderers = new List(); private GameObject? _shell; private void Awake() { //IL_00f1: Unknown result type (might be due to invalid IL or missing references) _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _gnome = ((Component)this).GetComponent(); _pv = ((Component)this).GetComponent(); EnemyParent componentInParent = ((Component)this).GetComponentInParent(); _pgo = ((Component)this).GetComponentInParent() ?? (((Object)(object)componentInParent != (Object)null) ? ((Component)componentInParent).GetComponentInChildren() : null); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } try { HurtCollider[] componentsInChildren = ((Component)(((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.EnableObject != (Object)null) ? componentInParent.EnableObject.transform : ((Component)this).transform)).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].playerDamage = Plugin.TricksterAttackDamage.Value; } } catch { } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0038: 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_0193: Invalid comparison between Unknown and I4 //IL_019b: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; if (!_disguised) { FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } } if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } EnsureHpDoubled(); if ((Object)(object)_gnome == (Object)null) { return; } if (_disguised) { FusionShared.FreezeAgent(_gnome.enemy); bool flag = false; if ((Object)(object)_health != (Object)null) { int healthCurrent = FusionShared.GetHealthCurrent(_health); if (_lastHealthSeen >= 0 && healthCurrent < _lastHealthSeen) { flag = true; } _lastHealthSeen = healthCurrent; } bool flag2 = (Object)(object)_pgo != (Object)null && _pgo.grabbed; PlayerAvatar val = FusionShared.NearestPlayer(((Component)this).transform.position, Plugin.TricksterRevealRange.Value); if (!((Object)(object)val != (Object)null || flag2 || flag)) { return; } SendMimic(on: false, ""); _redisguiseAt = Time.time + Plugin.TricksterRedisguiseSeconds.Value; EnemyParent componentInParent = ((Component)this).GetComponentInParent(); EnemyStateInvestigate val2 = (((Object)(object)componentInParent != (Object)null) ? ((Component)componentInParent).GetComponentInChildren() : null); Vector3 val3 = (((Object)(object)val != (Object)null && (Object)(object)val.playerTransform != (Object)null) ? val.playerTransform.position : ((Component)this).transform.position); if (!((Object)(object)val2 != (Object)null)) { return; } try { val2.Set(val3, false); return; } catch { return; } } bool num = (int)_gnome.currentState == 1; bool flag3 = (Object)(object)FusionShared.NearestPlayer(((Component)this).transform.position, Plugin.TricksterHideRange.Value) == (Object)null; if (num && flag3 && Time.time >= _redisguiseAt) { _calmTimer += Time.deltaTime; if (!(_calmTimer >= 2f)) { return; } string text = PickDisguiseValuable(); if (!string.IsNullOrEmpty(text)) { if ((Object)(object)_health != (Object)null) { _lastHealthSeen = FusionShared.GetHealthCurrent(_health); } SendMimic(on: true, text); } _calmTimer = 0f; } else { _calmTimer = 0f; } } private void SendMimic(bool on, string valuableName) { //IL_003f: 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) if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("MimicRPC", (RpcTarget)0, new object[2] { on, valuableName }); } else { MimicRPC(on, valuableName); } } internal void SplitOnDeath() { //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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_006e: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer() && !_splitUsed && !((Object)(object)((Component)this).GetComponent() != (Object)null)) { _splitUsed = true; Vector3 val = ((Component)this).transform.position + Vector3.up * 0.15f; if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("ArmSplitChildrenRPC", (RpcTarget)0, new object[1] { val }); } else { ArmSplitChildrenRPC(val); } Plugin.SpawnTricksterPair(val); Plugin.Log.LogInfo((object)"[Trickster] Split into two children."); } } [PunRPC] private void ArmSplitChildrenRPC(Vector3 position) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) PendingSplitChildren.Add(new SplitBatch { Position = position, Expires = Time.time + 5f, Remaining = 2 }); } internal static bool ConsumeSplitSpawn(Vector3 position) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) for (int num = PendingSplitChildren.Count - 1; num >= 0; num--) { SplitBatch splitBatch = PendingSplitChildren[num]; if (Time.time > splitBatch.Expires || splitBatch.Remaining <= 0) { PendingSplitChildren.RemoveAt(num); } else if (!(Vector3.Distance(position, splitBatch.Position) > 3.5f)) { splitBatch.Remaining--; if (splitBatch.Remaining <= 0) { PendingSplitChildren.RemoveAt(num); } return true; } } return false; } internal void ResetSplitForRespawn() { TricksterSplitChildMarker component = ((Component)this).GetComponent(); if (!((Object)(object)component != (Object)null) || !(Time.time - component.CreatedAt < 1f)) { _splitUsed = false; if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } } } private static string PickDisguiseValuable() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) try { List list = new List(); foreach (PrefabRef allValuable in Valuables.AllValuables) { GameObject val = ((PrefabRef)(object)allValuable)?.Prefab; if ((Object)(object)val == (Object)null) { continue; } MeshRenderer componentInChildren = val.GetComponentInChildren(true); if (!((Object)(object)componentInChildren == (Object)null)) { Bounds bounds = ((Renderer)componentInChildren).bounds; Vector3 size = ((Bounds)(ref bounds)).size; float num = Mathf.Max(size.x, Mathf.Max(size.y, size.z)); if (num > 0.05f && num <= 1f) { list.Add(((Object)val).name); } } } if (list.Count == 0) { return ""; } return list[Random.Range(0, list.Count)]; } catch { return ""; } } [PunRPC] private void MimicRPC(bool on, string valuableName, PhotonMessageInfo _info = default(PhotonMessageInfo)) { try { if (on) { Disguise(valuableName); } else { Reveal(); } } catch (Exception arg) { Plugin.Log.LogError((object)$"[Trickster] mimic error: {arg}"); } } private void Disguise(string valuableName) { //IL_01e0: 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_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0299: 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) if (_disguised) { return; } _disguised = true; _hiddenRenderers.Clear(); EnemyParent componentInParent = ((Component)this).GetComponentInParent(); Renderer[] componentsInChildren = ((Component)(((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.EnableObject != (Object)null) ? componentInParent.EnableObject.transform : ((Component)this).transform)).GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if (!((Object)(object)val == (Object)null) && val.enabled && !(((Object)((Component)val).gameObject).name == "MimicShell")) { val.enabled = false; _hiddenRenderers.Add(val); } } GameObject val2 = null; foreach (PrefabRef allValuable in Valuables.AllValuables) { GameObject val3 = ((PrefabRef)(object)allValuable)?.Prefab; if ((Object)(object)val3 != (Object)null && ((Object)val3).name == valuableName) { val2 = val3; break; } } if ((Object)(object)val2 != (Object)null) { GameObject val4 = Object.Instantiate(val2); ((Object)val4).name = "MimicShell"; MonoBehaviour[] componentsInChildren2 = val4.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren2.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren2[i]); } PhotonView[] componentsInChildren3 = val4.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren3.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren3[i]); } Collider[] componentsInChildren4 = val4.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren4.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren4[i]); } Rigidbody[] componentsInChildren5 = val4.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren5.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren5[i]); } Light[] componentsInChildren6 = val4.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren6.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren6[i]); } MeshRenderer[] componentsInChildren7 = val4.GetComponentsInChildren(true); if (componentsInChildren7.Length != 0) { Bounds bounds = ((Renderer)componentsInChildren7[0]).bounds; MeshRenderer[] array = componentsInChildren7; foreach (MeshRenderer val5 in array) { ((Bounds)(ref bounds)).Encapsulate(((Renderer)val5).bounds); } float num = Mathf.Max(((Bounds)(ref bounds)).size.x, Mathf.Max(((Bounds)(ref bounds)).size.y, ((Bounds)(ref bounds)).size.z)); float num2 = ((num > 0.01f) ? Mathf.Clamp(0.55f / num, 0.2f, 3f) : 1f); val4.transform.SetParent(((Component)this).transform, false); val4.transform.localScale = Vector3.one * num2; val4.transform.localPosition = Vector3.up * 0.1f; _shell = val4; } else { Object.Destroy((Object)(object)val4); } } SetAuraLight(on: false); if (!ActiveDisguises.Contains(this)) { ActiveDisguises.Add(this); } Plugin.Log.LogInfo((object)("[Trickster] Disguised as '" + valuableName + "'.")); } private void SetAuraLight(bool on) { try { EnemyParent componentInParent = ((Component)this).GetComponentInParent(); Light[] componentsInChildren = ((Component)(((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.EnableObject != (Object)null) ? componentInParent.EnableObject.transform : ((Component)this).transform)).GetComponentsInChildren(true); foreach (Light val in componentsInChildren) { if ((Object)(object)val != (Object)null && ((Object)((Component)val).gameObject).name == "MatsuMutationAura") { ((Behaviour)val).enabled = on; } } } catch { } } private void Reveal() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) if (!_disguised) { return; } _disguised = false; foreach (Renderer hiddenRenderer in _hiddenRenderers) { if ((Object)(object)hiddenRenderer != (Object)null) { hiddenRenderer.enabled = true; } } _hiddenRenderers.Clear(); if ((Object)(object)_shell != (Object)null) { Object.Destroy((Object)(object)_shell); _shell = null; } SetAuraLight(on: true); ActiveDisguises.Remove(this); FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); Plugin.Log.LogInfo((object)"[Trickster] Revealed!"); } private void OnDisable() { Reveal(); } private void EnsureHpDoubled() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } } public class BangFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(1f, 0.55f, 0.05f); private EnemyHealth? _health; private bool _hpDone; private bool _scaled; private bool _packDone; private float _glowTimer; private void Awake() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); ApplyScale(); } private void ApplyScale() { //IL_0055: 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_0039: 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) if (_scaled) { return; } _scaled = true; try { EnemyParent componentInParent = ((Component)this).GetComponentInParent(); GameObject val = (((Object)(object)componentInParent != (Object)null) ? componentInParent.EnableObject : null); if ((Object)(object)val != (Object)null) { val.transform.localScale = Vector3.one * 2f; } else { ((Component)this).transform.localScale = Vector3.one * 2f; } } catch { } } private void Update() { //IL_0030: 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_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_00a1: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } EnsureHpDoubled(); if (_packDone) { return; } _packDone = true; if ((Object)(object)((Component)this).GetComponent() == (Object)null) { int num = CountNearbyLiveBangers(((Component)this).transform.position, 25f); int num2 = Mathf.Max(0, Plugin.BigBangPackSize.Value - num); for (int i = 0; i < num2; i++) { Vector2 insideUnitCircle = Random.insideUnitCircle; Vector2 val = ((Vector2)(ref insideUnitCircle)).normalized * 2f; Plugin.SpawnPackBanger(((Component)this).transform.position + new Vector3(val.x, 0.3f, val.y)); } if (num2 > 0) { Plugin.Log.LogInfo((object)$"[BigBang] {num} Bangers alive nearby — summoned {num2} to reach the squad of {Plugin.BigBangPackSize.Value}."); } } } private static int CountNearbyLiveBangers(Vector3 origin, float radius) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) int num = 0; EnemyDirector instance = EnemyDirector.instance; if ((Object)(object)instance != (Object)null && instance.enemiesSpawned != null) { float num2 = radius * radius; foreach (EnemyParent item in instance.enemiesSpawned) { if ((Object)(object)item == (Object)null) { continue; } EnemyBang componentInChildren = ((Component)item).GetComponentInChildren(true); if (!((Object)(object)componentInChildren == (Object)null) && ((Component)componentInChildren).gameObject.activeInHierarchy) { Vector3 val = ((Component)componentInChildren).transform.position - origin; if (!(((Vector3)(ref val)).sqrMagnitude > num2)) { num++; } } } } return num; } private void EnsureHpDoubled() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } } public class BangSquadMemberMarker : MonoBehaviour { } public class AnimalFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(1f, 0.8f, 0.15f); private EnemyHealth? _health; private PhotonView? _pv; private bool _hpDone; private bool _killed; private bool _deathHooked; private float _glowTimer; private float _eatTimer; private int _totalPoints; private int _totalDamageAdded; private float _totalMassAdded; private int _totalHpAdded; private readonly List _belly = new List(); private void Awake() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _pv = ((Component)this).GetComponent(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void HookDeath() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown if (_deathHooked || (Object)(object)_health == (Object)null) { return; } _deathHooked = true; try { _health.onDeath.AddListener((UnityAction)delegate { _killed = true; }); } catch { } } private void Update() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } HookDeath(); if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } EnsureHpDoubled(); for (int num = _belly.Count - 1; num >= 0; num--) { PhysGrabObject val = _belly[num]; if ((Object)(object)val == (Object)null) { _belly.RemoveAt(num); } else { try { val.OverrideDeactivate(0.5f); } catch { } } } _eatTimer -= Time.deltaTime; if (!(_eatTimer > 0f)) { _eatTimer = 0.6f; TryEat(); } } private void TryEat() { //IL_001f: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_0132: Unknown result type (might be due to invalid IL or missing references) if (_belly.Count >= Plugin.GluttonMaxSwallowed.Value) { return; } try { Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, Plugin.GluttonEatRadius.Value); for (int i = 0; i < array.Length; i++) { ValuableObject componentInParent = ((Component)array[i]).GetComponentInParent(); if ((Object)(object)componentInParent == (Object)null) { continue; } PhysGrabObject component = ((Component)componentInParent).GetComponent(); if (!((Object)(object)component == (Object)null) && !_belly.Contains(component) && !component.grabbed && !((Object)(object)((Component)componentInParent).GetComponentInParent() != (Object)null)) { _belly.Add(component); try { component.OverrideDeactivate(0.5f); } catch { } try { component.Teleport(new Vector3(((Component)component).transform.position.x, -3000f, ((Component)component).transform.position.z), Quaternion.identity); } catch { } int num = SizePoints(componentInParent); if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("GluttonBuffRPC", (RpcTarget)0, new object[1] { num }); } else { GluttonBuffRPC(num); } Plugin.Log.LogInfo((object)$"[Glutton] Swallowed '{((Object)componentInParent).name}' (+{num}pt, {_belly.Count} in the belly)."); if (_belly.Count >= Plugin.GluttonMaxSwallowed.Value) { break; } } } } catch { } } private static int SizePoints(ValuableObject val) { //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_002e: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) try { Collider[] componentsInChildren = ((Component)val).GetComponentsInChildren(); if (componentsInChildren.Length == 0) { return 1; } Bounds bounds = componentsInChildren[0].bounds; Collider[] array = componentsInChildren; foreach (Collider val2 in array) { ((Bounds)(ref bounds)).Encapsulate(val2.bounds); } float num = Mathf.Max(new float[3] { ((Bounds)(ref bounds)).size.x, ((Bounds)(ref bounds)).size.y, ((Bounds)(ref bounds)).size.z }); if (num < 0.4f) { return 1; } if (num < 0.9f) { return 2; } if (num < 1.6f) { return 3; } return 4; } catch { return 1; } } [PunRPC] private void GluttonBuffRPC(int points, PhotonMessageInfo _info = default(PhotonMessageInfo)) { try { _totalPoints += points; EnemyParent componentInParent = ((Component)this).GetComponentInParent(); int num = Plugin.GluttonDamagePerPoint.Value * points; if ((Object)(object)componentInParent != (Object)null) { HurtCollider[] componentsInChildren = ((Component)componentInParent).GetComponentsInChildren(true); foreach (HurtCollider obj in componentsInChildren) { obj.playerDamage += num; } } _totalDamageAdded += num; float num2 = Plugin.GluttonMassPerPoint.Value * (float)points; Rigidbody val = (((Object)(object)componentInParent != (Object)null) ? ((Component)componentInParent).GetComponentInChildren() : ((Component)this).GetComponentInParent()); if ((Object)(object)val != (Object)null) { val.mass += num2; } _totalMassAdded += num2; if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { int num3 = Plugin.GluttonHpPerPoint.Value * points; EnemyHealth? health = _health; health.health += num3; int healthCurrent = FusionShared.GetHealthCurrent(_health); if (healthCurrent > 0) { FusionShared.SetHealthCurrent(_health, healthCurrent + num3); } _totalHpAdded += num3; } Plugin.Log.LogInfo((object)$"[Glutton#{((Object)this).GetInstanceID()}] Grew stronger (+{points}pt, total {_totalPoints}) — this individual only."); } catch (Exception arg) { Plugin.Log.LogError((object)$"[Glutton] buff error: {arg}"); } } private void OnDisable() { if (_killed) { Regurgitate(withInvincibility: true); ResetGrowth(); _killed = false; } } private void OnDestroy() { Regurgitate(withInvincibility: false); } private void ResetGrowth() { if (_totalPoints == 0) { return; } try { EnemyParent componentInParent = ((Component)this).GetComponentInParent(); if (_totalDamageAdded != 0 && (Object)(object)componentInParent != (Object)null) { HurtCollider[] componentsInChildren = ((Component)componentInParent).GetComponentsInChildren(true); foreach (HurtCollider obj in componentsInChildren) { obj.playerDamage -= _totalDamageAdded; } } if (_totalMassAdded != 0f) { Rigidbody val = (((Object)(object)componentInParent != (Object)null) ? ((Component)componentInParent).GetComponentInChildren() : ((Component)this).GetComponentInParent()); if ((Object)(object)val != (Object)null) { val.mass = Mathf.Max(0.1f, val.mass - _totalMassAdded); } } if (_totalHpAdded != 0 && SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, _health.health - _totalHpAdded); } Plugin.Log.LogInfo((object)$"[Glutton#{((Object)this).GetInstanceID()}] Killed — growth reset (-{_totalPoints}pt undone)."); } catch (Exception arg) { Plugin.Log.LogError((object)$"[Glutton] growth reset error: {arg}"); } finally { _totalPoints = 0; _totalDamageAdded = 0; _totalMassAdded = 0f; _totalHpAdded = 0; } } private void OnEnable() { //IL_003a: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } foreach (PhysGrabObject item in _belly) { if (!((Object)(object)item == (Object)null)) { try { item.OverrideDeactivate(0.5f); item.Teleport(new Vector3(((Component)item).transform.position.x, -3000f, ((Component)item).transform.position.z), Quaternion.identity); } catch { } } } } private void Regurgitate(bool withInvincibility) { //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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_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_006f: 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_007c: 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) if (!SemiFunc.IsMasterClientOrSingleplayer() || _belly.Count == 0) { return; } Vector3 val = ((Component)this).transform.position + Vector3.up * 0.5f; int num = 0; foreach (PhysGrabObject item in _belly) { if ((Object)(object)item == (Object)null) { continue; } try { item.OverrideDeactivateReset(); Vector2 val2 = Random.insideUnitCircle * 1.2f; item.Teleport(val + new Vector3(val2.x, 0.2f, val2.y), Quaternion.identity); if (withInvincibility) { FusionShared.ProtectValuable(item, Plugin.GluttonDropInvincibleSeconds.Value); } num++; } catch { } } _belly.Clear(); if (num > 0) { Plugin.Log.LogInfo((object)$"[Glutton] Coughed up {num} valuables (killed={_killed})."); } } private void EnsureHpDoubled() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } } public class DuckFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(1f, 0.85f, 0.3f); private static MethodInfo? _updateStateMethod; private EnemyHealth? _health; private EnemyDuck? _duck; private bool _hpDone; private float _glowTimer; private bool _counting; private float _countdown; private bool _transformed; private float _huntUntil; private float _relureTimer; private PlayerAvatar? _prey; private void Awake() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _duck = ((Component)this).GetComponent(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Invalid comparison between Unknown and I4 //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Invalid comparison between Unknown and I4 //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Invalid comparison between Unknown and I4 //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Invalid comparison between Unknown and I4 //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Invalid comparison between Unknown and I4 //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Invalid comparison between Unknown and I4 //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Invalid comparison between Unknown and I4 //IL_0256: 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_00e1: Invalid comparison between Unknown and I4 //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Invalid comparison between Unknown and I4 //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Invalid comparison between Unknown and I4 //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Invalid comparison between Unknown and I4 //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Invalid comparison between Unknown and I4 //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Invalid comparison between Unknown and I4 //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if ((Object)(object)_duck == (Object)null) { return; } State currentState = _duck.currentState; bool flag = (int)currentState == 4 || (int)currentState == 5 || (int)currentState == 6 || (int)currentState == 7 || (int)currentState == 11 || (int)currentState == 12 || (int)currentState == 13 || (int)currentState == 14 || (int)currentState == 15; if (flag && !_transformed) { if (!_counting) { _counting = true; _countdown = Plugin.AlphaCountdownSeconds.Value; } _countdown -= Time.deltaTime; if (SemiFunc.IsMasterClientOrSingleplayer()) { FusionShared.FreezeAgent(_duck.enemy); if ((int)currentState == 12 || (int)currentState == 13 || (int)currentState == 14 || (int)currentState == 15) { InvokeUpdateState((State)11); } if (_countdown <= 0f) { _transformed = true; _counting = false; bool num = SwapWithRandomEnemy(); InvokeUpdateState((State)12); if (num) { try { SemiFunc.UIFocusText("The Alpha howls — the hunt is on!", Color.white, new Color(1f, 0.3f, 0.1f), 3f); } catch { } _prey = FusionShared.NearestPlayer(((Component)this).transform.position, 60f); _huntUntil = Time.time + Plugin.AlphaHuntSeconds.Value; _relureTimer = 0f; Plugin.Log.LogInfo((object)"[Alpha] Howl — swapped places and summoned the map to the hunt."); } else { Plugin.Log.LogInfo((object)"[Alpha] No other enemy to swap with — normal transform attack."); } } } else if (_countdown <= 0f) { _counting = false; } } else if (!flag && (int)currentState != 16) { _counting = false; _transformed = false; } if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } EnsureHpDoubled(); if (Time.time < _huntUntil && (Object)(object)_prey != (Object)null && (Object)(object)_prey.playerTransform != (Object)null) { _relureTimer -= Time.deltaTime; if (_relureTimer <= 0f) { _relureTimer = 2f; SummonPack(_prey.playerTransform.position); } } } private void OnGUI() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_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_004f: 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_007e: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown //IL_00b1: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) if (!_counting || (Object)(object)_duck == (Object)null) { return; } Camera main = Camera.main; if (!((Object)(object)main == (Object)null)) { Vector3 val = ((Component)this).transform.position + Vector3.up * 1.2f; Vector3 val2 = main.WorldToScreenPoint(val); if (!(val2.z <= 0f)) { int num = Mathf.Max(0, Mathf.CeilToInt(_countdown)); GUIStyle val3 = new GUIStyle(GUI.skin.label) { fontSize = 40, fontStyle = (FontStyle)1, alignment = (TextAnchor)4 }; val3.normal.textColor = ((_countdown <= 2f) ? Color.red : Color.white); GUI.Label(new Rect(val2.x - 40f, (float)Screen.height - val2.y - 40f, 80f, 80f), num.ToString(), val3); } } } private bool SwapWithRandomEnemy() { //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010b: 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) try { EnemyDirector instance = EnemyDirector.instance; EnemyParent componentInParent = ((Component)this).GetComponentInParent(); PhysGrabObject val = (((Object)(object)componentInParent != (Object)null) ? ((Component)componentInParent).GetComponentInChildren() : null); if ((Object)(object)instance == (Object)null || instance.enemiesSpawned == null || (Object)(object)val == (Object)null) { return false; } List list = new List(); foreach (EnemyParent item in instance.enemiesSpawned) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item == (Object)(object)componentInParent)) { PhysGrabObject componentInChildren = ((Component)item).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && ((Component)componentInChildren).gameObject.activeInHierarchy) { list.Add(componentInChildren); } } } if (list.Count == 0) { return false; } PhysGrabObject val2 = list[Random.Range(0, list.Count)]; Vector3 position = ((Component)val).transform.position; Vector3 position2 = ((Component)val2).transform.position; val2.Teleport(position, ((Component)val2).transform.rotation); val.Teleport(position2, ((Component)val).transform.rotation); Plugin.Log.LogInfo((object)("[Alpha] Transformed — swapped places with '" + ((Object)val2).name + "'.")); return true; } catch (Exception arg) { Plugin.Log.LogError((object)$"[Alpha] swap error: {arg}"); return false; } } private void InvokeUpdateState(State state) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) try { if ((object)_updateStateMethod == null) { _updateStateMethod = typeof(EnemyDuck).GetMethod("UpdateState", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } _updateStateMethod?.Invoke(_duck, new object[1] { state }); } catch (Exception arg) { Plugin.Log.LogError((object)$"[Alpha] UpdateState error: {arg}"); } } private void SummonPack(Vector3 pos) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) EnemyDirector instance = EnemyDirector.instance; if ((Object)(object)instance == (Object)null || instance.enemiesSpawned == null) { return; } EnemyParent componentInParent = ((Component)this).GetComponentInParent(); foreach (EnemyParent item in instance.enemiesSpawned) { if ((Object)(object)item == (Object)null || (Object)(object)item == (Object)(object)componentInParent) { continue; } EnemyStateInvestigate componentInChildren = ((Component)item).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { try { componentInChildren.Set(pos, false); } catch { } } } } private void EnsureHpDoubled() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } } public class TricycleFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(0.85f, 0.15f, 0.6f); private static FieldInfo? _f_bellRingDelay; private static FieldInfo? _f_attackCooldown; private static FieldInfo? _f_lastSeenPlayerTimer; private static bool _timingFieldsResolved; private EnemyHealth? _health; private EnemyTricycle? _tricycle; private PhotonView? _pv; private bool _hpDone; private bool _dmgDone; private float _glowTimer; private bool _tellFired; private bool _cargoRunning; private void Awake() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _tricycle = ((Component)this).GetComponent(); _pv = ((Component)this).GetComponent(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); ResolveTimingFields(); } private static void ResolveTimingFields() { if (!_timingFieldsResolved) { _timingFieldsResolved = true; Type? typeFromHandle = typeof(EnemyTricycle); _f_bellRingDelay = typeFromHandle.GetField("bellRingDelay", BindingFlags.Instance | BindingFlags.NonPublic); _f_attackCooldown = typeFromHandle.GetField("attackCooldown", BindingFlags.Instance | BindingFlags.NonPublic); _f_lastSeenPlayerTimer = typeFromHandle.GetField("lastSeenPlayerTimer", BindingFlags.Instance | BindingFlags.NonPublic); } } private void Update() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if (SemiFunc.IsMasterClientOrSingleplayer()) { EnsureHpDoubled(); EnsureDamageBumped(); ApplyAngerTiming(); CheckTell(); } } private void ApplyAngerTiming() { if ((Object)(object)_tricycle == (Object)null) { return; } try { float num = Mathf.Max(1f, Plugin.BelladonnaAngerSpeedMultiplier.Value); if (_f_bellRingDelay != null) { float num2 = (float)_f_bellRingDelay.GetValue(_tricycle); if (num2 > 0.15f) { _f_bellRingDelay.SetValue(_tricycle, Mathf.Max(0.15f, num2 / num)); } } if (_f_attackCooldown != null) { float num3 = (float)_f_attackCooldown.GetValue(_tricycle); if (num3 > 0.3f) { _f_attackCooldown.SetValue(_tricycle, Mathf.Max(0.3f, num3 / num)); } } if (_f_lastSeenPlayerTimer != null) { float num4 = (float)_f_lastSeenPlayerTimer.GetValue(_tricycle); float num5 = Mathf.Max(1f, Plugin.BelladonnaMemoryMultiplier.Value); if (num4 > 0f && num4 < 10f) { _f_lastSeenPlayerTimer.SetValue(_tricycle, Mathf.Min(10f, num4 + Time.deltaTime * (num5 - 1f))); } } } catch { } } private void CheckTell() { //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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Invalid comparison between Unknown and I4 //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Invalid comparison between Unknown and I4 //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Invalid comparison between Unknown and I4 //IL_004c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_tricycle == (Object)null) { return; } State currentState = _tricycle.currentState; if ((int)currentState != 7 && (int)currentState != 9 && (int)currentState != 10) { _tellFired = false; } else if (!_tellFired) { _tellFired = true; PlayerAvatar val = FusionShared.NearestPlayer(((Component)this).transform.position, 35f); if (!((Object)(object)val == (Object)null) && !((Object)(object)val.playerTransform == (Object)null) && !_cargoRunning) { ((MonoBehaviour)this).StartCoroutine(CursedCargoVolley(val)); } } } private IEnumerator CursedCargoVolley(PlayerAvatar target) { _cargoRunning = true; List cargo = new List(); int num = Mathf.Clamp(Plugin.BelladonnaCargoCount.Value, 1, 10); foreach (PhysGrabObject item in FusionShared.PhysObjectsInRadius(((Component)this).transform.position, Mathf.Max(1f, Plugin.BelladonnaCargoRadius.Value))) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item.rb == (Object)null) && !((Object)(object)((Component)item).GetComponentInParent() == (Object)null)) { cargo.Add(item); if (cargo.Count >= num) { break; } } } if (cargo.Count == 0) { _cargoRunning = false; yield break; } float charge = 0.75f; if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("CargoBellRPC", (RpcTarget)0, new object[1] { charge }); } else { CargoBellRPC(charge); } float elapsed = 0f; while (elapsed < charge) { elapsed += Time.deltaTime; for (int i = 0; i < cargo.Count; i++) { PhysGrabObject val = cargo[i]; if (!((Object)(object)val?.rb == (Object)null) && !val.grabbed) { float num2 = Time.time * 4f + (float)i / (float)cargo.Count * (float)Math.PI * 2f; Vector3 val2 = ((Component)this).transform.position + Vector3.up * 1.1f + new Vector3(Mathf.Cos(num2), 0f, Mathf.Sin(num2)) * 1.7f; val.OverrideZeroGravity(0.2f); val.rb.AddForce((val2 - val.rb.worldCenterOfMass) * 18f, (ForceMode)5); val.rb.AddTorque(Vector3.up * 2f, (ForceMode)5); } } yield return null; } foreach (PhysGrabObject item2 in cargo) { if (!((Object)(object)item2?.rb == (Object)null) && !item2.grabbed) { Vector3 val3 = (((Object)(object)target != (Object)null) ? (((Component)target).transform.position + Vector3.up) : (((Component)this).transform.position + ((Component)this).transform.forward * 8f)) - item2.rb.worldCenterOfMass; if (((Vector3)(ref val3)).sqrMagnitude < 0.01f) { val3 = ((Component)this).transform.forward; } try { item2.ResetMass(); item2.ResetIndestructible(); } catch { } Rigidbody rb = item2.rb; rb.velocity *= 0.2f; item2.rb.AddForce(((Vector3)(ref val3)).normalized * Mathf.Min(24f * item2.rb.mass, 120f), (ForceMode)1); FusionShared.BoostThrownImpact(item2, Mathf.Max(1f, Plugin.BelladonnaCargoImpactMultiplier.Value), 3f); yield return (object)new WaitForSeconds(Mathf.Max(0.05f, Plugin.BelladonnaCargoLaunchInterval.Value)); } } _cargoRunning = false; } [PunRPC] private void CargoBellRPC(float charge) { //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) FusionShared.SpawnWarningRing(FusionShared.ProjectToGround(((Component)this).transform.position), AuraColor, 0.25f, 2.2f, charge); } private void EnsureDamageBumped() { if (_dmgDone) { return; } _dmgDone = true; try { EnemyParent componentInParent = ((Component)this).GetComponentInParent(); HurtCollider[] componentsInChildren = ((Component)(((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.EnableObject != (Object)null) ? componentInParent.EnableObject.transform : ((Component)this).transform)).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].playerDamage = Plugin.BelladonnaAttackDamage.Value; } } catch { } } private void OnDisable() { ((MonoBehaviour)this).StopAllCoroutines(); _cargoRunning = false; } private void EnsureHpDoubled() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } } public class TumblerFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(1f, 0.35f, 0.05f); private EnemyHealth? _health; private EnemyTumbler? _tumbler; private PhysGrabObject? _pgo; private Enemy? _enemy; private bool _hpDone; private float _glowTimer; private bool _volleyFired; private static FieldInfo? _pgoSpawnedField; private void Awake() { //IL_0091: Unknown result type (might be due to invalid IL or missing references) _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _tumbler = ((Component)this).GetComponent(); _pgo = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _enemy = ((Component)this).GetComponent() ?? ((Component)this).GetComponentInParent(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Invalid comparison between Unknown and I4 _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if (SemiFunc.IsMasterClientOrSingleplayer()) { EnsureHpDoubled(); } if ((Object)(object)_tumbler == (Object)null || (int)_tumbler.currentState != 7) { _volleyFired = false; } else if (!_volleyFired) { _volleyFired = true; if (SemiFunc.IsMasterClientOrSingleplayer()) { LaunchGrenadeVolley(); } } } private void LaunchGrenadeVolley() { //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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_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_0112: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) try { Item grenadeItem = Plugin.GetGrenadeItem(); if ((Object)(object)grenadeItem == (Object)null) { Plugin.Log.LogWarning((object)"[Flambe] shop grenade item not found — volley skipped."); return; } Vector3 forward = ((Component)this).transform.forward; forward.y = 0f; if (((Vector3)(ref forward)).sqrMagnitude < 0.01f) { forward = Vector3.forward; } ((Vector3)(ref forward)).Normalize(); Vector3 val = Vector3.Cross(Vector3.up, forward); Vector3 val2 = ((Component)this).transform.position + Vector3.up * 1.6f; Vector3[] array = (Vector3[])(object)new Vector3[4] { forward, -forward, val, -val }; foreach (Vector3 val3 in array) { Vector3 val4 = val2 + val3 * 1.1f; GameObject val5; if (SemiFunc.IsMultiplayer()) { val5 = NetworkPrefabs.SpawnNetworkPrefab(grenadeItem.prefab, val4, Quaternion.identity, (byte)0, new object[1] { "MatsuFlambeGrenade" }); } else { val5 = Object.Instantiate(((PrefabRef)(object)grenadeItem.prefab).Prefab, val4, Quaternion.identity); if ((Object)(object)val5 != (Object)null) { val5.AddComponent(); } } if (!((Object)(object)val5 == (Object)null)) { IgnoreChefCollision(val5); ((MonoBehaviour)Plugin.Instance).StartCoroutine(ArmAndLaunch(val5, val3)); } } Plugin.Log.LogInfo((object)"[Flambe] Live grenade volley!"); } catch (Exception arg) { Plugin.Log.LogError((object)$"[Flambe] volley error: {arg}"); } } private static IEnumerator ArmAndLaunch(GameObject go, Vector3 dir) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Rigidbody rb = (((Object)(object)go != (Object)null) ? go.GetComponent() : null); PhysGrabObject pgo = (((Object)(object)go != (Object)null) ? go.GetComponent() : null); if ((object)_pgoSpawnedField == null) { _pgoSpawnedField = typeof(PhysGrabObject).GetField("spawned", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } float t = 0f; while (t < 3f) { if ((Object)(object)go == (Object)null) { yield break; } bool flag = true; try { flag = _pgoSpawnedField == null || (bool)(_pgoSpawnedField.GetValue(pgo) ?? ((object)true)); } catch { } if ((Object)(object)rb != (Object)null && !rb.isKinematic && flag) { break; } t += Time.deltaTime; yield return null; } if ((Object)(object)go == (Object)null) { yield break; } try { ItemToggle component = go.GetComponent(); if (component != null) { component.ToggleItem(true, -1); } ItemGrenade component2 = go.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.isSpawnedGrenade = true; component2.tickTime = Plugin.FlambeGrenadeFuse.Value; } if ((Object)(object)rb != (Object)null) { rb.AddForce(dir * Plugin.FlambeGrenadeSpeed.Value + Vector3.up * 2.5f, (ForceMode)1); rb.AddTorque(Random.insideUnitSphere * 3f, (ForceMode)1); } } catch (Exception arg) { Plugin.Log.LogError((object)$"[Flambe] arm error: {arg}"); } } private void IgnoreChefCollision(GameObject grenade) { try { EnemyParent componentInParent = ((Component)this).GetComponentInParent(); Transform val = (((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.EnableObject != (Object)null) ? componentInParent.EnableObject.transform : ((Component)this).transform); Collider[] componentsInChildren = grenade.GetComponentsInChildren(true); foreach (Collider val2 in componentsInChildren) { Collider[] componentsInChildren2 = ((Component)val).GetComponentsInChildren(true); foreach (Collider val3 in componentsInChildren2) { try { Physics.IgnoreCollision(val2, val3, true); } catch { } } } } catch { } } private void EnsureHpDoubled() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } } public class FlambeGrenadeMarker : MonoBehaviour { } public class RedlineFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(1f, 0.04f, 0.02f); private EnemyRunner _runner; private Enemy? _enemy; private EnemyHealth? _health; private PhotonView? _pv; private NavMeshAgent? _agent; private float _baseSpeed; private float _baseAcceleration; private bool _hpDone; private float _glowTimer; private readonly List _route = new List(); private float _sampleTimer; private float _replayCooldown; private State _previousState; private bool _stateReady; private void Awake() { //IL_00d9: Unknown result type (might be due to invalid IL or missing references) _runner = ((Component)this).GetComponent(); _enemy = (((Object)(object)_runner != (Object)null) ? _runner.enemy : ((Component)this).GetComponent()); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _pv = ((Component)this).GetComponent(); _agent = FusionShared.GetUnityAgent(_enemy); if ((Object)(object)_agent != (Object)null) { _baseSpeed = _agent.speed; _baseAcceleration = _agent.acceleration; } if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Invalid comparison between Unknown and I4 //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Invalid comparison between Unknown and I4 //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_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_014c: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Invalid comparison between Unknown and I4 //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Invalid comparison between Unknown and I4 //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if (!SemiFunc.IsMasterClientOrSingleplayer() || (Object)(object)_runner == (Object)null) { return; } EnsureHealth(); bool flag = IsPursuing(_runner.currentState); if ((Object)(object)_agent != (Object)null) { if (flag) { float num = Mathf.Max(1f, Plugin.RedlineSpeedMultiplier.Value); _agent.speed = Mathf.Max(0.1f, _baseSpeed * num); _agent.acceleration = Mathf.Max(_baseAcceleration, _baseAcceleration * num); } else { _agent.speed = _baseSpeed; _agent.acceleration = _baseAcceleration; } } bool flag2 = (int)_runner.currentState == 7 || (int)_runner.currentState == 8; if (flag) { _sampleTimer -= Time.deltaTime; if (_sampleTimer <= 0f) { _sampleTimer = 0.12f; Vector3 val = FusionShared.ProjectToGround(((Component)this).transform.position); if (_route.Count == 0 || Vector3.Distance(_route[_route.Count - 1], val) >= 0.25f) { _route.Add(val); } while (_route.Count > 28) { _route.RemoveAt(0); } } } _replayCooldown -= Time.deltaTime; if (!_stateReady) { _previousState = _runner.currentState; _stateReady = true; return; } if (((flag2 && (int)_previousState != 7 && (int)_previousState != 8) || (flag2 && _route.Count >= 24)) && _replayCooldown <= 0f && _route.Count >= 6) { _replayCooldown = Mathf.Max(1.5f, Plugin.RedlineWakeInterval.Value); Vector3[] array = _route.ToArray(); _route.Clear(); float[] array2 = new float[array.Length * 3]; for (int i = 0; i < array.Length; i++) { array2[i * 3] = array[i].x; array2[i * 3 + 1] = array[i].y; array2[i * 3 + 2] = array[i].z; } if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("RedlineRouteRPC", (RpcTarget)0, new object[1] { array2 }); } else { RedlineRouteRPC(array2); } } _previousState = _runner.currentState; } private static bool IsPursuing(State state) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Invalid comparison between Unknown and I4 //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 if ((int)state != 4 && (int)state != 5 && (int)state != 6 && (int)state != 7 && (int)state != 8) { return (int)state == 9; } return true; } [PunRPC] private void RedlineRouteRPC(float[] packed) { //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_004e: Unknown result type (might be due to invalid IL or missing references) if (packed != null && packed.Length >= 6 && packed.Length % 3 == 0) { Vector3[] array = (Vector3[])(object)new Vector3[packed.Length / 3]; for (int i = 0; i < array.Length; i++) { array[i] = new Vector3(packed[i * 3], packed[i * 3 + 1], packed[i * 3 + 2]); } new GameObject("MatsuRedlineRouteReplay").AddComponent().Initialize(array, Mathf.Max(0.2f, Plugin.RedlineWakeSize.Value), Mathf.Max(0, Plugin.RedlineWakeDamage.Value), _enemy); } } private void EnsureHealth() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } private void OnDisable() { if ((Object)(object)_agent != (Object)null) { _agent.speed = _baseSpeed; _agent.acceleration = _baseAcceleration; } _route.Clear(); } } public class RedlineRouteReplay : MonoBehaviour { private Vector3[] _points; private float _width; private int _damage; private Enemy? _source; private LineRenderer? _line; private Material? _material; private Light? _pulse; private float _age; private const float Warning = 0.8f; private const float Travel = 1.25f; private bool _hit; public void Initialize(Vector3[] points, float width, int damage, Enemy? source) { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_010b: 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_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Expected O, but got Unknown //IL_0152: 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_00d3: Expected O, but got Unknown _points = points; _width = width; _damage = damage; _source = source; _line = ((Component)this).gameObject.AddComponent(); _line.useWorldSpace = true; _line.positionCount = points.Length; _line.widthMultiplier = Mathf.Max(0.08f, width * 0.22f); ((Renderer)_line).shadowCastingMode = (ShadowCastingMode)0; for (int i = 0; i < points.Length; i++) { _line.SetPosition(i, points[i] + Vector3.up * 0.08f); } Shader val = Shader.Find("Sprites/Default") ?? Shader.Find("Unlit/Color"); if ((Object)(object)val != (Object)null) { _material = new Material(val); ((Renderer)_line).material = _material; } LineRenderer? line = _line; LineRenderer? line2 = _line; Color val2 = default(Color); ((Color)(ref val2))..ctor(1f, 0.03f, 0.01f, 0.95f); line2.endColor = val2; line.startColor = val2; GameObject val3 = new GameObject("Pulse"); val3.transform.SetParent(((Component)this).transform, false); _pulse = val3.AddComponent(); _pulse.type = (LightType)2; _pulse.color = RedlineFusion.AuraColor; _pulse.range = width * 3f; _pulse.intensity = 10f; _pulse.shadows = (LightShadows)0; val3.SetActive(false); } private void Update() { //IL_00db: 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_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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0136: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: 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_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_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: 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_01fe: 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) _age += Time.deltaTime; if ((Object)(object)_line != (Object)null) { float num = ((_age < 0.8f) ? (0.45f + Mathf.Abs(Mathf.Sin(_age * 12f)) * 0.5f) : 1f); LineRenderer? line = _line; LineRenderer? line2 = _line; Color val = default(Color); ((Color)(ref val))..ctor(1f, 0.03f, 0.01f, num); line2.endColor = val; line.startColor = val; } if (_age < 0.8f) { return; } float num2 = Mathf.Clamp01((_age - 0.8f) / 1.25f); float num3 = num2 * (float)(_points.Length - 1); int num4 = Mathf.Min(_points.Length - 2, Mathf.FloorToInt(num3)); Vector3 val2 = Vector3.Lerp(_points[num4], _points[num4 + 1], num3 - (float)num4) + Vector3.up * 0.12f; if ((Object)(object)_pulse != (Object)null) { ((Component)_pulse).gameObject.SetActive(true); ((Component)_pulse).transform.position = val2; } if (!_hit) { foreach (PlayerAvatar item in FusionShared.AllPlayers()) { if (FusionShared.IsLocalPlayer(item) && !FusionShared.IsPlayerDisabled(item) && !(Vector3.Distance(((Component)item).transform.position + Vector3.up * 0.5f, val2) > _width)) { _hit = true; FusionShared.HurtOwnedPlayer(item, _damage, val2, _source); Vector3 val3 = ((Component)item).transform.position - val2; try { item.ForceImpulse(((((Vector3)(ref val3)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val3)).normalized : Vector3.up) * 7f + Vector3.up * 2f); } catch { } break; } } } if (num2 >= 1f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void OnDestroy() { if ((Object)(object)_material != (Object)null) { Object.Destroy((Object)(object)_material); } } } public class TricksterSplitChildMarker : MonoBehaviour { internal float CreatedAt { get; private set; } private void Awake() { CreatedAt = Time.time; } } [HarmonyPatch(typeof(EnemyGnome), "OnDeath")] internal static class TricksterGnomeDeathPatch { private static void Prefix(EnemyGnome __instance) { try { if (__instance != null) { ((Component)__instance).GetComponent()?.SplitOnDeath(); } } catch (Exception arg) { Plugin.Log.LogError((object)$"[Trickster] split error: {arg}"); } } } [HarmonyPatch(typeof(EnemyGnome), "OnSpawn")] internal static class TricksterGnomeSpawnPatch { private static void Postfix(EnemyGnome __instance) { try { if (__instance != null) { ((Component)__instance).GetComponent()?.ResetSplitForRespawn(); } } catch (Exception arg) { Plugin.Log.LogError((object)$"[Trickster] respawn reset error: {arg}"); } } } public class SingularityFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(0.35f, 0.05f, 0.75f); private EnemyBowtie _bowtie; private Enemy? _enemy; private EnemyHealth? _health; private bool _hpDone; private float _glowTimer; private float _ringTimer; private float _worldPullTimer; private bool _stateInitialized; private State _previousState; private readonly HashSet _orbiting = new HashSet(); private void Awake() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) _bowtie = ((Component)this).GetComponent(); _enemy = ((Component)this).GetComponent(); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: 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_007a: 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_006b: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Invalid comparison between Unknown and I4 //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Invalid comparison between Unknown and I4 //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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Invalid comparison between Unknown and I4 //IL_00f8: 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) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if (SemiFunc.IsMasterClientOrSingleplayer()) { EnsureHealth(); } if ((Object)(object)_bowtie == (Object)null) { return; } State currentState = _bowtie.currentState; if (!_stateInitialized) { _previousState = currentState; _stateInitialized = true; } else if (currentState != _previousState) { if ((int)_previousState == 5 && (int)currentState != 5) { ReleaseOrbit(); } _previousState = currentState; } if ((int)currentState != 5) { _ringTimer = 0f; _worldPullTimer = 0f; return; } _ringTimer -= Time.deltaTime; if (_ringTimer <= 0f) { _ringTimer = 0.65f; float startRadius = Mathf.Max(1f, Plugin.SingularityPullRadius.Value); FusionShared.SpawnWarningRing(Center(), AuraColor, startRadius, 0.35f, 0.65f); } } private void FixedUpdate() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: 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_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_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_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_bowtie == (Object)null || (int)_bowtie.currentState != 5) { return; } Vector3 val = Center(); float num = Mathf.Max(0.5f, Plugin.SingularityPullRadius.Value); float num2 = Mathf.Max(0f, Plugin.SingularityPullForce.Value); foreach (PlayerAvatar item in FusionShared.AllPlayers()) { if ((Object)(object)item == (Object)null || FusionShared.IsPlayerDisabled(item) || (SemiFunc.IsMultiplayer() && (!((Object)(object)item.photonView != (Object)null) || !item.photonView.IsMine))) { continue; } PhysGrabObject playerPhysGrabObject = FusionShared.GetPlayerPhysGrabObject(item); if (!((Object)(object)playerPhysGrabObject == (Object)null) && !((Object)(object)playerPhysGrabObject.rb == (Object)null)) { Vector3 val2 = val - playerPhysGrabObject.rb.worldCenterOfMass; float magnitude = ((Vector3)(ref val2)).magnitude; if (!(magnitude <= 0.1f) && !(magnitude > num)) { float num3 = 1f - magnitude / num; playerPhysGrabObject.rb.AddForce(((Vector3)(ref val2)).normalized * num2 * Mathf.Lerp(0.35f, 1f, num3), (ForceMode)5); } } } if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } _worldPullTimer -= Time.fixedDeltaTime; if (_worldPullTimer > 0f) { return; } _worldPullTimer = 0.08f; foreach (PhysGrabObject item2 in FusionShared.PhysObjectsInRadius(val, num)) { if (!((Object)(object)item2 == (Object)null) && !((Object)(object)item2.rb == (Object)null) && !((Object)(object)((Component)item2).GetComponentInParent() != (Object)null) && !((Object)(object)((Component)item2).GetComponentInParent() == (Object)null)) { _orbiting.Add(item2); Vector3 val3 = val - item2.rb.worldCenterOfMass; if (!(((Vector3)(ref val3)).magnitude <= 0.1f)) { Vector3 normalized = ((Vector3)(ref val3)).normalized; Vector3 val4 = Vector3.Cross(Vector3.up, normalized); Vector3 normalized2 = ((Vector3)(ref val4)).normalized; item2.OverrideZeroGravity(0.2f); item2.rb.AddForce((normalized * num2 + normalized2 * Mathf.Max(0f, Plugin.SingularityOrbitForce.Value)) * _worldPullTimer, (ForceMode)2); } } } } private void ReleaseOrbit() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_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_00bf: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Center(); FusionShared.SpawnWarningRing(FusionShared.ProjectToGround(val), Color.white, Mathf.Max(0.5f, Plugin.SingularityPullRadius.Value), 0.1f, 0.35f); if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } int num = 0; foreach (PhysGrabObject item in new List(_orbiting)) { if (!((Object)(object)item?.rb == (Object)null) && !item.grabbed) { List list = FusionShared.AllPlayers(); PlayerAvatar val2 = ((list.Count > 0) ? list[num++ % list.Count] : null); Vector3 val3 = (((Object)(object)val2 != (Object)null) ? (((Component)val2).transform.position + Vector3.up - item.rb.worldCenterOfMass) : (item.rb.worldCenterOfMass - val)); if (((Vector3)(ref val3)).sqrMagnitude < 0.01f) { val3 = ((Component)this).transform.forward; } try { item.ResetMass(); item.ResetIndestructible(); } catch { } Rigidbody rb = item.rb; rb.velocity *= 0.15f; float num2 = Mathf.Max(1f, Plugin.SingularityLaunchForce.Value) * Mathf.Max(0.5f, item.rb.mass); item.rb.AddForce(((Vector3)(ref val3)).normalized * Mathf.Min(num2, 140f), (ForceMode)1); FusionShared.BoostThrownImpact(item, Mathf.Max(1f, Plugin.SingularityImpactMultiplier.Value), 3.5f); } } _orbiting.Clear(); Plugin.Log.LogInfo((object)"[Singularity] Released its orbital debris barrage."); } private Vector3 Center() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_enemy != (Object)null) || !((Object)(object)_enemy.CenterTransform != (Object)null)) { return ((Component)this).transform.position; } return _enemy.CenterTransform.position; } private void EnsureHealth() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } private void OnDisable() { _orbiting.Clear(); } } public class FaultlineFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(1f, 0.55f, 0.08f); private EnemySlowWalker _walker; private Enemy? _enemy; private EnemyHealth? _health; private PhotonView? _pv; private bool _hpDone; private float _glowTimer; private bool _stateInitialized; private bool _burstRunning; private State _previousState; private void Awake() { //IL_0098: Unknown result type (might be due to invalid IL or missing references) _walker = ((Component)this).GetComponent(); _enemy = (((Object)(object)_walker != (Object)null) ? _walker.enemy : ((Component)this).GetComponent()); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _pv = ((Component)this).GetComponent(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: 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_0079: 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_006b: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_009c: 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) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if (!SemiFunc.IsMasterClientOrSingleplayer() || (Object)(object)_walker == (Object)null) { return; } EnsureHealth(); State currentState = _walker.currentState; if (!_stateInitialized) { _previousState = currentState; _stateInitialized = true; } else if (currentState != _previousState) { if ((int)currentState == 7 && !_burstRunning) { ((MonoBehaviour)this).StartCoroutine(EruptionLine()); } _previousState = currentState; } } private IEnumerator EruptionLine() { _burstRunning = true; Vector3 val = (((Object)(object)_enemy != (Object)null && (Object)(object)_enemy.CenterTransform != (Object)null) ? _enemy.CenterTransform.position : ((Component)this).transform.position); PlayerAvatar val2 = FusionShared.NearestPlayer(val, 40f); Vector3 val3 = (((Object)(object)val2 != (Object)null) ? (((Component)val2).transform.position - val) : ((Component)this).transform.forward); val3.y = 0f; if (((Vector3)(ref val3)).sqrMagnitude < 0.01f) { val3 = ((Component)this).transform.forward; } ((Vector3)(ref val3)).Normalize(); val = FusionShared.ProjectToGround(val + val3 * 0.8f); float num = (float)Mathf.Clamp(Plugin.FaultlineEruptionCount.Value, 1, 8) * Mathf.Max(0.5f, Plugin.FaultlineEruptionSpacing.Value); Vector3 val4 = FusionShared.ProjectToGround(val + Quaternion.Euler(0f, -38f, 0f) * val3 * num); Vector3 val5 = FusionShared.ProjectToGround(val + val3 * num); Vector3 val6 = FusionShared.ProjectToGround(val + Quaternion.Euler(0f, 38f, 0f) * val3 * num); float num2 = Mathf.Max(0.2f, Plugin.FaultlineEruptionDelay.Value); if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("FaultlineCracksRPC", (RpcTarget)0, new object[5] { val, val4, val5, val6, num2 }); } else { FaultlineCracksRPC(val, val4, val5, val6, num2); } yield return (object)new WaitForSeconds(0.4f); _burstRunning = false; } [PunRPC] private void FaultlineCracksRPC(Vector3 origin, Vector3 endLeft, Vector3 endCenter, Vector3 endRight, float warning) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_0018: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) Vector3[] ends = (Vector3[])(object)new Vector3[3] { endLeft, endCenter, endRight }; new GameObject("MatsuFaultlinePersistentCracks").AddComponent().Initialize(origin, ends, warning, 7.5f, Mathf.Max(0.15f, Plugin.FaultlineEruptionSize.Value), Mathf.Max(0, Plugin.FaultlineEruptionDamage.Value), _enemy); } private void EnsureHealth() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } private void OnDisable() { ((MonoBehaviour)this).StopAllCoroutines(); _burstRunning = false; } } public class FaultlineCrackField : MonoBehaviour { private Vector3 _origin; private Vector3[] _ends; private readonly List _lines = new List(); private readonly List _materials = new List(); private float _warning; private float _lifetime; private float _width; private int _damage; private Enemy? _source; private float _age; private float _nextHit; public void Initialize(Vector3 origin, Vector3[] ends, float warning, float lifetime, float width, int damage, Enemy? source) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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_00fe: Expected O, but got Unknown _origin = origin; _ends = ends; _warning = warning; _lifetime = lifetime; _width = width; _damage = damage; _source = source; Shader val = Shader.Find("Sprites/Default") ?? Shader.Find("Unlit/Color"); foreach (Vector3 val2 in ends) { GameObject val3 = new GameObject("CrackBranch"); val3.transform.SetParent(((Component)this).transform, false); LineRenderer val4 = val3.AddComponent(); val4.useWorldSpace = true; val4.positionCount = 2; val4.SetPosition(0, origin + Vector3.up * 0.07f); val4.SetPosition(1, val2 + Vector3.up * 0.07f); val4.widthMultiplier = Mathf.Max(0.07f, width * 0.3f); ((Renderer)val4).shadowCastingMode = (ShadowCastingMode)0; if ((Object)(object)val != (Object)null) { Material item = (((Renderer)val4).material = new Material(val)); _materials.Add(item); } _lines.Add(val4); } } private void Update() { //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 references) //IL_00b6: 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_0139: 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_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: 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_01bd: Unknown result type (might be due to invalid IL or missing references) _age += Time.deltaTime; bool flag = _age >= _warning; float num = Mathf.Clamp01((_lifetime - _age) / 1.2f); Color val = default(Color); ((Color)(ref val))..ctor(1f, flag ? 0.28f : 0.7f, 0.02f, flag ? Mathf.Max(0.1f, num) : (0.35f + Mathf.Abs(Mathf.Sin(_age * 11f)) * 0.6f)); foreach (LineRenderer line in _lines) { if ((Object)(object)line != (Object)null) { Color startColor = (line.endColor = val); line.startColor = startColor; } } if (flag && Time.time >= _nextHit) { foreach (PlayerAvatar item in FusionShared.AllPlayers()) { if (!FusionShared.IsLocalPlayer(item) || FusionShared.IsPlayerDisabled(item)) { continue; } bool flag2 = false; Vector3[] ends = _ends; foreach (Vector3 end in ends) { if (FusionShared.DistanceToSegment(((Component)item).transform.position, _origin, end) <= _width) { flag2 = true; break; } } if (flag2) { _nextHit = Time.time + Mathf.Max(0.25f, Plugin.FaultlineHitCooldown.Value); FusionShared.HurtOwnedPlayer(item, _damage, _origin, _source); try { item.ForceImpulse(Vector3.up * 5f); } catch { } break; } } } if (_age >= _lifetime) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void OnDestroy() { foreach (Material material in _materials) { if ((Object)(object)material != (Object)null) { Object.Destroy((Object)(object)material); } } } } public class KaleidoscopeFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(0.1f, 0.95f, 1f); private static FieldInfo? _hitPositionField; private EnemyBeamer _beamer; private Enemy? _enemy; private EnemyHealth? _health; private PhotonView? _pv; private bool _hpDone; private float _glowTimer; private float _volleyTimer; private void Awake() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) _beamer = ((Component)this).GetComponent(); _enemy = ((Component)this).GetComponent() ?? ((Component)this).GetComponentInParent(); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _pv = ((Component)this).GetComponent(); if ((object)_hitPositionField == null) { _hitPositionField = typeof(EnemyBeamer).GetField("hitPosition", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Invalid comparison between Unknown and I4 _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if (!SemiFunc.IsMasterClientOrSingleplayer() || (Object)(object)_beamer == (Object)null) { return; } EnsureHealth(); if ((int)_beamer.currentState != 5) { _volleyTimer = 0f; return; } _volleyTimer -= Time.deltaTime; if (!(_volleyTimer > 0f)) { _volleyTimer = Mathf.Max(0.4f, Plugin.KaleidoscopeVolleyInterval.Value); FireVolley(); } } private void FireVolley() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_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_0048: 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_0039: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_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_00dd: 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_00c1: 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0116: 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_0121: 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) Vector3 val = (((Object)(object)_enemy != (Object)null && (Object)(object)_enemy.CenterTransform != (Object)null) ? _enemy.CenterTransform.position : ((Component)this).transform.position); Vector3 val2 = ReadImpactPoint(); Vector3 val3 = val2 - val; if (!(((Vector3)(ref val3)).sqrMagnitude < 0.25f)) { val3 = val2 - val; if (!(((Vector3)(ref val3)).sqrMagnitude > 6400f)) { goto IL_0099; } } PlayerAvatar val4 = FusionShared.NearestPlayer(val, 60f); if ((Object)(object)val4 == (Object)null) { return; } val2 = ((Component)val4).transform.position; goto IL_0099; IL_0099: Vector3 val5 = val2 - val; val5.y = 0f; if (((Vector3)(ref val5)).sqrMagnitude < 0.01f) { val5 = ((Component)this).transform.forward; } ((Vector3)(ref val5)).Normalize(); val3 = Vector3.Cross(Vector3.up, val5); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Mathf.Max(0.25f, Plugin.KaleidoscopeMarkSpacing.Value); float warning = Mathf.Max(0.1f, Plugin.KaleidoscopeWarningSeconds.Value); for (int i = -1; i <= 1; i++) { SendMark(FusionShared.ProjectToGround(val2 + normalized * num * (float)i), warning); } } private Vector3 ReadImpactPoint() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_003c: Unknown result type (might be due to invalid IL or missing references) try { object obj = _hitPositionField?.GetValue(_beamer); if (obj is Vector3) { return (Vector3)obj; } } catch { } return ((Component)this).transform.position; } private void SendMark(Vector3 position, float warning) { //IL_0040: 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) if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("KaleidoscopeMarkRPC", (RpcTarget)0, new object[2] { position, warning }); } else { KaleidoscopeMarkRPC(position, warning); } } [PunRPC] private void KaleidoscopeMarkRPC(Vector3 position, float warning) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: 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) FusionShared.SpawnWarningRing(position, AuraColor, 0.12f, Mathf.Max(0.2f, Plugin.KaleidoscopeBlastSize.Value * 1.35f), warning); ((MonoBehaviour)Plugin.Instance).StartCoroutine(KaleidoscopeBlast(position, warning)); } private IEnumerator KaleidoscopeBlast(Vector3 position, float warning) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return (object)new WaitForSeconds(warning); FusionShared.ExplodePlayerOnly(position, Mathf.Max(0.1f, Plugin.KaleidoscopeBlastSize.Value), Mathf.Max(0, Plugin.KaleidoscopeBlastDamage.Value), 1.7f, _enemy); } private void EnsureHealth() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } } public class HouseEdgeFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(0.95f, 0.8f, 0.08f); private EnemySpinny _spinny; private Enemy? _enemy; private EnemyHealth? _health; private PhotonView? _pv; private bool _hpDone; private float _glowTimer; private bool _stateInitialized; private bool _burstRunning; private State _previousState; private void Awake() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) _spinny = ((Component)this).GetComponent(); _enemy = ((Component)this).GetComponent() ?? ((Component)this).GetComponentInParent(); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _pv = ((Component)this).GetComponent(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: 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_0079: 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_006b: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Invalid comparison between Unknown and I4 //IL_009d: 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) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if (!SemiFunc.IsMasterClientOrSingleplayer() || (Object)(object)_spinny == (Object)null) { return; } EnsureHealth(); State currentState = _spinny.currentState; if (!_stateInitialized) { _previousState = currentState; _stateInitialized = true; } else if (currentState != _previousState) { if ((int)currentState == 11 && !_burstRunning) { ((MonoBehaviour)this).StartCoroutine(RouletteBurst()); } _previousState = currentState; } } private IEnumerator RouletteBurst() { _burstRunning = true; yield return null; Vector3 position = (((Object)(object)_spinny.playerTarget != (Object)null) ? ((Component)_spinny.playerTarget).transform.position : (((Object)(object)_enemy != (Object)null && (Object)(object)_enemy.CenterTransform != (Object)null) ? _enemy.CenterTransform.position : ((Component)this).transform.position)); position = FusionShared.ProjectToGround(position); float num = Mathf.Max(1f, Plugin.HouseEdgeRingRadius.Value); int num2 = (int)_spinny.GetCurrentColor(); if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("HouseRuleRPC", (RpcTarget)0, new object[3] { num2, position, num }); } else { HouseRuleRPC(num2, position, num); } ApplyHostRule((Colors)num2, position, num); yield return (object)new WaitForSeconds(0.5f); _burstRunning = false; } [PunRPC] private void HouseRuleRPC(int outcomeValue, Vector3 center, float radius) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_0007: Invalid comparison between Unknown and I4 //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Invalid comparison between Unknown and I4 //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_002e: 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_000f: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Invalid comparison between Unknown and I4 //IL_00b5: 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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) Colors val = (Colors)outcomeValue; Color color = (Color)(((int)val == 0) ? Color.red : (((int)val == 1) ? Color.yellow : (((int)val == 2) ? Color.green : (((int)val == 3) ? Color.white : new Color(0.2f, 0f, 0.25f))))); FusionShared.SpawnWarningRing(center, color, 0.2f, radius, 0.8f); if ((int)val == 0) { new GameObject("MatsuHouseRedLight").AddComponent().Initialize(center, radius, Mathf.Max(0.2f, Plugin.HouseEdgeWarningSeconds.Value), 3.2f, Mathf.Max(0.1f, Plugin.HouseEdgeBlastSize.Value), Mathf.Max(0, Plugin.HouseEdgeBlastDamage.Value), _enemy); return; } if ((int)val == 1) { foreach (PlayerAvatar item in FusionShared.PlayersInRadius(center, radius)) { if (FusionShared.IsLocalPlayer(item) && !((Object)(object)item.physGrabber == (Object)null)) { try { item.physGrabber.ReleaseObject(-1, 4f); item.physGrabber.OverrideGrabDisable(4f); } catch { } } } return; } if ((int)val == 3) { ((MonoBehaviour)this).StartCoroutine(WhiteLaunches(center, radius)); } } private IEnumerator WhiteLaunches(Vector3 center, float radius) { //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) int pulses = Mathf.Clamp(Plugin.HouseEdgeBlastCount.Value, 1, 6); for (int i = 0; i < pulses; i++) { foreach (PlayerAvatar item in FusionShared.PlayersInRadius(center, radius)) { if (FusionShared.IsLocalPlayer(item)) { Vector3 val = ((Component)item).transform.position - center; val.y = 0f; try { item.ForceImpulse(((((Vector3)(ref val)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val)).normalized : Vector3.forward) * 4f + Vector3.up * 5f); } catch { } } } yield return (object)new WaitForSeconds(Mathf.Max(0.05f, Plugin.HouseEdgeStepDelay.Value)); } } private void ApplyHostRule(Colors outcome, Vector3 center, float radius) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_0118: 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_01d3: 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_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } if ((int)outcome == 2) { int num = Mathf.Clamp(Plugin.HouseEdgeBlastCount.Value, 1, 10) * 10; EnemyDirector instance = EnemyDirector.instance; if (instance?.enemiesSpawned == null) { return; } { foreach (EnemyParent item in instance.enemiesSpawned) { if ((Object)(object)item == (Object)null || Vector3.Distance(((Component)item).transform.position, center) > radius) { continue; } EnemyHealth componentInChildren = ((Component)item).GetComponentInChildren(); if (!((Object)(object)componentInChildren == (Object)null)) { int num2 = Mathf.Max(0, componentInChildren.health - FusionShared.GetHealthCurrent(componentInChildren)); if (num2 > 0) { componentInChildren.Heal(Mathf.Min(num, num2)); } FusionShared.ApplyDamageResistanceAtLeast(componentInChildren, 0.4f, 6f); } } return; } } if ((int)outcome != 4) { return; } List list = FusionShared.PlayersInRadius(center, radius); if (list.Count > 1) { List list2 = new List(); foreach (PlayerAvatar item2 in list) { list2.Add(((Component)item2).transform.position); } for (int i = 0; i < list.Count; i++) { PlayerTeleportHelper.Trigger(list[i], list2[(i + 1) % list2.Count], 0, -1); } } else if (list.Count == 1) { Vector3 val = center - ((Component)list[0]).transform.position; val.y = 0f; try { list[0].ForceImpulse(((((Vector3)(ref val)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val)).normalized : Vector3.up) * 18f + Vector3.up * 4f); } catch { } } } private void EnsureHealth() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } private void OnDisable() { ((MonoBehaviour)this).StopAllCoroutines(); _burstRunning = false; } } public class HouseRedLightRule : MonoBehaviour { private Vector3 _center; private float _radius; private float _grace; private float _duration; private float _tolerance; private int _damage; private Enemy? _source; private float _age; private bool _armed; private readonly Dictionary _anchors = new Dictionary(); private readonly HashSet _hit = new HashSet(); public void Initialize(Vector3 center, float radius, float grace, float duration, float tolerance, int damage, Enemy? source) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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) _center = center; _radius = radius; _grace = grace; _duration = duration; _tolerance = tolerance; _damage = damage; _source = source; foreach (PlayerAvatar item in FusionShared.PlayersInRadius(center, radius)) { if (FusionShared.IsLocalPlayer(item)) { _anchors[((Object)item).GetInstanceID()] = ((Component)item).transform.position; } } } private void Update() { //IL_003b: 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_00d2: 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_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) _age += Time.deltaTime; if (!_armed && _age >= _grace) { _armed = true; _anchors.Clear(); foreach (PlayerAvatar item in FusionShared.PlayersInRadius(_center, _radius)) { if (FusionShared.IsLocalPlayer(item)) { _anchors[((Object)item).GetInstanceID()] = ((Component)item).transform.position; } } } if (_armed) { foreach (PlayerAvatar item2 in FusionShared.AllPlayers()) { if (!FusionShared.IsLocalPlayer(item2) || Vector3.Distance(((Component)item2).transform.position, _center) > _radius) { continue; } int instanceID = ((Object)item2).GetInstanceID(); if (!_hit.Contains(instanceID)) { if (!_anchors.TryGetValue(instanceID, out var value)) { _anchors[instanceID] = ((Component)item2).transform.position; } else if (!(Vector3.Distance(value, ((Component)item2).transform.position) <= _tolerance)) { _hit.Add(instanceID); FusionShared.HurtOwnedPlayer(item2, _damage, _center, _source); FusionShared.SpawnWarningRing(FusionShared.ProjectToGround(((Component)item2).transform.position), Color.red, 0.1f, 1.2f, 0.25f); } } } } if (_age >= _grace + _duration) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class ResonanceFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(0.25f, 0.8f, 1f); private EnemyUpscream _upscream; private Enemy? _enemy; private EnemyHealth? _health; private PhotonView? _pv; private bool _hpDone; private float _glowTimer; private bool _stateInitialized; private bool _sequenceRunning; private State _previousState; private void Awake() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) _upscream = ((Component)this).GetComponent(); _enemy = ((Component)this).GetComponent() ?? ((Component)this).GetComponentInParent(); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _pv = ((Component)this).GetComponent(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: 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_0079: 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_006b: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_009c: 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) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if (!SemiFunc.IsMasterClientOrSingleplayer() || (Object)(object)_upscream == (Object)null) { return; } EnsureHealth(); State currentState = _upscream.currentState; if (!_stateInitialized) { _previousState = currentState; _stateInitialized = true; } else if (currentState != _previousState) { if ((int)currentState == 6 && !_sequenceRunning) { ((MonoBehaviour)this).StartCoroutine(EchoSequence()); } _previousState = currentState; } } private IEnumerator EchoSequence() { _sequenceRunning = true; Vector3 val = (((Object)(object)_enemy != (Object)null && (Object)(object)_enemy.CenterTransform != (Object)null) ? _enemy.CenterTransform.position : ((Component)this).transform.position); float num = Mathf.Max(1f, Plugin.ResonanceMarkRadius.Value); float num2 = Mathf.Max(0.5f, Plugin.ResonanceCountdown.Value); if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("ResonanceMarkRPC", (RpcTarget)0, new object[3] { val, num, num2 }); } else { ResonanceMarkRPC(val, num, num2); } yield return (object)new WaitForSeconds(0.5f); _sequenceRunning = false; } [PunRPC] private void ResonanceMarkRPC(Vector3 origin, float radius, float countdown) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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) FusionShared.SpawnWarningRing(FusionShared.ProjectToGround(origin), AuraColor, 0.2f, radius, Mathf.Min(1f, countdown)); new GameObject("MatsuResonanceStillnessTest").AddComponent().Initialize(origin, radius, countdown, Mathf.Max(0.15f, Plugin.ResonanceRequiredStillness.Value), Mathf.Max(0, Plugin.ResonanceDamage.Value), _enemy); } private void EnsureHealth() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } private void OnDisable() { ((MonoBehaviour)this).StopAllCoroutines(); _sequenceRunning = false; } } public class ResonanceStillnessTest : MonoBehaviour { private sealed class Mark { internal PlayerAvatar Player; internal Vector3 LastPosition; internal float StillTime; } private readonly List _marks = new List(); private float _countdown; private float _requiredStillness; private int _damage; private Enemy? _source; private float _age; private bool _finalWarning; public void Initialize(Vector3 origin, float radius, float countdown, float requiredStillness, int damage, Enemy? source) { //IL_001f: 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_0046: 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) _countdown = countdown; _requiredStillness = requiredStillness; _damage = damage; _source = source; foreach (PlayerAvatar item in FusionShared.PlayersInRadius(origin, radius)) { FusionShared.SpawnWarningRing(FusionShared.ProjectToGround(((Component)item).transform.position), ResonanceFusion.AuraColor, 0.15f, 1f, Mathf.Min(1f, countdown)); if (FusionShared.IsLocalPlayer(item)) { _marks.Add(new Mark { Player = item, LastPosition = ((Component)item).transform.position }); } } } private void Update() { //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_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_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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) _age += Time.deltaTime; foreach (Mark mark in _marks) { if (!((Object)(object)mark.Player == (Object)null)) { Vector3 position = ((Component)mark.Player).transform.position; if (Vector3.Distance(position, mark.LastPosition) <= 0.018f) { mark.StillTime += Time.deltaTime; } else { mark.StillTime = 0f; } mark.LastPosition = position; } } if (!_finalWarning && _age >= Mathf.Max(0f, _countdown - 0.65f)) { _finalWarning = true; foreach (Mark mark2 in _marks) { if ((Object)(object)mark2.Player != (Object)null) { FusionShared.SpawnWarningRing(FusionShared.ProjectToGround(((Component)mark2.Player).transform.position), Color.white, 1.1f, 0.1f, 0.65f); } } } if (_age < _countdown) { return; } foreach (Mark mark3 in _marks) { if ((Object)(object)mark3.Player == (Object)null) { continue; } Vector3 position2 = ((Component)mark3.Player).transform.position; bool flag = mark3.StillTime >= _requiredStillness; FusionShared.SpawnWarningRing(FusionShared.ProjectToGround(position2), flag ? Color.green : ResonanceFusion.AuraColor, 0.1f, flag ? 0.8f : 1.6f, 0.3f); if (!flag) { FusionShared.HurtOwnedPlayer(mark3.Player, _damage, position2, _source); try { mark3.Player.ForceImpulse(Vector3.up * 7f); } catch { } } } Object.Destroy((Object)(object)((Component)this).gameObject); } } public class BloodBankFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(0.15f, 1f, 0.35f); private static FieldInfo? _stolenHealthField; private EnemyTick _tick; private Enemy? _enemy; private EnemyHealth? _health; private PhotonView? _pv; private bool _hpDone; private float _glowTimer; private int _lastStolenHealth; private void Awake() { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) _tick = ((Component)this).GetComponent(); _enemy = (((Object)(object)_tick != (Object)null) ? _tick.enemy : ((Component)this).GetComponent()); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _pv = ((Component)this).GetComponent(); if ((object)_stolenHealthField == null) { _stolenHealthField = typeof(EnemyTick).GetField("stolenHealth", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } _lastStolenHealth = ReadStolenHealth(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if (!SemiFunc.IsMasterClientOrSingleplayer() || (Object)(object)_tick == (Object)null) { return; } EnsureHealth(); int num = ReadStolenHealth(); if (num < _lastStolenHealth) { _lastStolenHealth = num; return; } int num2 = num - _lastStolenHealth; if (num2 > 0) { _lastStolenHealth = num; ShareHealth(num2); } } private int ReadStolenHealth() { try { return (int)(_stolenHealthField?.GetValue(_tick) ?? ((object)0)); } catch { return 0; } } private void ShareHealth(int stolen) { //IL_00bb: 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) int num = Mathf.Clamp(Mathf.CeilToInt((float)stolen * Mathf.Max(0f, Plugin.BloodBankHealMultiplier.Value)), 0, Mathf.Max(0, Plugin.BloodBankMaxHealPerPulse.Value)); float num2 = Mathf.Max(0.5f, Plugin.BloodBankHealRadius.Value); int num3 = 0; EnemyDirector instance = EnemyDirector.instance; if ((Object)(object)instance != (Object)null && instance.enemiesSpawned != null) { foreach (EnemyParent item in instance.enemiesSpawned) { if ((Object)(object)item == (Object)null) { continue; } EnemyHealth componentInChildren = ((Component)item).GetComponentInChildren(true); if ((Object)(object)componentInChildren == (Object)null || (Object)(object)componentInChildren == (Object)(object)_health || Vector3.Distance(((Component)this).transform.position, ((Component)componentInChildren).transform.position) > num2) { continue; } int healthCurrent = FusionShared.GetHealthCurrent(componentInChildren); if (healthCurrent > 0) { num3++; FusionShared.ApplyDamageResistanceAtLeast(componentInChildren, Plugin.BloodBankDamageResistance.Value, Plugin.BloodBankShieldSeconds.Value); int num4 = Mathf.Max(0, componentInChildren.health - healthCurrent); if (num > 0 && num4 > 0) { componentInChildren.Heal(Mathf.Min(num, num4)); } } } } if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("BloodBankPulseRPC", (RpcTarget)0, new object[2] { num2, num3 }); } else { BloodBankPulseRPC(num2, num3); } } [PunRPC] private void BloodBankPulseRPC(float radius, int supportedEnemies) { //IL_001a: 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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) Color color = (Color)((supportedEnemies > 0) ? AuraColor : new Color(0.3f, 0.55f, 0.35f)); FusionShared.SpawnWarningRing(FusionShared.ProjectToGround(((Component)this).transform.position), color, 0.15f, Mathf.Max(0.5f, radius), 0.55f); } private void EnsureHealth() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } } public class RailgunFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(0.05f, 0.75f, 1f); private static FieldInfo? _valuableTargetField; private EnemyValuableThrower _thrower; private EnemyHealth? _health; private PhotonView? _pv; private bool _hpDone; private float _glowTimer; private int _lastProjectileId; private float _lastProjectileTime = -10f; private void Awake() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) _thrower = ((Component)this).GetComponent(); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _pv = ((Component)this).GetComponent(); if ((object)_valuableTargetField == null) { _valuableTargetField = typeof(EnemyValuableThrower).GetField("valuableTarget", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if (SemiFunc.IsMasterClientOrSingleplayer()) { EnsureHealth(); } } internal static PhysGrabObject? CaptureProjectile(EnemyValuableThrower thrower) { try { if ((object)_valuableTargetField == null) { _valuableTargetField = typeof(EnemyValuableThrower).GetField("valuableTarget", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } object? obj = _valuableTargetField?.GetValue(thrower); return (PhysGrabObject?)((obj is PhysGrabObject) ? obj : null); } catch { return null; } } internal void ArmProjectile(PhysGrabObject? projectile) { //IL_0101: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer() || (Object)(object)projectile == (Object)null || (Object)(object)projectile.rb == (Object)null) { return; } PhotonView val = ((Component)projectile).GetComponent() ?? ((Component)projectile).GetComponentInParent(); int num = (((Object)(object)val != (Object)null) ? val.ViewID : 0); int num2 = ((num != 0) ? num : ((Object)projectile).GetInstanceID()); if (num2 != _lastProjectileId || !(Time.time - _lastProjectileTime < 0.25f)) { _lastProjectileId = num2; _lastProjectileTime = Time.time; float num3 = Mathf.Max(0.25f, Plugin.RailgunChargeSeconds.Value); FusionShared.BoostThrownImpact(projectile, Mathf.Max(1f, Plugin.RailgunImpactMultiplier.Value), num3); ((MonoBehaviour)this).StartCoroutine(BoostVelocity(projectile)); if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null && num != 0) { _pv.RPC("RailgunChargeRPC", (RpcTarget)0, new object[2] { num, num3 }); } else { RailgunProjectileVisual.Attach(projectile, num3, AuraColor); } } } private IEnumerator BoostVelocity(PhysGrabObject projectile) { for (int i = 0; i < 2; i++) { yield return (object)new WaitForFixedUpdate(); if ((Object)(object)projectile == (Object)null || (Object)(object)projectile.rb == (Object)null) { break; } Vector3 velocity = projectile.rb.velocity; if (!(((Vector3)(ref velocity)).sqrMagnitude < 0.25f)) { float num = Mathf.Clamp(Plugin.RailgunSpeedMultiplier.Value, 1f, 3f); float num2 = Mathf.Min(40f, ((Vector3)(ref velocity)).magnitude * num); projectile.rb.velocity = ((Vector3)(ref velocity)).normalized * num2; break; } } } [PunRPC] private void RailgunChargeRPC(int projectileViewId, float seconds) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) try { PhotonView val = PhotonView.Find(projectileViewId); if (!((Object)(object)val == (Object)null)) { PhysGrabObject val2 = ((Component)val).GetComponent() ?? ((Component)val).GetComponentInParent() ?? ((Component)val).GetComponentInChildren(); if ((Object)(object)val2 != (Object)null) { RailgunProjectileVisual.Attach(val2, seconds, AuraColor); } } } catch { } } private void EnsureHealth() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } } [HarmonyPatch(typeof(EnemyValuableThrower), "Throw")] internal static class EnemyValuableThrower_Throw_RailgunPatch { private static void Prefix(EnemyValuableThrower __instance, ref PhysGrabObject? __state) { __state = RailgunFusion.CaptureProjectile(__instance); } private static void Postfix(EnemyValuableThrower __instance, PhysGrabObject? __state) { ((Component)__instance).GetComponent()?.ArmProjectile(__state); } } public class RailgunProjectileVisual : MonoBehaviour { private GameObject? _effect; private Material? _material; private float _remaining; public static void Attach(PhysGrabObject projectile, float seconds, Color color) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)projectile == (Object)null)) { (((Component)projectile).GetComponent() ?? ((Component)projectile).gameObject.AddComponent()).Initialize(seconds, color); } } private void Initialize(float seconds, Color color) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0053: 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_00c0: 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_00cc: 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_00e2: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown _remaining = Mathf.Max(_remaining, seconds); if (!((Object)(object)_effect != (Object)null)) { _effect = new GameObject("MatsuRailgunCharge"); _effect.transform.SetParent(((Component)this).transform, false); _effect.transform.localPosition = Vector3.zero; Light obj = _effect.AddComponent(); obj.type = (LightType)2; obj.color = color; obj.range = 3.5f; obj.intensity = 7f; obj.shadows = (LightShadows)0; TrailRenderer val = _effect.AddComponent(); val.time = 0.45f; val.startWidth = 0.14f; val.endWidth = 0.015f; val.startColor = new Color(color.r, color.g, color.b, 0.95f); val.endColor = new Color(color.r, color.g, color.b, 0f); ((Renderer)val).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val).receiveShadows = false; Shader val2 = Shader.Find("Sprites/Default") ?? Shader.Find("Legacy Shaders/Particles/Alpha Blended") ?? Shader.Find("Unlit/Color"); if ((Object)(object)val2 != (Object)null) { _material = new Material(val2); ((Renderer)val).material = _material; } } } private void Update() { _remaining -= Time.deltaTime; if (_remaining <= 0f) { Object.Destroy((Object)(object)this); } } private void OnDestroy() { if ((Object)(object)_effect != (Object)null) { Object.Destroy((Object)(object)_effect); } if ((Object)(object)_material != (Object)null) { Object.Destroy((Object)(object)_material); } } } public class BlackoutFusion : MonoBehaviour { private sealed class DimmedLight { internal readonly float OriginalIntensity; internal readonly HashSet Owners = new HashSet(); internal DimmedLight(float originalIntensity) { OriginalIntensity = originalIntensity; } } internal static readonly Color AuraColor = new Color(0.22f, 0.02f, 0.4f); private static readonly Dictionary DimmedLights = new Dictionary(); private EnemyRobe _robe; private Enemy? _enemy; private EnemyHealth? _health; private NavMeshAgent? _agent; private readonly HashSet _ownedLights = new HashSet(); private int _ownerId; private bool _hpDone; private bool _agentValuesCaptured; private float _baseSpeed; private float _baseAcceleration; private float _glowTimer; private float _scanTimer; private void Awake() { //IL_008d: Unknown result type (might be due to invalid IL or missing references) _robe = ((Component)this).GetComponent(); _enemy = ((Component)this).GetComponent() ?? ((Component)this).GetComponentInParent(); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _ownerId = ((Object)this).GetInstanceID(); CaptureAgent(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: 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) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } bool flag = (Object)(object)_robe != (Object)null && IsDarkState(_robe.currentState); if (SemiFunc.IsMasterClientOrSingleplayer()) { EnsureHealth(); ApplyPursuitSpeed(flag); } if (!flag) { ReleaseAllLights(); return; } _scanTimer -= Time.deltaTime; if (!(_scanTimer > 0f)) { _scanTimer = Mathf.Max(0.1f, Plugin.BlackoutRefreshInterval.Value); RefreshLights(); } } private void RefreshLights() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Invalid comparison between Unknown and I4 //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Max(1f, Plugin.BlackoutRadius.Value); HashSet hashSet = new HashSet(); Light[] array = Object.FindObjectsOfType(); foreach (Light val in array) { if (!((Object)(object)val == (Object)null) && ((Behaviour)val).enabled && (int)val.type != 1 && !(((Object)((Component)val).gameObject).name == "MatsuMutationAura") && !((Component)val).transform.IsChildOf(((Component)this).transform) && !(Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position) > num)) { hashSet.Add(val); AcquireLight(val); } } List list = new List(); foreach (Light ownedLight in _ownedLights) { if ((Object)(object)ownedLight == (Object)null) { ReleaseLight(ownedLight); } else if (!hashSet.Contains(ownedLight)) { list.Add(ownedLight); } } foreach (Light item in list) { ReleaseLight(item); } _ownedLights.Clear(); foreach (Light item2 in hashSet) { _ownedLights.Add(item2); } } private void CaptureAgent() { if (!_agentValuesCaptured) { if (_agent == null) { _agent = FusionShared.GetUnityAgent(_enemy); } if (!((Object)(object)_agent == (Object)null)) { _baseSpeed = _agent.speed; _baseAcceleration = _agent.acceleration; _agentValuesCaptured = true; } } } private void ApplyPursuitSpeed(bool active) { CaptureAgent(); if (!((Object)(object)_agent == (Object)null) && _agentValuesCaptured) { if (active) { float num = Mathf.Max(1f, Plugin.BlackoutSpeedMultiplier.Value); _agent.speed = Mathf.Max(0.1f, _baseSpeed * num); _agent.acceleration = Mathf.Max(_baseAcceleration, _baseAcceleration * num); } else { _agent.speed = _baseSpeed; _agent.acceleration = _baseAcceleration; } } } private void AcquireLight(Light light) { if (!DimmedLights.TryGetValue(light, out DimmedLight value)) { value = new DimmedLight(light.intensity); DimmedLights[light] = value; } value.Owners.Add(_ownerId); float num = Mathf.Clamp01(Plugin.BlackoutLightMultiplier.Value); light.intensity = Mathf.Min(light.intensity, value.OriginalIntensity * num); } private void ReleaseLight(Light light) { if (light == null || !DimmedLights.TryGetValue(light, out DimmedLight value)) { return; } value.Owners.Remove(_ownerId); if (value.Owners.Count <= 0) { if ((Object)(object)light != (Object)null) { light.intensity = value.OriginalIntensity; } DimmedLights.Remove(light); } } private void ReleaseAllLights() { if (_ownedLights.Count == 0) { return; } List list = new List(_ownedLights); _ownedLights.Clear(); foreach (Light item in list) { ReleaseLight(item); } } private static bool IsDarkState(State state) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Invalid comparison between Unknown and I4 //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Invalid comparison between Unknown and I4 if ((int)state != 4 && (int)state != 5 && (int)state != 6 && (int)state != 7 && (int)state != 9 && (int)state != 10) { return (int)state == 11; } return true; } private void EnsureHealth() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } private void OnDisable() { ReleaseAllLights(); ApplyPursuitSpeed(active: false); } private void OnDestroy() { ReleaseAllLights(); ApplyPursuitSpeed(active: false); } } public class ContagionFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(0.2f, 1f, 0.12f); private EnemySlowMouth _mouth; private Enemy? _enemy; private EnemyHealth? _health; private PhotonView? _pv; private State _previousState; private bool _stateReady; private bool _hpDone; private float _glowTimer; private void Awake() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) _mouth = ((Component)this).GetComponent(); _enemy = ((Component)this).GetComponent() ?? ((Component)this).GetComponentInParent(); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _pv = ((Component)this).GetComponent(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: 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_0079: 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_006b: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Invalid comparison between Unknown and I4 //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Invalid comparison between Unknown and I4 //IL_0093: 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) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if (!SemiFunc.IsMasterClientOrSingleplayer() || (Object)(object)_mouth == (Object)null) { return; } EnsureHealth(); State currentState = _mouth.currentState; if (!_stateReady) { _previousState = currentState; _stateReady = true; } else if (currentState != _previousState) { if ((int)currentState == 10 || (int)currentState == 12) { InfectNearbyLoot(); } _previousState = currentState; } } private void InfectNearbyLoot() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Clamp(Plugin.ContagionInfectCount.Value, 1, 12); foreach (PhysGrabObject item in FusionShared.PhysObjectsInRadius(((Component)this).transform.position, Mathf.Max(1f, Plugin.ContagionInfectRadius.Value))) { if (num <= 0) { break; } if ((Object)(object)item == (Object)null || (Object)(object)((Component)item).GetComponentInParent() == (Object)null || (Object)(object)((Component)item).GetComponent() != (Object)null) { continue; } PhotonView val = ((Component)item).GetComponent() ?? ((Component)item).GetComponentInParent(); if (SemiFunc.IsMultiplayer()) { if ((Object)(object)_pv == (Object)null || (Object)(object)val == (Object)null || val.ViewID == 0) { continue; } _pv.RPC("InfectValuableRPC", (RpcTarget)0, new object[1] { val.ViewID }); } else { AddInfection(item); } num--; } } [PunRPC] private void InfectValuableRPC(int viewId) { try { PhotonView val = PhotonView.Find(viewId); PhysGrabObject val2 = (((Object)(object)val != (Object)null) ? (((Component)val).GetComponent() ?? ((Component)val).GetComponentInChildren()) : null); if ((Object)(object)val2 != (Object)null) { AddInfection(val2); } } catch { } } private void AddInfection(PhysGrabObject obj) { if (!((Object)(object)((Component)obj).GetComponent() != (Object)null)) { ((Component)obj).gameObject.AddComponent().Initialize(obj, _enemy); } } private void EnsureHealth() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } } public class ContagionValuable : MonoBehaviour { private PhysGrabObject _object; private Enemy? _source; private Light? _light; private bool _wasGrabbed; private bool _spent; public void Initialize(PhysGrabObject obj, Enemy? source) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) _object = obj; _source = source; _wasGrabbed = obj.grabbed; GameObject val = new GameObject("MatsuContagionInfection"); val.transform.SetParent(((Component)this).transform, false); _light = val.AddComponent(); _light.type = (LightType)2; _light.color = ContagionFusion.AuraColor; _light.range = 2.3f; _light.intensity = 5f; _light.shadows = (LightShadows)0; } private void Update() { if ((Object)(object)_object == (Object)null) { Object.Destroy((Object)(object)this); return; } if ((Object)(object)_light != (Object)null) { _light.intensity = 4f + Mathf.Sin(Time.time * 8f) * 1.5f; } bool grabbed = _object.grabbed; if (!_spent && grabbed && !_wasGrabbed) { TriggerTrap(); } _wasGrabbed = grabbed; } private void TriggerTrap() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_0070: 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_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_00be: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_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) _spent = true; Vector3 position = ((Component)this).transform.position; float num = Mathf.Max(0.2f, Plugin.ContagionTrapSize.Value); FusionShared.ExplodePlayerOnly(position, num, 0, 1.4f, _source); float radius = num * 2.7f; foreach (PlayerAvatar item in FusionShared.PlayersInRadius(position, radius)) { FusionShared.HurtOwnedPlayer(item, Mathf.Max(0, Plugin.ContagionTrapDamage.Value), position, _source); if (FusionShared.IsLocalPlayer(item)) { Vector3 val = ((Component)item).transform.position - position; val.y = 0f; try { item.ForceImpulse(((((Vector3)(ref val)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val)).normalized : Vector3.up) * 5f + Vector3.up * 3f); } catch { } } } Object.Destroy((Object)(object)this); } private void OnDestroy() { if ((Object)(object)_light != (Object)null) { Object.Destroy((Object)(object)((Component)_light).gameObject); } } } public class ElsaFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(0.6f, 0.9f, 1f); private static MethodInfo? _updateStateMethod; private static MethodInfo? _isBigMethod; private EnemyElsa _elsa; private Enemy? _enemy; private EnemyHealth? _health; private PhotonView? _pv; private bool _hpDone; private float _glowTimer; private bool _counting; private float _countdown; private bool _done; private bool _finalRingShown; private static PropertyInfo? _navAgentProp; private static FieldInfo? _navAgentField; private static MethodInfo? _navDisableMethod; private void Awake() { //IL_0098: Unknown result type (might be due to invalid IL or missing references) _elsa = ((Component)this).GetComponent(); _enemy = (((Object)(object)_elsa != (Object)null) ? _elsa.enemy : ((Component)this).GetComponent()); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _pv = ((Component)this).GetComponent(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Invalid comparison between Unknown and I4 //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if ((Object)(object)_elsa == (Object)null) { return; } if (IsBig(_elsa)) { _counting = false; _done = false; _finalRingShown = false; return; } if (!_counting && !IsEngagedSmall(_elsa.currentState)) { _done = false; } if (_done) { return; } bool flag = IsEngagedSmall(_elsa.currentState); if (!_counting && flag) { _counting = true; _countdown = Plugin.ElsaCountdownSeconds.Value; _finalRingShown = false; } if (!_counting) { return; } _countdown -= Time.deltaTime; if (!_finalRingShown && _countdown > 0f && _countdown <= 1f) { _finalRingShown = true; FusionShared.SpawnWarningRing(FusionShared.ProjectToGround(((Component)this).transform.position), AuraColor, 0.15f, Mathf.Max(0.25f, Plugin.ElsaTransformBlastSize.Value * 1.35f), Mathf.Max(0.1f, _countdown)); } if (SemiFunc.IsMasterClientOrSingleplayer()) { EnsureHpDoubled(); FreezeAgent(_elsa.enemy); if ((int)_elsa.currentState != 5) { InvokeUpdateState(_elsa, (State)5); } if (_countdown <= 0f) { _done = true; _counting = false; SendTransformBlast(); InvokeUpdateState(_elsa, (State)14); } } else if (_countdown <= 0f) { _counting = false; } } private void SendTransformBlast() { //IL_0027: 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_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_0045: 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_007d: 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) Vector3 position = (((Object)(object)_enemy != (Object)null && (Object)(object)_enemy.CenterTransform != (Object)null) ? _enemy.CenterTransform.position : ((Component)this).transform.position); position = FusionShared.ProjectToGround(position); if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("FenrirTransformBlastRPC", (RpcTarget)0, new object[1] { position }); } else { FenrirTransformBlastRPC(position); } } [PunRPC] private void FenrirTransformBlastRPC(Vector3 position) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) FusionShared.ExplodePlayerOnly(position, Mathf.Max(0.1f, Plugin.ElsaTransformBlastSize.Value), Mathf.Max(0, Plugin.ElsaTransformBlastDamage.Value), 2.3f, _enemy); } private void OnGUI() { //IL_0057: 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_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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_00a8: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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) if (!_counting || (Object)(object)_elsa == (Object)null) { return; } Camera main = Camera.main; if (!((Object)(object)main == (Object)null)) { Vector3 val = (((Object)(object)_elsa.headTransform != (Object)null) ? _elsa.headTransform.position : ((Component)_elsa).transform.position) + Vector3.up * 0.5f; Vector3 val2 = main.WorldToScreenPoint(val); if (!(val2.z <= 0f)) { int num = Mathf.Max(0, Mathf.CeilToInt(_countdown)); GUIStyle val3 = new GUIStyle(GUI.skin.label) { fontSize = 40, fontStyle = (FontStyle)1, alignment = (TextAnchor)4 }; val3.normal.textColor = ((_countdown <= 2f) ? Color.red : Color.white); GUI.Label(new Rect(val2.x - 40f, (float)Screen.height - val2.y - 40f, 80f, 80f), num.ToString(), val3); } } } private void EnsureHpDoubled() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } private static bool IsEngagedSmall(State s) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Invalid comparison between Unknown and I4 //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 if ((int)s != 5 && (int)s != 6 && (int)s != 7 && (int)s != 8) { return (int)s == 14; } return true; } private static bool IsBig(EnemyElsa elsa) { try { if ((object)_isBigMethod == null) { _isBigMethod = typeof(EnemyElsa).GetMethod("IsBig", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } return _isBigMethod != null && (bool)(_isBigMethod.Invoke(elsa, null) ?? ((object)false)); } catch { return false; } } private static void FreezeAgent(Enemy enemy) { try { if ((Object)(object)enemy == (Object)null) { return; } object obj = null; if ((object)_navAgentProp == null) { _navAgentProp = typeof(Enemy).GetProperty("NavMeshAgent", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (_navAgentProp != null) { obj = _navAgentProp.GetValue(enemy); } if (obj == null) { if ((object)_navAgentField == null) { _navAgentField = typeof(Enemy).GetField("NavMeshAgent", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } obj = _navAgentField?.GetValue(enemy); } if (obj != null) { if ((object)_navDisableMethod == null) { _navDisableMethod = obj.GetType().GetMethod("Disable", new Type[1] { typeof(float) }); } _navDisableMethod?.Invoke(obj, new object[1] { 0.3f }); } } catch { } } private static void InvokeUpdateState(EnemyElsa elsa, State state) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) try { if ((object)_updateStateMethod == null) { _updateStateMethod = typeof(EnemyElsa).GetMethod("UpdateState", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } _updateStateMethod?.Invoke(elsa, new object[1] { state }); } catch (Exception arg) { Plugin.Log.LogError((object)$"[Elsa] UpdateState error: {arg}"); } } } public class NecromancerFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(0.5f, 0.08f, 0.85f); private EnemyHeadGrabber _grabber; private Enemy? _enemy; private EnemyHealth? _health; private State _previousState; private bool _hpDone; private float _glowTimer; private void Awake() { //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_009d: Unknown result type (might be due to invalid IL or missing references) _grabber = ((Component)this).GetComponent(); _enemy = ((Component)this).GetComponent() ?? ((Component)this).GetComponentInParent(); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _previousState = (State)(((Object)(object)_grabber != (Object)null) ? ((int)_grabber.currentState) : 0); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Invalid comparison between Unknown and I4 //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Invalid comparison between Unknown and I4 _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if (SemiFunc.IsMasterClientOrSingleplayer()) { EnsureHealth(); } if (!((Object)(object)_grabber == (Object)null)) { State currentState = _grabber.currentState; if ((int)currentState == 15 && (int)_previousState != 15) { BeginSoulRecall(); } _previousState = currentState; } } private void BeginSoulRecall() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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) Transform val = (((Object)(object)_grabber.headTargetPositionFollowTransform != (Object)null) ? _grabber.headTargetPositionFollowTransform : ((Component)this).transform); float num = Mathf.Max(2f, Plugin.NecromancerRecallRadius.Value); FusionShared.SpawnWarningRing(FusionShared.ProjectToGround(val.position), AuraColor, 0.25f, num, 0.8f); EnemyParent componentInParent = ((Component)this).GetComponentInParent(); Transform ignoreRoot = ((componentInParent != null) ? ((Component)componentInParent).transform : null) ?? ((Component)this).transform; foreach (PlayerAvatar item in FusionShared.PlayersInRadius(val.position, num)) { if (!((Object)(object)item == (Object)null) && !FusionShared.IsPlayerDisabled(item)) { new GameObject("MatsuSoulRecallTether").AddComponent().Initialize(val, item, ignoreRoot, num, Mathf.Max(0.5f, Plugin.NecromancerRecallCountdown.Value), Mathf.Max(0.1f, Plugin.NecromancerLineBreakSeconds.Value), Mathf.Max(0, Plugin.NecromancerRecallDamage.Value), Mathf.Max(0f, Plugin.NecromancerPullForce.Value), _enemy); } } } private void EnsureHealth() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } } public class SoulRecallTether : MonoBehaviour { private static readonly int DefaultMask = LayerMask.GetMask(new string[1] { "Default" }); private Transform _anchor; private PlayerAvatar _player; private Transform? _ignoreRoot; private Enemy? _source; private float _maxRange; private float _countdown; private float _breakSeconds; private int _damage; private float _pullForce; private float _age; private float _hiddenTime; private LineRenderer? _line; private Material? _material; public void Initialize(Transform anchor, PlayerAvatar player, Transform? ignoreRoot, float maxRange, float countdown, float breakSeconds, int damage, float pullForce, Enemy? source) { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown _anchor = anchor; _player = player; _ignoreRoot = ignoreRoot; _maxRange = maxRange; _countdown = countdown; _breakSeconds = breakSeconds; _damage = damage; _pullForce = pullForce; _source = source; _line = ((Component)this).gameObject.AddComponent(); _line.useWorldSpace = true; _line.positionCount = 2; _line.widthMultiplier = 0.09f; ((Renderer)_line).shadowCastingMode = (ShadowCastingMode)0; Shader val = Shader.Find("Sprites/Default") ?? Shader.Find("Unlit/Color"); if ((Object)(object)val != (Object)null) { _material = new Material(val); ((Renderer)_line).material = _material; } } private void Update() { //IL_0279: 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_027f: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_007a: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_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_00fe: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0137: 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_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0242: 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_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_anchor == (Object)null || (Object)(object)_player == (Object)null || FusionShared.IsPlayerDisabled(_player)) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } _age += Time.deltaTime; Vector3 position = _anchor.position; Vector3 val = ((Component)_player).transform.position + Vector3.up * 0.8f; bool flag = IsExposed(position, val); _hiddenTime = (flag ? 0f : (_hiddenTime + Time.deltaTime)); if ((Object)(object)_line != (Object)null) { _line.SetPosition(0, position); _line.SetPosition(1, val); float num = Mathf.Clamp01(_age / _countdown); float num2 = Mathf.Clamp01(_hiddenTime / _breakSeconds); Color val2 = (Color)(flag ? new Color(0.7f + num * 0.3f, 0.05f, 1f, 0.95f) : Color.Lerp(NecromancerFusion.AuraColor, Color.white, num2)); LineRenderer? line = _line; Color startColor = (_line.endColor = val2); line.startColor = startColor; _line.widthMultiplier = Mathf.Lerp(0.07f, 0.16f, num) * (1f - num2 * 0.65f); } if (_hiddenTime >= _breakSeconds) { FusionShared.SpawnWarningRing(FusionShared.ProjectToGround(((Component)_player).transform.position), Color.white, 1.1f, 0.1f, 0.25f); Object.Destroy((Object)(object)((Component)this).gameObject); } else { if (_age < _countdown) { return; } if (FusionShared.IsLocalPlayer(_player)) { Vector3 val4 = position - ((Component)_player).transform.position; val4.y = 0f; FusionShared.HurtOwnedPlayer(_player, _damage, position, _source); try { PhysGrabber physGrabber = _player.physGrabber; if (physGrabber != null) { physGrabber.ReleaseObject(-1, 2.5f); } _player.ForceImpulse(((((Vector3)(ref val4)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val4)).normalized : Vector3.up) * _pullForce + Vector3.up * 4f); } catch { } } FusionShared.SpawnWarningRing(FusionShared.ProjectToGround(position), NecromancerFusion.AuraColor, _maxRange, 0.2f, 0.35f); Object.Destroy((Object)(object)((Component)this).gameObject); } } private bool IsExposed(Vector3 start, Vector3 end) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) Vector3 val = end - start; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude > _maxRange || magnitude < 0.05f) { return false; } Vector3 val2 = val / magnitude; RaycastHit[] array = Physics.RaycastAll(start, val2, magnitude, DefaultMask, (QueryTriggerInteraction)1); for (int i = 0; i < array.Length; i++) { RaycastHit val3 = array[i]; if (!((Object)(object)((RaycastHit)(ref val3)).collider == (Object)null) && !(((RaycastHit)(ref val3)).distance < 0.45f) && (!((Object)(object)_ignoreRoot != (Object)null) || !((Component)((RaycastHit)(ref val3)).collider).transform.IsChildOf(_ignoreRoot)) && ((RaycastHit)(ref val3)).distance < magnitude - 0.2f) { return false; } } return true; } private void OnDestroy() { if ((Object)(object)_material != (Object)null) { Object.Destroy((Object)(object)_material); } } } public class HeartbreakFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(1f, 0.08f, 0.45f); private EnemyHeartHugger _hugger; private Enemy? _enemy; private EnemyHealth? _health; private State _previousState; private bool _hpDone; private float _glowTimer; private void Awake() { //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_009d: Unknown result type (might be due to invalid IL or missing references) _hugger = ((Component)this).GetComponent(); _enemy = ((Component)this).GetComponent() ?? ((Component)this).GetComponentInParent(); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _previousState = (State)(((Object)(object)_hugger != (Object)null) ? ((int)_hugger.currentState) : 0); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Invalid comparison between Unknown and I4 //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Invalid comparison between Unknown and I4 _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if (SemiFunc.IsMasterClientOrSingleplayer()) { EnsureHealth(); } if (!((Object)(object)_hugger == (Object)null)) { State currentState = _hugger.currentState; if ((int)currentState == 9 && (int)_previousState != 9) { ForgeHeartChains(); } _previousState = currentState; } } private void ForgeHeartChains() { //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_0021: 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_0027: 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_0139: 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_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) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Max(1f, Plugin.HeartbreakMarkRadius.Value); Vector3 position = ((Component)this).transform.position; FusionShared.SpawnWarningRing(FusionShared.ProjectToGround(position), AuraColor, 0.2f, num, 0.55f); List list = FusionShared.PlayersInRadius(position, num); list.RemoveAll((PlayerAvatar player) => (Object)(object)player == (Object)null || FusionShared.IsPlayerDisabled(player)); list.Sort((PlayerAvatar a, PlayerAvatar b) => StablePlayerId(a).CompareTo(StablePlayerId(b))); for (int num2 = 0; num2 < list.Count; num2 += 2) { PlayerAvatar val = list[num2]; PlayerAvatar val2 = ((num2 + 1 < list.Count) ? list[num2 + 1] : null); Vector3? anchor = null; if ((Object)(object)val2 == (Object)null) { Vector3 val3 = ((Component)val).transform.position - position; val3.y = 0f; if (((Vector3)(ref val3)).sqrMagnitude < 0.01f) { val3 = ((Component)this).transform.forward; } anchor = FusionShared.ProjectToGround(position - ((Vector3)(ref val3)).normalized * Mathf.Max(4f, num * 0.45f)); } new GameObject("MatsuHeartChain").AddComponent().Initialize(val, val2, anchor, Mathf.Max(1f, Plugin.HeartbreakLinkSeconds.Value), Mathf.Max(0.4f, Plugin.HeartbreakBreakDistance.Value), Mathf.Max(0.1f, Plugin.HeartbreakContactSeconds.Value), Mathf.Max(0.2f, Plugin.HeartbreakPulseSeconds.Value), Mathf.Max(0, Plugin.HeartbreakPulseDamage.Value), Mathf.Max(0, Plugin.HeartbreakSnapDamage.Value), Mathf.Max(0f, Plugin.HeartbreakPullForce.Value), _enemy); } } private static int StablePlayerId(PlayerAvatar player) { if (!((Object)(object)player.photonView != (Object)null) || player.photonView.ViewID == 0) { return ((Object)player).GetInstanceID(); } return player.photonView.ViewID; } private void EnsureHealth() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } } public class HeartChain : MonoBehaviour { private PlayerAvatar _first; private PlayerAvatar? _second; private Vector3? _anchor; private Enemy? _source; private float _duration; private float _breakDistance; private float _contactSeconds; private float _pulseSeconds; private int _pulseDamage; private int _snapDamage; private float _pullForce; private float _age; private float _contact; private float _pulseTimer; private LineRenderer? _line; private Material? _material; private Light? _anchorLight; public void Initialize(PlayerAvatar first, PlayerAvatar? second, Vector3? anchor, float duration, float breakDistance, float contactSeconds, float pulseSeconds, int pulseDamage, int snapDamage, float pullForce, Enemy? source) { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) _first = first; _second = second; _anchor = anchor; _duration = duration; _breakDistance = breakDistance; _contactSeconds = contactSeconds; _pulseSeconds = pulseSeconds; _pulseDamage = pulseDamage; _snapDamage = snapDamage; _pullForce = pullForce; _source = source; _pulseTimer = pulseSeconds; _line = ((Component)this).gameObject.AddComponent(); _line.useWorldSpace = true; _line.positionCount = 2; _line.widthMultiplier = 0.11f; ((Renderer)_line).shadowCastingMode = (ShadowCastingMode)0; Shader val = Shader.Find("Sprites/Default") ?? Shader.Find("Unlit/Color"); if ((Object)(object)val != (Object)null) { _material = new Material(val); ((Renderer)_line).material = _material; } if (_anchor.HasValue) { GameObject val2 = new GameObject("MatsuPhantomHeart"); val2.transform.SetParent(((Component)this).transform, false); val2.transform.position = _anchor.Value + Vector3.up * 0.4f; _anchorLight = val2.AddComponent(); _anchorLight.type = (LightType)2; _anchorLight.color = HeartbreakFusion.AuraColor; _anchorLight.range = 4f; _anchorLight.intensity = 9f; _anchorLight.shadows = (LightShadows)0; FusionShared.SpawnWarningRing(_anchor.Value, HeartbreakFusion.AuraColor, _breakDistance * 1.8f, _breakDistance, _duration); } } private void Update() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_011c: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_017b: 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_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_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_0201: 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) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0293: 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_030d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_first == (Object)null || FusionShared.IsPlayerDisabled(_first) || ((Object)(object)_second != (Object)null && FusionShared.IsPlayerDisabled(_second))) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } _age += Time.deltaTime; Vector3 val = ((Component)_first).transform.position + Vector3.up * 0.8f; Vector3 val2 = (((Object)(object)_second != (Object)null) ? (((Component)_second).transform.position + Vector3.up * 0.8f) : (_anchor.Value + Vector3.up * 0.4f)); float num = Vector3.Distance(val, val2); _contact = ((num <= _breakDistance) ? (_contact + Time.deltaTime) : 0f); if ((Object)(object)_line != (Object)null) { _line.SetPosition(0, val); _line.SetPosition(1, val2); float num2 = Mathf.Clamp01(_contact / _contactSeconds); float num3 = Mathf.Clamp01(_age / _duration); Color val3 = Color.Lerp(new Color(1f, 0.02f, 0.32f, 0.95f), Color.white, num2); LineRenderer? line = _line; Color startColor = (_line.endColor = val3); line.startColor = startColor; _line.widthMultiplier = Mathf.Lerp(0.09f, 0.2f, num3) * (1f + num2 * 0.5f); } if ((Object)(object)_anchorLight != (Object)null) { _anchorLight.intensity = 7f + Mathf.Abs(Mathf.Sin(_age * 9f)) * 5f; } if (_contact >= _contactSeconds) { FusionShared.SpawnWarningRing(FusionShared.ProjectToGround((val + val2) * 0.5f), Color.white, _breakDistance, 0.1f, 0.3f); Object.Destroy((Object)(object)((Component)this).gameObject); return; } if (_age >= _duration) { ApplyPulse(_first, val2, _snapDamage); if ((Object)(object)_second != (Object)null) { ApplyPulse(_second, val, _snapDamage); } FusionShared.SpawnWarningRing(FusionShared.ProjectToGround((val + val2) * 0.5f), HeartbreakFusion.AuraColor, num * 0.5f, 0.1f, 0.35f); Object.Destroy((Object)(object)((Component)this).gameObject); return; } _pulseTimer -= Time.deltaTime; if (_pulseTimer <= 0f) { _pulseTimer = _pulseSeconds; ApplyPulse(_first, val2, _pulseDamage); if ((Object)(object)_second != (Object)null) { ApplyPulse(_second, val, _pulseDamage); } } } private void ApplyPulse(PlayerAvatar player, Vector3 toward, int damage) { //IL_0013: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (!FusionShared.IsLocalPlayer(player) || FusionShared.IsPlayerDisabled(player)) { return; } FusionShared.HurtOwnedPlayer(player, damage, toward, _source); Vector3 val = toward - ((Component)player).transform.position; val.y = 0f; try { player.ForceImpulse(((((Vector3)(ref val)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val)).normalized : Vector3.up) * _pullForce + Vector3.up * 1.5f); } catch { } } private void OnDestroy() { if ((Object)(object)_material != (Object)null) { Object.Destroy((Object)(object)_material); } } } public class DeathlightFusion : MonoBehaviour { private sealed class HostCapture { internal PlayerAvatar Player; internal Vector3 Position; internal int Serial; internal int PlayerViewId; internal float Age; internal float HiddenTime; } internal static readonly Color AuraColor = new Color(1f, 0.18f, 0.02f); private static readonly int DefaultMask = LayerMask.GetMask(new string[1] { "Default" }); private EnemyOogly _oogly; private Enemy? _enemy; private EnemyHealth? _health; private PhotonView? _pv; private Color _originalColor; private float _originalIntensity; private bool _lightCaptured; private bool _hpDone; private float _glowTimer; private float _scanTimer; private int _nextSerial; private readonly Dictionary _captures = new Dictionary(); private readonly Dictionary _recaptureUntil = new Dictionary(); private readonly Dictionary _visuals = new Dictionary(); private void Awake() { //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) _oogly = ((Component)this).GetComponent(); _enemy = ((Component)this).GetComponent() ?? ((Component)this).GetComponentInParent(); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _pv = ((Component)this).GetComponent(); if ((Object)(object)_oogly != (Object)null && (Object)(object)_oogly.visionSpotlight != (Object)null) { _originalColor = _oogly.visionSpotlight.color; _originalIntensity = _oogly.visionSpotlight.intensity; _lightCaptured = true; } if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Invalid comparison between Unknown and I4 //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Invalid comparison between Unknown and I4 //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Invalid comparison between Unknown and I4 _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } bool flag = SemiFunc.IsMasterClientOrSingleplayer(); if (flag) { EnsureHealth(); } if ((Object)(object)_oogly == (Object)null) { return; } bool flag2 = (int)_oogly.currentState == 5 || (int)_oogly.currentState == 6 || (int)_oogly.currentState == 7; UpdateSpotlight(flag2); if (!flag) { return; } UpdateHostCaptures(flag2); if (!flag2) { return; } _scanTimer -= Time.deltaTime; if (_scanTimer > 0f) { return; } _scanTimer = 0.15f; foreach (PlayerAvatar item in FusionShared.AllPlayers()) { if (!((Object)(object)item == (Object)null) && !FusionShared.IsPlayerDisabled(item) && IsInSpotlight(item)) { int key = PlayerKey(item); if (!_captures.ContainsKey(key) && (!_recaptureUntil.TryGetValue(key, out var value) || !(Time.time < value))) { BeginCapture(key, item); } } } } private void BeginCapture(int key, PlayerAvatar player) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) int num = (((Object)(object)player.photonView != (Object)null) ? player.photonView.ViewID : 0); Vector3 val = FusionShared.ProjectToGround(((Component)player).transform.position); int num2 = ++_nextSerial; _captures[key] = new HostCapture { Player = player, Position = val, Serial = num2, PlayerViewId = num }; float num3 = Mathf.Max(0.5f, Plugin.DeathlightRewindSeconds.Value); if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("DeathlightCaptureRPC", (RpcTarget)0, new object[4] { num, val, num3, num2 }); } else { DeathlightCaptureRPC(num, val, num3, num2); } } private void UpdateHostCaptures(bool spotlightActive) { //IL_0149: Unknown result type (might be due to invalid IL or missing references) if (_captures.Count == 0) { return; } foreach (int item in new List(_captures.Keys)) { if (!_captures.TryGetValue(item, out HostCapture value)) { continue; } if ((Object)(object)value.Player == (Object)null || FusionShared.IsPlayerDisabled(value.Player)) { EndCapture(item, rewound: false); continue; } value.Age += Time.deltaTime; bool flag = spotlightActive && IsInSpotlight(value.Player); value.HiddenTime = (flag ? 0f : (value.HiddenTime + Time.deltaTime)); if (value.HiddenTime >= Mathf.Max(0.1f, Plugin.DeathlightBreakSightSeconds.Value)) { EndCapture(item, rewound: false); } else { if (value.Age < Mathf.Max(0.5f, Plugin.DeathlightRewindSeconds.Value)) { continue; } int enemyIndex = -1; try { EnemyParent val = (((Object)(object)_enemy != (Object)null) ? ((Component)_enemy).GetComponentInParent() : null); if ((Object)(object)val != (Object)null && (Object)(object)EnemyDirector.instance != (Object)null) { enemyIndex = EnemyDirector.instance.enemiesSpawned.IndexOf(val); } } catch { } PlayerTeleportHelper.Trigger(value.Player, value.Position, Mathf.Max(0, Plugin.DeathlightRewindDamage.Value), enemyIndex); EndCapture(item, rewound: true); } } } private void EndCapture(int key, bool rewound) { if (_captures.TryGetValue(key, out HostCapture value)) { _captures.Remove(key); _recaptureUntil[key] = Time.time + Mathf.Max(0.2f, Plugin.DeathlightRecaptureCooldown.Value); if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("DeathlightResolveRPC", (RpcTarget)0, new object[2] { value.Serial, rewound }); } else { DeathlightResolveRPC(value.Serial, rewound); } } } [PunRPC] private void DeathlightCaptureRPC(int playerViewId, Vector3 position, float duration, int serial) { //IL_0026: 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) PlayerAvatar val = FindPlayer(playerViewId); if (!((Object)(object)val == (Object)null) && !_visuals.ContainsKey(serial)) { DeathlightSnapshot deathlightSnapshot = new GameObject("MatsuDeathlightSnapshot").AddComponent(); deathlightSnapshot.Initialize(val, position, duration); _visuals[serial] = deathlightSnapshot; } } [PunRPC] private void DeathlightResolveRPC(int serial, bool rewound) { if (_visuals.TryGetValue(serial, out DeathlightSnapshot value)) { _visuals.Remove(serial); if ((Object)(object)value != (Object)null) { value.Resolve(rewound); } } } private PlayerAvatar? FindPlayer(int viewId) { if (viewId != 0) { PhotonView val = PhotonView.Find(viewId); if (!((Object)(object)val != (Object)null)) { return null; } return ((Component)val).GetComponent(); } foreach (PlayerAvatar item in FusionShared.AllPlayers()) { if ((Object)(object)item != (Object)null && FusionShared.IsLocalPlayer(item)) { return item; } } return null; } private static int PlayerKey(PlayerAvatar player) { if (!((Object)(object)player.photonView != (Object)null) || player.photonView.ViewID == 0) { return ((Object)player).GetInstanceID(); } return player.photonView.ViewID; } private bool IsInSpotlight(PlayerAvatar player) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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) Transform val = (((Object)(object)_oogly.visionSpotlight != (Object)null) ? ((Component)_oogly.visionSpotlight).transform : (((Object)(object)_oogly.visionTransform != (Object)null) ? _oogly.visionTransform : ((Component)this).transform)); Vector3 position = val.position; Vector3 val2 = ((Component)player).transform.position + Vector3.up * 0.8f - position; float magnitude = ((Vector3)(ref val2)).magnitude; float num = Mathf.Max(1f, Plugin.DeathlightCaptureRange.Value); float num2 = Mathf.Clamp(Plugin.DeathlightConeAngle.Value * 0.5f, 1f, 85f); if (magnitude < 0.1f || magnitude > num || Vector3.Angle(val.forward, val2) > num2) { return false; } EnemyParent componentInParent = ((Component)this).GetComponentInParent(); Transform val3 = ((componentInParent != null) ? ((Component)componentInParent).transform : null) ?? ((Component)this).transform; RaycastHit[] array = Physics.RaycastAll(position, val2 / magnitude, magnitude, DefaultMask, (QueryTriggerInteraction)1); for (int i = 0; i < array.Length; i++) { RaycastHit val4 = array[i]; if (!((Object)(object)((RaycastHit)(ref val4)).collider == (Object)null) && !(((RaycastHit)(ref val4)).distance < 0.45f) && !((Component)((RaycastHit)(ref val4)).collider).transform.IsChildOf(val3) && ((RaycastHit)(ref val4)).distance < magnitude - 0.2f) { return false; } } return true; } private void UpdateSpotlight(bool active) { //IL_0022: 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) if (!((Object)(object)_oogly.visionSpotlight == (Object)null)) { if (active) { _oogly.visionSpotlight.color = AuraColor; _oogly.visionSpotlight.intensity = Mathf.Max(_originalIntensity, 8f); } else if (_lightCaptured) { _oogly.visionSpotlight.color = _originalColor; _oogly.visionSpotlight.intensity = _originalIntensity; } } } private void EnsureHealth() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } private void OnDisable() { if ((Object)(object)_oogly != (Object)null) { UpdateSpotlight(active: false); } foreach (DeathlightSnapshot value in _visuals.Values) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)((Component)value).gameObject); } } _visuals.Clear(); _captures.Clear(); } } public class DeathlightSnapshot : MonoBehaviour { private PlayerAvatar _player; private Vector3 _position; private float _duration; private float _age; private LineRenderer? _ring; private LineRenderer? _tether; private Material? _ringMaterial; private Material? _tetherMaterial; private Light? _light; private bool _resolved; public void Initialize(PlayerAvatar player, Vector3 position, float duration) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Expected O, but got Unknown //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Expected O, but got Unknown //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Expected O, but got Unknown _player = player; _position = position; _duration = duration; ((Component)this).transform.position = position + Vector3.up * 0.08f; Shader val = Shader.Find("Sprites/Default") ?? Shader.Find("Unlit/Color"); _ring = ((Component)this).gameObject.AddComponent(); _ring.useWorldSpace = false; _ring.loop = true; _ring.positionCount = 49; _ring.widthMultiplier = 0.09f; ((Renderer)_ring).shadowCastingMode = (ShadowCastingMode)0; for (int i = 0; i < 49; i++) { float num = (float)i / 48f * (float)Math.PI * 2f; _ring.SetPosition(i, new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num))); } if ((Object)(object)val != (Object)null) { _ringMaterial = new Material(val); ((Renderer)_ring).material = _ringMaterial; } GameObject val2 = new GameObject("PhotoTether"); val2.transform.SetParent(((Component)this).transform, false); _tether = val2.AddComponent(); _tether.useWorldSpace = true; _tether.positionCount = 2; _tether.widthMultiplier = 0.055f; ((Renderer)_tether).shadowCastingMode = (ShadowCastingMode)0; if ((Object)(object)val != (Object)null) { _tetherMaterial = new Material(val); ((Renderer)_tether).material = _tetherMaterial; } _light = ((Component)this).gameObject.AddComponent(); _light.type = (LightType)2; _light.color = DeathlightFusion.AuraColor; _light.range = 4f; _light.intensity = 9f; _light.shadows = (LightShadows)0; } private void Update() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0116: 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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0141: 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_0149: Unknown result type (might be due to invalid IL or missing references) if (!_resolved && !((Object)(object)_player == (Object)null)) { _age += Time.deltaTime; float num = Mathf.Clamp01(_age / _duration); float num2 = Mathf.Lerp(2.4f, 0.15f, num); ((Component)this).transform.localScale = new Vector3(num2, 1f, num2); float num3 = 0.35f + Mathf.Abs(Mathf.Sin(_age * (7f + num * 11f))) * 0.65f; Color val = default(Color); ((Color)(ref val))..ctor(1f, 0.12f, 0.01f, num3); if ((Object)(object)_ring != (Object)null) { LineRenderer? ring = _ring; Color startColor = (_ring.endColor = val); ring.startColor = startColor; } if ((Object)(object)_tether != (Object)null) { _tether.SetPosition(0, _position + Vector3.up * 0.15f); _tether.SetPosition(1, ((Component)_player).transform.position + Vector3.up * 0.8f); LineRenderer? tether = _tether; Color startColor = (_tether.endColor = val); tether.startColor = startColor; } if ((Object)(object)_light != (Object)null) { _light.intensity = 6f + num3 * 6f; } } } public void Resolve(bool rewound) { //IL_0011: 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_0019: Unknown result type (might be due to invalid IL or missing references) if (!_resolved) { _resolved = true; FusionShared.SpawnWarningRing(_position, rewound ? DeathlightFusion.AuraColor : Color.white, rewound ? 2.5f : 0.2f, rewound ? 0.15f : 1.5f, 0.35f); Object.Destroy((Object)(object)((Component)this).gameObject); } } private void OnDestroy() { if ((Object)(object)_ringMaterial != (Object)null) { Object.Destroy((Object)(object)_ringMaterial); } if ((Object)(object)_tetherMaterial != (Object)null) { Object.Destroy((Object)(object)_tetherMaterial); } } } public class AftershockFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(0.55f, 0.2f, 1f); private EnemyShadow _shadow; private Enemy? _enemy; private EnemyHealth? _health; private PhotonView? _pv; private State _previousState; private bool _hpDone; private float _glowTimer; private void Awake() { //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_00a9: Unknown result type (might be due to invalid IL or missing references) _shadow = ((Component)this).GetComponent(); _enemy = ((Component)this).GetComponent() ?? ((Component)this).GetComponentInParent(); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); _pv = ((Component)this).GetComponent(); _previousState = (State)(((Object)(object)_shadow != (Object)null) ? ((int)_shadow.currentState) : 0); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Invalid comparison between Unknown and I4 //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Invalid comparison between Unknown and I4 //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } bool flag = SemiFunc.IsMasterClientOrSingleplayer(); if (flag) { EnsureHealth(); } if (!((Object)(object)_shadow == (Object)null)) { State currentState = _shadow.currentState; bool flag2 = ((int)currentState == 5 || (int)currentState == 7) && currentState != _previousState; if (flag && flag2) { SendShadowClap(); } _previousState = currentState; } } private void SendShadowClap() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_006b: 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_00d9: 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_00c2: 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) Vector3 position = (((Object)(object)_shadow.handArea != (Object)null) ? _shadow.handArea.position : ((Component)this).transform.position); position = FusionShared.ProjectToGround(position); PlayerAvatar val = FusionShared.NearestPlayer(position, 40f); Vector3 val2 = (((Object)(object)val != (Object)null) ? (((Component)val).transform.position - position) : ((Component)this).transform.forward); val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude < 0.01f) { val2 = ((Component)this).transform.forward; } ((Vector3)(ref val2)).Normalize(); if (SemiFunc.IsMultiplayer() && (Object)(object)_pv != (Object)null) { _pv.RPC("ShadowClapRPC", (RpcTarget)0, new object[2] { position, val2 }); } else { ShadowClapRPC(position, val2); } } [PunRPC] private void ShadowClapRPC(Vector3 center, Vector3 forward) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) new GameObject("MatsuShadowClap").AddComponent().Initialize(center, forward, Mathf.Max(2f, Plugin.AftershockCorridorLength.Value), Mathf.Max(2f, Plugin.AftershockStartWidth.Value), Mathf.Max(0.4f, Plugin.AftershockCloseSeconds.Value), Mathf.Max(0, Plugin.AftershockClapDamage.Value), Mathf.Max(0f, Plugin.AftershockGrabDisableSeconds.Value), _enemy); } private void EnsureHealth() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } } public class ShadowClapTrap : MonoBehaviour { private Vector3 _center; private Vector3 _forward; private Vector3 _right; private float _length; private float _startWidth; private float _duration; private int _damage; private float _grabDisable; private Enemy? _source; private float _age; private LineRenderer? _leftWall; private LineRenderer? _rightWall; private LineRenderer? _lane; private Material? _material; private bool _resolved; public void Initialize(Vector3 center, Vector3 forward, float length, float startWidth, float duration, int damage, float grabDisable, Enemy? source) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) _center = center; _forward = forward; _forward.y = 0f; if (((Vector3)(ref _forward)).sqrMagnitude < 0.01f) { _forward = Vector3.forward; } ((Vector3)(ref _forward)).Normalize(); Vector3 val = Vector3.Cross(Vector3.up, _forward); _right = ((Vector3)(ref val)).normalized; _length = length; _startWidth = startWidth; _duration = duration; _damage = damage; _grabDisable = grabDisable; _source = source; Shader val2 = Shader.Find("Sprites/Default") ?? Shader.Find("Unlit/Color"); if ((Object)(object)val2 != (Object)null) { _material = new Material(val2); } _leftWall = CreateWall("LeftShadowHand"); _rightWall = CreateWall("RightShadowHand"); _lane = CreateLine("ShadowClapLane", 2, 0.05f); if ((Object)(object)_lane != (Object)null) { _lane.SetPosition(0, _center - _forward * 1.5f + Vector3.up * 0.04f); _lane.SetPosition(1, _center + _forward * _length + Vector3.up * 0.04f); } FusionShared.SpawnWarningRing(_center, AftershockFusion.AuraColor, 0.2f, _startWidth * 0.5f, Mathf.Min(0.7f, _duration)); } private void Update() { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) _age += Time.deltaTime; float num = Mathf.Clamp01(_age / _duration); float num2 = num * num * (3f - 2f * num); float num3 = Mathf.Lerp(_startWidth * 0.5f, 0.08f, num2); UpdateWall(_leftWall, 0f - num3); UpdateWall(_rightWall, num3); float num4 = 0.45f + Mathf.Abs(Mathf.Sin(_age * (6f + num * 10f))) * 0.55f; Color val = default(Color); ((Color)(ref val))..ctor(0.55f, 0.08f, 1f, num4); if ((Object)(object)_leftWall != (Object)null) { LineRenderer? leftWall = _leftWall; Color startColor = (_leftWall.endColor = val); leftWall.startColor = startColor; } if ((Object)(object)_rightWall != (Object)null) { LineRenderer? rightWall = _rightWall; Color startColor = (_rightWall.endColor = val); rightWall.startColor = startColor; } if ((Object)(object)_lane != (Object)null) { Color val4 = default(Color); ((Color)(ref val4))..ctor(0.8f, 0.35f, 1f, 0.25f + num * 0.35f); LineRenderer? lane = _lane; Color startColor = (_lane.endColor = val4); lane.startColor = startColor; } if (!(num < 1f) && !_resolved) { _resolved = true; ResolveClap(); Object.Destroy((Object)(object)((Component)this).gameObject); } } private LineRenderer CreateWall(string name) { return CreateLine(name, 5, 0.12f); } private LineRenderer? CreateLine(string name, int points, float width) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(((Component)this).transform, false); LineRenderer val2 = val.AddComponent(); val2.useWorldSpace = true; val2.positionCount = points; val2.widthMultiplier = width; ((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val2).receiveShadows = false; if ((Object)(object)_material != (Object)null) { ((Renderer)val2).material = _material; } return val2; } private void UpdateWall(LineRenderer? wall, float lateral) { //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) //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_0026: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_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_0064: 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_006e: 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_0089: 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_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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_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_00bd: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)wall == (Object)null)) { Vector3 val = _center - _forward * 1.5f + _right * lateral; Vector3 val2 = _center + _forward * _length + _right * lateral; float num = 3.3f; wall.SetPosition(0, val + Vector3.up * 0.04f); wall.SetPosition(1, val2 + Vector3.up * 0.04f); wall.SetPosition(2, val2 + Vector3.up * num); wall.SetPosition(3, val + Vector3.up * num); wall.SetPosition(4, val + Vector3.up * 0.04f); } } private void ResolveClap() { //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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_0122: 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_0131: Unknown result type (might be due to invalid IL or missing references) foreach (PlayerAvatar item in FusionShared.AllPlayers()) { if (!FusionShared.IsLocalPlayer(item) || FusionShared.IsPlayerDisabled(item)) { continue; } Vector3 val = ((Component)item).transform.position - _center; float num = Vector3.Dot(val, _forward); float num2 = Vector3.Dot(val, _right); if (num < -1.5f || num > _length || Mathf.Abs(num2) > _startWidth * 0.5f || Mathf.Abs(val.y) > 3.3f) { continue; } FusionShared.HurtOwnedPlayer(item, _damage, _center, _source); try { PhysGrabber physGrabber = item.physGrabber; if (physGrabber != null) { physGrabber.ReleaseObject(-1, _grabDisable); } PhysGrabber physGrabber2 = item.physGrabber; if (physGrabber2 != null) { physGrabber2.OverrideGrabDisable(_grabDisable); } float num3 = (Mathf.Approximately(num2, 0f) ? 1f : (0f - Mathf.Sign(num2))); item.ForceImpulse(_right * num3 * 9f + Vector3.up * 5f); } catch { } } FusionShared.SpawnWarningRing(_center, Color.white, _startWidth * 0.5f, 0.1f, 0.25f); } private void OnDestroy() { if ((Object)(object)_material != (Object)null) { Object.Destroy((Object)(object)_material); } } } public class ParallaxFusion : MonoBehaviour { internal static readonly Color AuraColor = new Color(0.05f, 0.95f, 1f); private EnemyThinMan _thinMan; private Enemy? _enemy; private EnemyHealth? _health; private Vector3? _departure; private bool _hpDone; private float _glowTimer; private void Awake() { //IL_007b: Unknown result type (might be due to invalid IL or missing references) _thinMan = ((Component)this).GetComponent(); _enemy = ((Component)this).GetComponent() ?? ((Component)this).GetComponentInParent(); _health = ((Component)this).GetComponentInParent() ?? ((Component)this).GetComponentInChildren(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)_health != (Object)null) { _health.health = Mathf.Max(1, Mathf.RoundToInt((float)_health.health * Plugin.CurrentHealthMultiplier())); } FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } private void Update() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) _glowTimer -= Time.deltaTime; if (_glowTimer <= 0f) { _glowTimer = 2f; FusionShared.ApplyMutationGlow(((Component)this).transform, AuraColor); } if (SemiFunc.IsMasterClientOrSingleplayer()) { EnsureHealth(); } } internal void RecordTeleport(Vector3 position, bool intro) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //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_006b: 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) Vector3 val = FusionShared.ProjectToGround(position); if (intro) { _departure = val; } else if (_departure.HasValue) { Vector3 value = _departure.Value; _departure = null; if (!(Vector3.Distance(value, val) < Mathf.Max(0.5f, Plugin.ParallaxMinimumDistance.Value))) { new GameObject("MatsuParallaxGatePair").AddComponent().Initialize(value, val, Mathf.Max(0.1f, Plugin.ParallaxGateWarningSeconds.Value), Mathf.Max(0.2f, Plugin.ParallaxGateDuration.Value), Mathf.Max(0.5f, Plugin.ParallaxGateRadius.Value), Mathf.Max(0, Plugin.ParallaxGateDamage.Value), Mathf.Max(0f, Plugin.ParallaxExitImpulse.Value), _enemy); FusionShared.SpawnWarningRing(value, AuraColor, 0.15f, 1f, Plugin.ParallaxGateWarningSeconds.Value); FusionShared.SpawnWarningRing(val, new Color(1f, 0.1f, 0.8f), 0.15f, 1f, Plugin.ParallaxGateWarningSeconds.Value); } } } private void EnsureHealth() { if (!_hpDone && !((Object)(object)_health == (Object)null)) { _hpDone = true; FusionShared.SetHealthCurrent(_health, _health.health); } } } public class ParallaxGatePair : MonoBehaviour { private static readonly Color EntryColor = new Color(0.05f, 0.95f, 1f); private static readonly Color ExitColor = new Color(1f, 0.1f, 0.8f); private Vector3 _gateA; private Vector3 _gateB; private Vector3 _axis; private float _warning; private float _duration; private float _radius; private int _damage; private float _exitImpulse; private Enemy? _source; private float _age; private float _scanTimer; private LineRenderer? _ringA; private LineRenderer? _ringB; private LineRenderer? _connector; private Light? _lightA; private Light? _lightB; private Material? _material; private readonly Dictionary _playerCooldown = new Dictionary(); private readonly Dictionary _objectCooldown = new Dictionary(); public void Initialize(Vector3 start, Vector3 end, float warning, float duration, float radius, int damage, float exitImpulse, Enemy? source) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_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_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: 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_01de: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Expected O, but got Unknown _gateA = FusionShared.ProjectToGround(start); _gateB = FusionShared.ProjectToGround(end); _axis = _gateB - _gateA; _axis.y = 0f; if (((Vector3)(ref _axis)).sqrMagnitude < 0.01f) { _axis = Vector3.forward; } else { ((Vector3)(ref _axis)).Normalize(); } _warning = warning; _duration = duration; _radius = radius; _damage = damage; _exitImpulse = exitImpulse; _source = source; Shader val = Shader.Find("Sprites/Default") ?? Shader.Find("Unlit/Color"); if ((Object)(object)val != (Object)null) { _material = new Material(val); } _ringA = CreatePortalRing("DepartureGate", _gateA, _axis, EntryColor); _ringB = CreatePortalRing("ArrivalGate", _gateB, -_axis, ExitColor); _connector = CreateLine("PortalLink", 2, 0.035f, new Color(0.55f, 0.3f, 1f, 0.3f)); _connector.SetPosition(0, _gateA + Vector3.up * 0.08f); _connector.SetPosition(1, _gateB + Vector3.up * 0.08f); _lightA = CreateGateLight("DepartureLight", _gateA + Vector3.up * _radius, EntryColor); _lightB = CreateGateLight("ArrivalLight", _gateB + Vector3.up * _radius, ExitColor); } private void Update() { //IL_0057: 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_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_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_00c4: 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_00cc: Unknown result type (might be due to invalid IL or missing references) _age += Time.deltaTime; bool flag = _age >= _warning; float num = 0.55f + Mathf.Abs(Mathf.Sin(_age * (flag ? 7f : 14f))) * 0.45f; UpdateVisual(_ringA, EntryColor, flag, num); UpdateVisual(_ringB, ExitColor, flag, num); if ((Object)(object)_connector != (Object)null) { Color val = Color.Lerp(EntryColor, ExitColor, 0.5f); val.a = (flag ? (0.18f + num * 0.22f) : (num * 0.15f)); LineRenderer? connector = _connector; Color startColor = (_connector.endColor = val); connector.startColor = startColor; } if ((Object)(object)_lightA != (Object)null) { _lightA.intensity = (flag ? (2.2f + num * 1.8f) : num); } if ((Object)(object)_lightB != (Object)null) { _lightB.intensity = (flag ? (2.2f + num * 1.8f) : num); } if (flag && SemiFunc.IsMasterClientOrSingleplayer()) { _scanTimer -= Time.deltaTime; if (_scanTimer <= 0f) { _scanTimer = 0.1f; ScanPlayers(); ScanObjects(); } } if (_age >= _warning + _duration) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void ScanPlayers() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_00a7: 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_00ac: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) foreach (PlayerAvatar item in FusionShared.AllPlayers()) { if ((Object)(object)item == (Object)null || FusionShared.IsPlayerDisabled(item)) { continue; } int instanceID = ((Object)item).GetInstanceID(); if (!_playerCooldown.TryGetValue(instanceID, out var value) || !(Time.time < value)) { bool flag = IsInside(((Component)item).transform.position, _gateA); bool flag2 = !flag && IsInside(((Component)item).transform.position, _gateB); if (flag || flag2) { Vector3 val = (flag ? _axis : (-_axis)); Vector3 val2 = (flag ? _gateB : _gateA) + val * (_radius + 0.9f) + Vector3.up * 0.2f; _playerCooldown[instanceID] = Time.time + 0.9f; int enemyIndex = EnemyIndex(); PlayerTeleportHelper.TriggerWithImpulse(item, val2, _damage, enemyIndex, val * _exitImpulse + Vector3.up * 3f); FusionShared.SpawnWarningRing(val2, flag ? ExitColor : EntryColor, 0.15f, _radius, 0.25f); } } } } private void ScanObjects() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) TeleportObjectsAt(_gateA, _gateB, _axis, ExitColor); TeleportObjectsAt(_gateB, _gateA, -_axis, EntryColor); } private void TeleportObjectsAt(Vector3 entrance, Vector3 exit, Vector3 exitDirection, Color color) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_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_00a1: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_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_0113: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) foreach (PhysGrabObject item in FusionShared.PhysObjectsInRadius(entrance + Vector3.up * 0.6f, _radius)) { if ((Object)(object)item == (Object)null || (Object)(object)item.rb == (Object)null || !IsInside(item.rb.position, entrance)) { continue; } int instanceID = ((Object)item).GetInstanceID(); if (!_objectCooldown.TryGetValue(instanceID, out var value) || !(Time.time < value)) { Vector3 val = exit + exitDirection * (_radius + 0.9f) + Vector3.up * 0.35f; _objectCooldown[instanceID] = Time.time + 0.9f; try { item.Teleport(val, ((Component)item).transform.rotation); item.rb.velocity = exitDirection * _exitImpulse + Vector3.up * 2f; Rigidbody rb = item.rb; rb.angularVelocity *= 0.35f; FusionShared.SpawnWarningRing(val, color, 0.1f, _radius * 0.75f, 0.2f); } catch { } } } } private bool IsInside(Vector3 position, Vector3 gate) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) Vector3 val = position - gate; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude <= _radius * _radius && position.y >= gate.y - 1.2f) { return position.y <= gate.y + _radius * 2.3f; } return false; } private int EnemyIndex() { try { EnemyParent val = (((Object)(object)_source != (Object)null) ? ((Component)_source).GetComponentInParent() : null); if ((Object)(object)val != (Object)null && (Object)(object)EnemyDirector.instance != (Object)null && EnemyDirector.instance.enemiesSpawned != null) { return EnemyDirector.instance.enemiesSpawned.IndexOf(val); } } catch { } return -1; } private LineRenderer CreatePortalRing(string name, Vector3 ground, Vector3 normal, Color color) { //IL_001a: 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_0027: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) LineRenderer val = CreateLine(name, 49, Mathf.Max(0.055f, _radius * 0.075f), color); Vector3 val2 = Vector3.Cross(Vector3.up, normal); Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 val3 = ground + Vector3.up * _radius; for (int i = 0; i <= 48; i++) { float num = (float)i * (float)Math.PI * 2f / 48f; val.SetPosition(i, val3 + normalized * (Mathf.Cos(num) * _radius) + Vector3.up * (Mathf.Sin(num) * _radius)); } return val; } private LineRenderer CreateLine(string name, int points, float width, Color color) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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) GameObject val = new GameObject(name); val.transform.SetParent(((Component)this).transform, false); LineRenderer val2 = val.AddComponent(); val2.useWorldSpace = true; val2.positionCount = points; val2.loop = false; val2.widthMultiplier = width; ((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val2).receiveShadows = false; Color startColor = (val2.endColor = color); val2.startColor = startColor; if ((Object)(object)_material != (Object)null) { ((Renderer)val2).sharedMaterial = _material; } return val2; } private Light CreateGateLight(string name, Vector3 position, Color color) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_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_0038: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(((Component)this).transform, false); val.transform.position = position; Light obj = val.AddComponent(); obj.type = (LightType)2; obj.shadows = (LightShadows)0; obj.color = color; obj.range = Mathf.Max(4f, _radius * 3.2f); obj.intensity = 1f; return obj; } private static void UpdateVisual(LineRenderer? line, Color baseColor, bool armed, float pulse) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_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_0045: 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) if (!((Object)(object)line == (Object)null)) { Color val = (armed ? baseColor : Color.Lerp(Color.white, baseColor, 0.35f)); val.a = (armed ? (0.65f + pulse * 0.35f) : (pulse * 0.65f)); Color startColor = (line.endColor = val); line.startColor = startColor; } } private void OnDestroy() { if ((Object)(object)_material != (Object)null) { Object.Destroy((Object)(object)_material); } } } [HarmonyPatch(typeof(EnemyThinMan), "TeleportEffectRPC")] internal static class EnemyThinManTeleportEffectPatch { private static void Postfix(EnemyThinMan __instance, Vector3 position, bool intro) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) try { if (__instance != null) { ((Component)__instance).GetComponent()?.RecordTeleport(position, intro); } } catch (Exception arg) { Plugin.Log.LogError((object)$"[Parallax] portal pair error: {arg}"); } } } [BepInPlugin("com.matsu.repomutations", "REPO Mutant Enemies", "1.1.0")] public class Plugin : BaseUnityPlugin { public const string Guid = "com.matsu.repomutations"; public const string Name = "REPO Mutant Enemies"; public const string Version = "1.1.0"; public static ConfigEntry MutationChancePerLevel = null; public static ConfigEntry MutationMaxChance = null; public static ConfigEntry MutationHealthMultiplier = null; public static ConfigEntry MutationHealthBonusPerLevel = null; public static ConfigEntry MutationMaxHealthMultiplier = null; public static ConfigEntry MutationAuraRange = null; public static ConfigEntry MutationAuraIntensity = null; public static ConfigEntry MutationDisabledMutants = null; public static ConfigEntry MutationSurgeInterval = null; public static ConfigEntry MutationBalanceRevision = null; public static ConfigEntry BoomdayFuseRange = null; public static ConfigEntry BoomdayFuseTime = null; public static ConfigEntry BoomdayExplodeCooldown = null; public static ConfigEntry BoomdayCoreDamage = null; public static ConfigEntry BoomdayBalloonDamage = null; public static ConfigEntry BoomdayBalloonTouchRadius = null; public static ConfigEntry PoltergeistRange = null; public static ConfigEntry PoltergeistPlayerFloatInterval = null; public static ConfigEntry PoltergeistPlayerFloatForce = null; public static ConfigEntry PoltergeistThrowInterval = null; public static ConfigEntry PoltergeistInversionInterval = null; public static ConfigEntry PoltergeistInversionSeconds = null; public static ConfigEntry PoltergeistSlamForce = null; public static ConfigEntry PoltergeistSlamDamage = null; public static ConfigEntry MeltdownSlowSpeed = null; public static ConfigEntry MeltdownFastSpeed = null; public static ConfigEntry MeltdownBaseSpeed = null; public static ConfigEntry MeltdownHomingForce = null; public static ConfigEntry MeltdownHeadFlightSeconds = null; public static ConfigEntry MeltdownHeadDamage = null; public static ConfigEntry SnatcherDamage = null; public static ConfigEntry DeathgazeStareSeconds = null; public static ConfigEntry DeathgazeBeamSeconds = null; public static ConfigEntry DeathgazeBeamDamage = null; public static ConfigEntry DeathgazeRepeatChargeMultiplier = null; public static ConfigEntry DeathgazeMinimumStareSeconds = null; public static ConfigEntry DeadeyeBeamSeconds = null; public static ConfigEntry DeadeyeBeamDamage = null; public static ConfigEntry TricksterRevealRange = null; public static ConfigEntry TricksterHideRange = null; public static ConfigEntry TricksterRedisguiseSeconds = null; public static ConfigEntry TricksterAttackDamage = null; public static ConfigEntry ElsaCountdownSeconds = null; public static ConfigEntry ElsaTransformBlastSize = null; public static ConfigEntry ElsaTransformBlastDamage = null; public static ConfigEntry BigBangPackSize = null; public static ConfigEntry BigBangExplosionSize = null; public static ConfigEntry BigBangPlayerDamage = null; public static ConfigEntry BigBangEnemyDamage = null; public static ConfigEntry GluttonEatRadius = null; public static ConfigEntry GluttonMaxSwallowed = null; public static ConfigEntry GluttonHpPerPoint = null; public static ConfigEntry GluttonDamagePerPoint = null; public static ConfigEntry GluttonMassPerPoint = null; public static ConfigEntry GluttonDropInvincibleSeconds = null; public static ConfigEntry AlphaCountdownSeconds = null; public static ConfigEntry AlphaHuntSeconds = null; public static ConfigEntry BelladonnaCargoCount = null; public static ConfigEntry BelladonnaCargoRadius = null; public static ConfigEntry BelladonnaCargoLaunchInterval = null; public static ConfigEntry BelladonnaCargoImpactMultiplier = null; public static ConfigEntry BelladonnaAttackDamage = null; public static ConfigEntry BelladonnaAngerSpeedMultiplier = null; public static ConfigEntry BelladonnaMemoryMultiplier = null; public static ConfigEntry FlambeGrenadeSpeed = null; public static ConfigEntry FlambeGrenadeFuse = null; public static ConfigEntry RedlineSpeedMultiplier = null; public static ConfigEntry RedlineWakeInterval = null; public static ConfigEntry RedlineWakeSize = null; public static ConfigEntry RedlineWakeDamage = null; public static ConfigEntry SingularityPullRadius = null; public static ConfigEntry SingularityPullForce = null; public static ConfigEntry SingularityOrbitForce = null; public static ConfigEntry SingularityLaunchForce = null; public static ConfigEntry SingularityImpactMultiplier = null; public static ConfigEntry FaultlineEruptionCount = null; public static ConfigEntry FaultlineEruptionSpacing = null; public static ConfigEntry FaultlineEruptionDelay = null; public static ConfigEntry FaultlineEruptionSize = null; public static ConfigEntry FaultlineEruptionDamage = null; public static ConfigEntry FaultlineHitCooldown = null; public static ConfigEntry KaleidoscopeVolleyInterval = null; public static ConfigEntry KaleidoscopeMarkSpacing = null; public static ConfigEntry KaleidoscopeWarningSeconds = null; public static ConfigEntry KaleidoscopeBlastSize = null; public static ConfigEntry KaleidoscopeBlastDamage = null; public static ConfigEntry HouseEdgeBlastCount = null; public static ConfigEntry HouseEdgeRingRadius = null; public static ConfigEntry HouseEdgeWarningSeconds = null; public static ConfigEntry HouseEdgeStepDelay = null; public static ConfigEntry HouseEdgeBlastSize = null; public static ConfigEntry HouseEdgeBlastDamage = null; public static ConfigEntry ResonanceMarkRadius = null; public static ConfigEntry ResonanceCountdown = null; public static ConfigEntry ResonanceRequiredStillness = null; public static ConfigEntry ResonanceDamage = null; public static ConfigEntry ContagionInfectRadius = null; public static ConfigEntry ContagionInfectCount = null; public static ConfigEntry ContagionTrapSize = null; public static ConfigEntry ContagionTrapDamage = null; public static ConfigEntry BloodBankHealRadius = null; public static ConfigEntry BloodBankHealMultiplier = null; public static ConfigEntry BloodBankMaxHealPerPulse = null; public static ConfigEntry BloodBankDamageResistance = null; public static ConfigEntry BloodBankShieldSeconds = null; public static ConfigEntry RailgunSpeedMultiplier = null; public static ConfigEntry RailgunImpactMultiplier = null; public static ConfigEntry RailgunChargeSeconds = null; public static ConfigEntry BlackoutRadius = null; public static ConfigEntry BlackoutLightMultiplier = null; public static ConfigEntry BlackoutRefreshInterval = null; public static ConfigEntry BlackoutSpeedMultiplier = null; public static ConfigEntry NecromancerRecallRadius = null; public static ConfigEntry NecromancerRecallCountdown = null; public static ConfigEntry NecromancerLineBreakSeconds = null; public static ConfigEntry NecromancerRecallDamage = null; public static ConfigEntry NecromancerPullForce = null; public static ConfigEntry HeartbreakMarkRadius = null; public static ConfigEntry HeartbreakLinkSeconds = null; public static ConfigEntry HeartbreakBreakDistance = null; public static ConfigEntry HeartbreakContactSeconds = null; public static ConfigEntry HeartbreakPulseSeconds = null; public static ConfigEntry HeartbreakPulseDamage = null; public static ConfigEntry HeartbreakSnapDamage = null; public static ConfigEntry HeartbreakPullForce = null; public static ConfigEntry DeathlightCaptureRange = null; public static ConfigEntry DeathlightConeAngle = null; public static ConfigEntry DeathlightRewindSeconds = null; public static ConfigEntry DeathlightBreakSightSeconds = null; public static ConfigEntry DeathlightRewindDamage = null; public static ConfigEntry DeathlightRecaptureCooldown = null; public static ConfigEntry AftershockCorridorLength = null; public static ConfigEntry AftershockStartWidth = null; public static ConfigEntry AftershockCloseSeconds = null; public static ConfigEntry AftershockClapDamage = null; public static ConfigEntry AftershockGrabDisableSeconds = null; public static ConfigEntry ParallaxMinimumDistance = null; public static ConfigEntry ParallaxGateWarningSeconds = null; public static ConfigEntry ParallaxGateDuration = null; public static ConfigEntry ParallaxGateRadius = null; public static ConfigEntry ParallaxGateDamage = null; public static ConfigEntry ParallaxExitImpulse = null; public static ConfigEntry DebugSpawnBoomdayKey = null; public static ConfigEntry DebugSpawnPoltergeistKey = null; public static ConfigEntry DebugSpawnMeltdownKey = null; public static ConfigEntry DebugSpawnSnatcherKey = null; public static ConfigEntry DebugSpawnDeathgazeKey = null; public static ConfigEntry DebugSpawnDeadeyeKey = null; public static ConfigEntry DebugSpawnTricksterKey = null; public static ConfigEntry DebugSpawnElsaKey = null; public static ConfigEntry DebugSpawnBigBangKey = null; public static ConfigEntry DebugSpawnStampedeKey = null; public static ConfigEntry DebugSpawnTyrantKey = null; public static ConfigEntry DebugSpawnBelladonnaKey = null; public static ConfigEntry DebugSpawnButcherKey = null; public static ConfigEntry DebugSpawnRedlineKey = null; public static ConfigEntry DebugSpawnSingularityKey = null; public static ConfigEntry DebugSpawnFaultlineKey = null; public static ConfigEntry DebugSpawnKaleidoscopeKey = null; public static ConfigEntry DebugSpawnHouseEdgeKey = null; public static ConfigEntry DebugSpawnResonanceKey = null; public static ConfigEntry DebugSpawnBloodBankKey = null; public static ConfigEntry DebugSpawnRailgunKey = null; public static ConfigEntry DebugSpawnBlackoutKey = null; public static ConfigEntry DebugSpawnContagionKey = null; public static ConfigEntry DebugSpawnNecromancerKey = null; public static ConfigEntry DebugSpawnHeartbreakKey = null; public static ConfigEntry DebugSpawnDeathlightKey = null; public static ConfigEntry DebugSpawnAftershockKey = null; public static ConfigEntry DebugSpawnParallaxKey = null; internal static float ForceFuseUntil; internal static float BangForceUntil; private Harmony _harmony; private static readonly List _debugActions = new List(); private static bool _updateAlive; private static float _lastDebugSpawn = -10f; private static SemiLaser? _clownLaserPrefab; private static bool _clownLaserSearched; public const string FlambeGrenadeTag = "MatsuFlambeGrenade"; private static Item? _grenadeItem; private static bool _grenadeSearched; private static EnemySetup? _bangSetup; private static SemiLaser? _blasterLaserPrefab; private static bool _blasterLaserSearched; private const string MeltdownHeadPrefabId = "Matsu/MeltdownExtraHead"; private static PrefabRef? _meltdownHeadRef; private static bool _meltdownHeadBuilt; public static Plugin Instance { get; private set; } = null; public static ManualLogSource Log { get; private set; } = null; private void Awake() { //IL_177c: Unknown result type (might be due to invalid IL or missing references) //IL_1786: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; MutationChancePerLevel = ((BaseUnityPlugin)this).Config.Bind("Mutation", "ChancePerLevel", 0.025f, "Mutation chance per level, per mutation type. Chance = level x this (2.5% per level by default), then capped by MaxChance below."); MutationMaxChance = ((BaseUnityPlugin)this).Config.Bind("Mutation", "MaxChance", 0.25f, "Hard cap on the per-type mutation chance, no matter how deep the run goes. Default 0.25 = at most a 25% chance per enemy type. Set to 1 for the old uncapped behaviour, or lower to make mutants rarer."); MutationHealthMultiplier = ((BaseUnityPlugin)this).Config.Bind("Mutation", "HealthMultiplier", 2f, "Base health multiplier applied to every mutated enemy."); MutationHealthBonusPerLevel = ((BaseUnityPlugin)this).Config.Bind("Mutation", "HealthBonusPerLevel", 0.05f, "Extra health multiplier added for every completed level. Default 0.05 means a base 2x mutant has 2.5x health after ten completed levels."); MutationMaxHealthMultiplier = ((BaseUnityPlugin)this).Config.Bind("Mutation", "MaxHealthMultiplier", 3.5f, "Hard cap for the level-scaled mutant health multiplier."); MutationAuraRange = ((BaseUnityPlugin)this).Config.Bind("Mutation", "AuraLightRange", 6f, "Range of the coloured aura light attached to every mutated enemy (works even on invisible enemies)."); MutationAuraIntensity = ((BaseUnityPlugin)this).Config.Bind("Mutation", "AuraLightIntensity", 12f, "Brightness of the coloured aura light."); MutationDisabledMutants = ((BaseUnityPlugin)this).Config.Bind("Mutation", "DisabledMutants", "", "Comma-separated mutant names to disable (for example: Big Bang, Flambe, Singularity). Debug spawn keys ignore this list."); MutationSurgeInterval = ((BaseUnityPlugin)this).Config.Bind("Mutation", "GuaranteedSurgeInterval", 5, "Every Nth displayed level, every supported enemy is guaranteed to use its mutation. Default 5 means levels 5, 10, 15, ... Set to 0 to disable. DisabledMutants is still respected."); MutationBalanceRevision = ((BaseUnityPlugin)this).Config.Bind("Mutation", "BalanceRevision", 0, "Internal default-balance revision. Old untouched defaults are migrated once; customized values are preserved."); BoomdayFuseRange = ((BaseUnityPlugin)this).Config.Bind("BoomdayBoy", "FuseRange", 5f, "Player distance that lights the fuse."); BoomdayFuseTime = ((BaseUnityPlugin)this).Config.Bind("BoomdayBoy", "FuseTime", 2.25f, "Seconds from fuse lit to an explosion."); BoomdayExplodeCooldown = ((BaseUnityPlugin)this).Config.Bind("BoomdayBoy", "ExplodeCooldown", 3.5f, "Seconds before a Boomday Boy can explode again. It survives its own blasts (recurring threat)."); BoomdayCoreDamage = ((BaseUnityPlugin)this).Config.Bind("BoomdayBoy", "CoreDamage", 55, "Explosion damage (proximity & death blasts). Uses the game's real explosion."); BoomdayBalloonDamage = ((BaseUnityPlugin)this).Config.Bind("BoomdayBoy", "BalloonDamage", 30, "Per-balloon explosion damage. Uses the game's real explosion."); BoomdayBalloonTouchRadius = ((BaseUnityPlugin)this).Config.Bind("BoomdayBoy", "BalloonTouchRadius", 1.5f, "A balloon explodes when a player comes this close to it (enemies only pop it, no explosion)."); PoltergeistRange = ((BaseUnityPlugin)this).Config.Bind("Poltergeist", "Range", 11f, "Radius of the zero-G field and telekinetic reach."); PoltergeistPlayerFloatInterval = ((BaseUnityPlugin)this).Config.Bind("Poltergeist", "PlayerFloatInterval", 0.8f, "Seconds between the light upward nudges that keep players unsteady in the field."); PoltergeistPlayerFloatForce = ((BaseUnityPlugin)this).Config.Bind("Poltergeist", "PlayerFloatForce", 10f, "Strength of the periodic upward nudge on players inside the field."); PoltergeistThrowInterval = ((BaseUnityPlugin)this).Config.Bind("Poltergeist", "ThrowInterval", 1.2f, "Seconds between telekinetic throws. The thrown valuable's own physics impact deals damage (like the Rugrat)."); PoltergeistInversionInterval = ((BaseUnityPlugin)this).Config.Bind("Poltergeist", "GravityInversionInterval", 6.5f, "Seconds between high-gravity inversions of the zero-G field."); PoltergeistInversionSeconds = ((BaseUnityPlugin)this).Config.Bind("Poltergeist", "GravityInversionSeconds", 1.6f, "How long each high-gravity slam lasts."); PoltergeistSlamForce = ((BaseUnityPlugin)this).Config.Bind("Poltergeist", "GravitySlamForce", 30f, "Downward acceleration applied to players and loose physics objects during an inversion."); PoltergeistSlamDamage = ((BaseUnityPlugin)this).Config.Bind("Poltergeist", "GravitySlamDamage", 25, "Damage dealt once at the end of a gravity inversion to players still inside the field."); MeltdownSlowSpeed = ((BaseUnityPlugin)this).Config.Bind("MeltdownCrew", "SlowHeadSpeed", 0.5f, "Speed factor of the sluggish 2nd head in the volley (1 = normal Cleanup Crew head speed)."); MeltdownFastSpeed = ((BaseUnityPlugin)this).Config.Bind("MeltdownCrew", "FastHeadSpeed", 2f, "Speed factor of the frantic 3rd head in the volley (1 = normal Cleanup Crew head speed)."); MeltdownBaseSpeed = ((BaseUnityPlugin)this).Config.Bind("MeltdownCrew", "BaseHeadSpeed", 4f, "Reference horizontal head speed (m/s) that the slow/fast factors scale. The head's speed is capped at this x factor."); MeltdownHomingForce = ((BaseUnityPlugin)this).Config.Bind("MeltdownCrew", "FastHeadHomingForce", 12f, "Extra homing force applied to the fast head per (factor-1) so it actually reaches its higher speed and tracks the player."); MeltdownHeadFlightSeconds = ((BaseUnityPlugin)this).Config.Bind("MeltdownCrew", "HeadFlightSeconds", 7f, "How long each of the two EXTRA heads chases before it detonates. Set to roughly match the vanilla head's own fuse (~7s) so all three explode together — only their movement SPEED differs (0.5x / 2x)."); MeltdownHeadDamage = ((BaseUnityPlugin)this).Config.Bind("MeltdownCrew", "ExtraHeadDamage", 75, "Explosion damage of each extra head. The original vanilla head still remains in the three-head volley."); SnatcherDamage = ((BaseUnityPlugin)this).Config.Bind("Snatcher", "Damage", 45, "Damage dealt the instant a Snatcher (mutated Hidden) whisks you away."); DeathgazeStareSeconds = ((BaseUnityPlugin)this).Config.Bind("Deathgaze", "StareSeconds", 5.5f, "Seconds a Deathgaze (mutated Peeper) must hold a player in its stare before it fires a beam."); DeathgazeBeamSeconds = ((BaseUnityPlugin)this).Config.Bind("Deathgaze", "BeamSeconds", 2.5f, "How long each fired beam lasts."); DeathgazeBeamDamage = ((BaseUnityPlugin)this).Config.Bind("Deathgaze", "BeamDamage", 50, "Damage the beam deals (at most once per beam)."); DeathgazeRepeatChargeMultiplier = ((BaseUnityPlugin)this).Config.Bind("Deathgaze", "RepeatChargeMultiplier", 0.68f, "Deathgaze: multiplier applied to each follow-up charge while the same stare remains unbroken. Lower is faster."); DeathgazeMinimumStareSeconds = ((BaseUnityPlugin)this).Config.Bind("Deathgaze", "MinimumStareSeconds", 2f, "Deathgaze: fastest allowed follow-up charge time during one uninterrupted stare."); DeadeyeBeamSeconds = ((BaseUnityPlugin)this).Config.Bind("Deadeye", "BeamSeconds", 3f, "How long the Photon Blaster beam keeps firing each time a Deadeye (mutated Huntsman) shoots."); DeadeyeBeamDamage = ((BaseUnityPlugin)this).Config.Bind("Deadeye", "BeamDamage", 55, "Damage the Deadeye's Photon Blaster beam deals per shot."); TricksterRevealRange = ((BaseUnityPlugin)this).Config.Bind("Trickster", "RevealRange", 2.25f, "Trickster (mutated Gnome): while disguised as a valuable, a player coming within this range (or grabbing/hurting it) springs the trap."); TricksterHideRange = ((BaseUnityPlugin)this).Config.Bind("Trickster", "HideRange", 9f, "Trickster: it only disguises itself when calm and no player is within this range."); TricksterAttackDamage = ((BaseUnityPlugin)this).Config.Bind("Trickster", "AttackDamage", 50, "Trickster (mutated Gnome): contact/attack damage of the ambushing gnome (vanilla gnome is ~10; an entire four-Gnome group mutates together)."); TricksterRedisguiseSeconds = ((BaseUnityPlugin)this).Config.Bind("Trickster", "RedisguiseSeconds", 20f, "Trickster: after springing its trap, seconds before it may disguise itself again."); ElsaCountdownSeconds = ((BaseUnityPlugin)this).Config.Bind("Fenrir", "CountdownSeconds", 3.5f, "Fenrir (mutated Elsa): when the dog form spots a player it freezes for this long — a warning to flee — then transforms and attacks as normal."); ElsaTransformBlastSize = ((BaseUnityPlugin)this).Config.Bind("Fenrir", "TransformBlastSize", 1.05f, "Fenrir: size of the enemy-safe shockwave released when the countdown reaches zero."); ElsaTransformBlastDamage = ((BaseUnityPlugin)this).Config.Bind("Fenrir", "TransformBlastDamage", 60, "Fenrir: player damage dealt by the transformation shockwave."); BigBangPackSize = ((BaseUnityPlugin)this).Config.Bind("BigBang", "PackSize", 2, "Big Bang (mutated Banger): total squad size (live Bangers counted first, only the difference is summoned). NOTE: if you already have a config file, edit PackSize there — the new default only applies to a fresh config."); BigBangExplosionSize = ((BaseUnityPlugin)this).Config.Bind("BigBang", "ExplosionSize", 1.2f, "Big Bang: blast radius/size (the shop grenade is 0.8, the vanilla Banger self-detonate is 1.0)."); BigBangPlayerDamage = ((BaseUnityPlugin)this).Config.Bind("BigBang", "PlayerDamage", 80, "Big Bang: player damage per blast."); BigBangEnemyDamage = ((BaseUnityPlugin)this).Config.Bind("BigBang", "EnemyDamage", 150, "Big Bang: enemy damage per blast (high = squad chain-reactions)."); GluttonEatRadius = ((BaseUnityPlugin)this).Config.Bind("Glutton", "EatRadius", 2.5f, "Glutton (mutated Animal): loose valuables within this range get swallowed. Kill it to get everything back."); GluttonMaxSwallowed = ((BaseUnityPlugin)this).Config.Bind("Glutton", "MaxSwallowed", 12, "Glutton: maximum number of valuables it can hold in its belly."); GluttonHpPerPoint = ((BaseUnityPlugin)this).Config.Bind("Glutton", "HpPerSizePoint", 25, "Glutton: HP gained per size point eaten (valuables are worth 1-4 points by physical size)."); GluttonDamagePerPoint = ((BaseUnityPlugin)this).Config.Bind("Glutton", "DamagePerSizePoint", 4, "Glutton: contact damage gained per size point eaten."); GluttonMassPerPoint = ((BaseUnityPlugin)this).Config.Bind("Glutton", "MassPerSizePoint", 0.6f, "Glutton: body mass gained per size point eaten (heavier = harder to shove around)."); GluttonDropInvincibleSeconds = ((BaseUnityPlugin)this).Config.Bind("Glutton", "DropInvincibleSeconds", 2f, "Glutton: brief damage-immunity given to the valuables it coughs up on death, so the killing blast doesn't instantly destroy them."); AlphaCountdownSeconds = ((BaseUnityPlugin)this).Config.Bind("Alpha", "CountdownSeconds", 5f, "Alpha (mutated Apex Predator): it freezes for this long with a countdown before transforming (like Fenrir) — then swaps places with a random other enemy and howls."); AlphaHuntSeconds = ((BaseUnityPlugin)this).Config.Bind("Alpha", "HuntSeconds", 15f, "Alpha: how long its howl keeps every enemy on the map hunting its prey."); BelladonnaCargoCount = ((BaseUnityPlugin)this).Config.Bind("Belladonna", "CargoCount", 4, "Belladonna (mutated Bella): maximum loose valuables magnetised and launched by each bell tell."); BelladonnaCargoRadius = ((BaseUnityPlugin)this).Config.Bind("Belladonna", "CargoRadius", 10f, "Belladonna: search radius for cursed cargo."); BelladonnaCargoLaunchInterval = ((BaseUnityPlugin)this).Config.Bind("Belladonna", "CargoLaunchInterval", 0.18f, "Belladonna: delay between consecutive cargo launches."); BelladonnaCargoImpactMultiplier = ((BaseUnityPlugin)this).Config.Bind("Belladonna", "CargoImpactMultiplier", 6f, "Belladonna: temporary player-impact multiplier applied to each launched valuable."); BelladonnaAttackDamage = ((BaseUnityPlugin)this).Config.Bind("Belladonna", "AttackDamage", 60, "Belladonna: contact/attack damage of the real tricycle."); BelladonnaAngerSpeedMultiplier = ((BaseUnityPlugin)this).Config.Bind("Belladonna", "AngerSpeedMultiplier", 2.5f, "Belladonna: how much faster than vanilla she escalates to her bell-ring/attack sequence and recovers between attacks (2.5 = roughly 2.5x faster). Continuously shrinks her internal wait timers, so this scales with whatever she just rolled rather than a fixed number."); BelladonnaMemoryMultiplier = ((BaseUnityPlugin)this).Config.Bind("Belladonna", "MemoryMultiplier", 2f, "Belladonna: how much longer she remembers/stays angry at a player after losing sight of them, versus vanilla's ~10 seconds (2 = roughly twice as long, i.e. ~20s)."); FlambeGrenadeSpeed = ((BaseUnityPlugin)this).Config.Bind("Flambe", "GrenadeLaunchSpeed", 5f, "Flambé: launch speed of the four live grenades it flings each tumble attack (shop grenade blast; enemies are immune to it)."); FlambeGrenadeFuse = ((BaseUnityPlugin)this).Config.Bind("Flambe", "GrenadeFuseSeconds", 3f, "Flambé: fuse time of the launched grenades (the shop grenade's tick time is 3s)."); RedlineSpeedMultiplier = ((BaseUnityPlugin)this).Config.Bind("Redline", "ChaseSpeedMultiplier", 1.75f, "Redline (mutated Reaper): chase speed multiplier while seeking or attacking a player."); RedlineWakeInterval = ((BaseUnityPlugin)this).Config.Bind("Redline", "RouteReplayInterval", 4.5f, "Redline: minimum seconds between lethal replays of its recorded chase route."); RedlineWakeSize = ((BaseUnityPlugin)this).Config.Bind("Redline", "RouteWidth", 0.8f, "Redline: hit width of the moving pulse that replays its route."); RedlineWakeDamage = ((BaseUnityPlugin)this).Config.Bind("Redline", "RouteDamage", 55, "Redline: damage dealt once when its moving route pulse catches a player."); SingularityPullRadius = ((BaseUnityPlugin)this).Config.Bind("Singularity", "PullRadius", 10f, "Singularity (mutated Bowtie): radius of the gravity well created by its yell."); SingularityPullForce = ((BaseUnityPlugin)this).Config.Bind("Singularity", "PullForce", 18f, "Singularity: inward acceleration applied to players and loose physics objects during the yell."); SingularityOrbitForce = ((BaseUnityPlugin)this).Config.Bind("Singularity", "OrbitForce", 13f, "Singularity: tangential acceleration that traps loose valuables in orbit during the yell."); SingularityLaunchForce = ((BaseUnityPlugin)this).Config.Bind("Singularity", "SlingshotForce", 20f, "Singularity: launch impulse used to fire captured valuables at players when the yell ends."); SingularityImpactMultiplier = ((BaseUnityPlugin)this).Config.Bind("Singularity", "SlingshotImpactMultiplier", 8f, "Singularity: temporary player-impact multiplier on slingshotted valuables."); FaultlineEruptionCount = ((BaseUnityPlugin)this).Config.Bind("Faultline", "EruptionCount", 4, "Faultline (mutated Headman): length multiplier for each of the three persistent crack branches."); FaultlineEruptionSpacing = ((BaseUnityPlugin)this).Config.Bind("Faultline", "EruptionSpacing", 2.1f, "Faultline: metres of branch length per length-multiplier step."); FaultlineEruptionDelay = ((BaseUnityPlugin)this).Config.Bind("Faultline", "CrackWarningSeconds", 0.8f, "Faultline: warning time before its three persistent cracks become dangerous."); FaultlineEruptionSize = ((BaseUnityPlugin)this).Config.Bind("Faultline", "CrackWidth", 0.75f, "Faultline: damaging width of each persistent floor crack."); FaultlineEruptionDamage = ((BaseUnityPlugin)this).Config.Bind("Faultline", "EruptionDamage", 40, "Faultline: player damage dealt while touching an active crack branch."); FaultlineHitCooldown = ((BaseUnityPlugin)this).Config.Bind("Faultline", "CrackHitCooldown", 1.25f, "Faultline: minimum seconds between repeated hits from the same persistent crack field."); KaleidoscopeVolleyInterval = ((BaseUnityPlugin)this).Config.Bind("Kaleidoscope", "VolleyInterval", 2.4f, "Kaleidoscope (mutated Clown): seconds between prismatic mark volleys while its laser is firing."); KaleidoscopeMarkSpacing = ((BaseUnityPlugin)this).Config.Bind("Kaleidoscope", "MarkSpacing", 1.8f, "Kaleidoscope: lateral spacing between the three delayed blast marks."); KaleidoscopeWarningSeconds = ((BaseUnityPlugin)this).Config.Bind("Kaleidoscope", "WarningSeconds", 0.65f, "Kaleidoscope: warning time before each prismatic mark explodes."); KaleidoscopeBlastSize = ((BaseUnityPlugin)this).Config.Bind("Kaleidoscope", "BlastSize", 0.6f, "Kaleidoscope: size of each prismatic blast."); KaleidoscopeBlastDamage = ((BaseUnityPlugin)this).Config.Bind("Kaleidoscope", "BlastDamage", 40, "Kaleidoscope: player damage dealt by each blast. Enemies are immune."); HouseEdgeBlastCount = ((BaseUnityPlugin)this).Config.Bind("HouseEdge", "RuleStrength", 4, "House Edge (mutated Gambit): strength/count used by colour-specific house rules."); HouseEdgeRingRadius = ((BaseUnityPlugin)this).Config.Bind("HouseEdge", "RuleRadius", 12f, "House Edge: radius affected by roulette house rules."); HouseEdgeWarningSeconds = ((BaseUnityPlugin)this).Config.Bind("HouseEdge", "WarningSeconds", 0.8f, "House Edge: grace time before the red-light rule starts judging movement."); HouseEdgeStepDelay = ((BaseUnityPlugin)this).Config.Bind("HouseEdge", "StepDelay", 0.11f, "House Edge: interval used by staged house-rule effects."); HouseEdgeBlastSize = ((BaseUnityPlugin)this).Config.Bind("HouseEdge", "MovementTolerance", 0.45f, "House Edge: distance a player may move during Red Light without losing."); HouseEdgeBlastDamage = ((BaseUnityPlugin)this).Config.Bind("HouseEdge", "RuleDamage", 55, "House Edge: damage dealt when a harmful house rule catches a player."); ResonanceMarkRadius = ((BaseUnityPlugin)this).Config.Bind("Resonance", "MarkRadius", 16f, "Resonance (mutated Upscream): players inside this radius are marked by each attack."); ResonanceCountdown = ((BaseUnityPlugin)this).Config.Bind("Resonance", "EchoCountdown", 3f, "Resonance: seconds until the echo returns after a player is marked."); ResonanceRequiredStillness = ((BaseUnityPlugin)this).Config.Bind("Resonance", "RequiredStillnessSeconds", 0.75f, "Resonance: how long a marked player must remain still before the echo returns to avoid damage."); ResonanceDamage = ((BaseUnityPlugin)this).Config.Bind("Resonance", "MovingDamage", 55, "Resonance: damage dealt to a marked player who is still moving when the echo returns."); ContagionInfectRadius = ((BaseUnityPlugin)this).Config.Bind("Contagion", "InfectRadius", 9f, "Contagion (mutated Spewer): radius in which puke can infect loose valuables."); ContagionInfectCount = ((BaseUnityPlugin)this).Config.Bind("Contagion", "InfectCount", 3, "Contagion: maximum valuables infected by one puke episode."); ContagionTrapSize = ((BaseUnityPlugin)this).Config.Bind("Contagion", "ToxicBurstSize", 0.9f, "Contagion: size of the toxic backlash when an infected valuable is grabbed."); ContagionTrapDamage = ((BaseUnityPlugin)this).Config.Bind("Contagion", "ToxicBurstDamage", 50, "Contagion: player damage dealt by an infected valuable's toxic backlash."); BloodBankHealRadius = ((BaseUnityPlugin)this).Config.Bind("BloodBank", "HealRadius", 10f, "Blood Bank (mutated Tick): radius in which stolen health is shared with other enemies."); BloodBankHealMultiplier = ((BaseUnityPlugin)this).Config.Bind("BloodBank", "AllyHealMultiplier", 0.75f, "Blood Bank: nearby-enemy healing per point of health stolen from a player."); BloodBankMaxHealPerPulse = ((BaseUnityPlugin)this).Config.Bind("BloodBank", "MaxHealPerPulse", 25, "Blood Bank: maximum health restored to each nearby enemy per suck pulse."); BloodBankDamageResistance = ((BaseUnityPlugin)this).Config.Bind("BloodBank", "AllyDamageResistance", 0.45f, "Blood Bank: temporary damage reduction granted to nearby enemies after every successful suck (0.45 = 45%)."); BloodBankShieldSeconds = ((BaseUnityPlugin)this).Config.Bind("BloodBank", "ShieldSeconds", 6f, "Blood Bank: duration of the damage-resistance pulse on nearby enemies."); RailgunSpeedMultiplier = ((BaseUnityPlugin)this).Config.Bind("Railgun", "ProjectileSpeedMultiplier", 1.75f, "Railgun (mutated Rugrat): multiplier applied to a valuable's velocity after it is thrown."); RailgunImpactMultiplier = ((BaseUnityPlugin)this).Config.Bind("Railgun", "ImpactDamageMultiplier", 9f, "Railgun: player-impact damage multiplier on its charged valuable (vanilla Rugrat uses 5x)."); RailgunChargeSeconds = ((BaseUnityPlugin)this).Config.Bind("Railgun", "ChargeSeconds", 3.5f, "Railgun: duration of the charged impact multiplier and projectile trail."); BlackoutRadius = ((BaseUnityPlugin)this).Config.Bind("Blackout", "DarknessRadius", 16f, "Blackout (mutated Robe): radius in which active lights are suppressed while it hunts."); BlackoutLightMultiplier = ((BaseUnityPlugin)this).Config.Bind("Blackout", "LightIntensityMultiplier", 0.05f, "Blackout: remaining fraction of nearby light intensity (0 = total darkness, 1 = unchanged)."); BlackoutRefreshInterval = ((BaseUnityPlugin)this).Config.Bind("Blackout", "RefreshInterval", 0.45f, "Blackout: seconds between local light scans. Higher values reduce scanning frequency."); BlackoutSpeedMultiplier = ((BaseUnityPlugin)this).Config.Bind("Blackout", "PursuitSpeedMultiplier", 1.75f, "Blackout: host-side movement speed multiplier while its darkness field is active."); NecromancerRecallRadius = ((BaseUnityPlugin)this).Config.Bind("Necromancer", "SoulRecallRadius", 20f, "Necromancer (mutated Head Grabber): radius in which a stolen death head chains living players."); NecromancerRecallCountdown = ((BaseUnityPlugin)this).Config.Bind("Necromancer", "SoulRecallCountdown", 5f, "Necromancer: seconds before an unbroken soul chain recalls its player to the stolen head."); NecromancerLineBreakSeconds = ((BaseUnityPlugin)this).Config.Bind("Necromancer", "CoverBreakSeconds", 1.5f, "Necromancer: continuous seconds behind real cover required to sever a soul chain."); NecromancerRecallDamage = ((BaseUnityPlugin)this).Config.Bind("Necromancer", "SoulRecallDamage", 50, "Necromancer: damage dealt when an exposed soul chain completes its recall."); NecromancerPullForce = ((BaseUnityPlugin)this).Config.Bind("Necromancer", "SoulRecallPullForce", 22f, "Necromancer: force pulling a recalled player toward the stolen death head."); HeartbreakMarkRadius = ((BaseUnityPlugin)this).Config.Bind("Heartbreak", "MarkRadius", 16f, "Heartbreak (mutated Heart Hugger): radius in which its chomp forges paired heart chains."); HeartbreakLinkSeconds = ((BaseUnityPlugin)this).Config.Bind("Heartbreak", "ChainLifetime", 8f, "Heartbreak: maximum life of a heart chain before it snaps."); HeartbreakBreakDistance = ((BaseUnityPlugin)this).Config.Bind("Heartbreak", "ReunionDistance", 1.6f, "Heartbreak: distance partners must close to begin breaking their shared chain."); HeartbreakContactSeconds = ((BaseUnityPlugin)this).Config.Bind("Heartbreak", "ReunionHoldSeconds", 1.1f, "Heartbreak: continuous reunion time required to break a heart chain."); HeartbreakPulseSeconds = ((BaseUnityPlugin)this).Config.Bind("Heartbreak", "ChainPulseSeconds", 1.35f, "Heartbreak: interval between damaging chain pulls while partners remain apart."); HeartbreakPulseDamage = ((BaseUnityPlugin)this).Config.Bind("Heartbreak", "ChainPulseDamage", 10, "Heartbreak: damage dealt by each heart-chain pull."); HeartbreakSnapDamage = ((BaseUnityPlugin)this).Config.Bind("Heartbreak", "ChainSnapDamage", 50, "Heartbreak: damage dealt when an unresolved heart chain reaches the end of its life."); HeartbreakPullForce = ((BaseUnityPlugin)this).Config.Bind("Heartbreak", "ChainPullForce", 9f, "Heartbreak: force pulling linked partners toward one another on each pulse."); DeathlightCaptureRange = ((BaseUnityPlugin)this).Config.Bind("Deathlight", "CaptureRange", 26f, "Deathlight (mutated Oogly): maximum range at which its hostile spotlight photographs a player."); DeathlightConeAngle = ((BaseUnityPlugin)this).Config.Bind("Deathlight", "SpotlightConeDegrees", 38f, "Deathlight: full angle of the photographic spotlight cone."); DeathlightRewindSeconds = ((BaseUnityPlugin)this).Config.Bind("Deathlight", "RewindCountdown", 4f, "Deathlight: seconds before a surviving photograph rewinds its player to the captured position."); DeathlightBreakSightSeconds = ((BaseUnityPlugin)this).Config.Bind("Deathlight", "CoverEraseSeconds", 1.25f, "Deathlight: continuous seconds outside the spotlight's line of sight required to erase a photograph."); DeathlightRewindDamage = ((BaseUnityPlugin)this).Config.Bind("Deathlight", "RewindDamage", 50, "Deathlight: damage dealt when a photograph forcibly rewinds its player."); DeathlightRecaptureCooldown = ((BaseUnityPlugin)this).Config.Bind("Deathlight", "RecaptureCooldown", 5f, "Deathlight: minimum delay before the same player can be photographed again."); AftershockCorridorLength = ((BaseUnityPlugin)this).Config.Bind("Aftershock", "ClapCorridorLength", 14f, "Aftershock (mutated Shadow Child): length of the corridor trapped between its closing shadow walls."); AftershockStartWidth = ((BaseUnityPlugin)this).Config.Bind("Aftershock", "ClapStartWidth", 10f, "Aftershock: starting gap between the two giant shadow walls."); AftershockCloseSeconds = ((BaseUnityPlugin)this).Config.Bind("Aftershock", "ClapCloseSeconds", 2.1f, "Aftershock: seconds the walls take to close; escape sideways before they meet."); AftershockClapDamage = ((BaseUnityPlugin)this).Config.Bind("Aftershock", "ClapDamage", 60, "Aftershock: damage dealt to players still inside the original corridor at the final clap."); AftershockGrabDisableSeconds = ((BaseUnityPlugin)this).Config.Bind("Aftershock", "ClapGrabDisableSeconds", 1.8f, "Aftershock: time a caught player loses their current grab after the final clap."); ParallaxMinimumDistance = ((BaseUnityPlugin)this).Config.Bind("Parallax", "MinimumTeleportDistance", 3f, "Parallax (mutated Thin Man): minimum teleport distance required to leave a linked portal pair."); ParallaxGateWarningSeconds = ((BaseUnityPlugin)this).Config.Bind("Parallax", "GateWarningSeconds", 0.6f, "Parallax: warning time before a linked portal pair becomes active."); ParallaxGateDuration = ((BaseUnityPlugin)this).Config.Bind("Parallax", "GateDuration", 15f, "Parallax: seconds the linked portal pair remains active."); ParallaxGateRadius = ((BaseUnityPlugin)this).Config.Bind("Parallax", "GateRadius", 1.75f, "Parallax: activation radius of each portal gate for players and loose physics objects."); ParallaxGateDamage = ((BaseUnityPlugin)this).Config.Bind("Parallax", "GateDamage", 25, "Parallax: damage dealt to a player transported through a hostile portal."); ParallaxExitImpulse = ((BaseUnityPlugin)this).Config.Bind("Parallax", "ExitImpulse", 12f, "Parallax: horizontal launch force applied as players and loose objects leave a portal."); MigrateBalanceRevision1(); MigrateBalanceRevision2(); DebugSpawnBoomdayKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnBoomdayKey", (KeyCode)290, "Press (host only) to spawn a Boomday Boy in front of your camera."); DebugSpawnPoltergeistKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnPoltergeistKey", (KeyCode)291, "Press (host only) to spawn a Poltergeist (mutated Mentalist) in front of your camera."); DebugSpawnMeltdownKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnMeltdownKey", (KeyCode)289, "Press (host only) to spawn a Meltdown Crew (mutated Cleanup Crew) in front of your camera."); DebugSpawnSnatcherKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnSnatcherKey", (KeyCode)288, "Press (host only) to spawn a Snatcher (mutated Hidden) in front of your camera."); DebugSpawnDeathgazeKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnDeathgazeKey", (KeyCode)287, "Press (host only) to spawn a Deathgaze (mutated Peeper) in front of your camera."); DebugSpawnDeadeyeKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnDeadeyeKey", (KeyCode)286, "Press (host only) to spawn a Deadeye (mutated Huntsman) in front of your camera."); DebugSpawnTricksterKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnTricksterKey", (KeyCode)285, "Press (host only) to spawn a Trickster (mutated Gnome) in front of your camera."); DebugSpawnElsaKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnElsaKey", (KeyCode)283, "Press (host only) to spawn a Fenrir (mutated Elsa) in front of your camera."); DebugSpawnBigBangKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnBigBangKey", (KeyCode)284, "Press (host only) to spawn a Big Bang squad (mutated Bangers) in front of your camera."); DebugSpawnStampedeKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnGluttonKey", (KeyCode)282, "Press (host only) to spawn a Glutton (mutated Animal) in front of your camera."); DebugSpawnTyrantKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnAlphaKey", (KeyCode)292, "Press (host only) to spawn an Alpha (mutated Apex Predator) in front of your camera."); DebugSpawnBelladonnaKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnBelladonnaKey", (KeyCode)293, "Press (host only) to spawn a Belladonna (mutated Bella) in front of your camera."); DebugSpawnButcherKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnFlambeKey", (KeyCode)277, "Press (host only) to spawn a Flambe (mutated Chef) in front of your camera."); DebugSpawnRedlineKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnRedlineKey", (KeyCode)278, "Press (host only) to spawn a Redline (mutated Reaper) in front of your camera."); DebugSpawnSingularityKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnSingularityKey", (KeyCode)127, "Press (host only) to spawn a Singularity (mutated Bowtie) in front of your camera."); DebugSpawnFaultlineKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnFaultlineKey", (KeyCode)280, "Press (host only) to spawn a Faultline (mutated Headman) in front of your camera."); DebugSpawnKaleidoscopeKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnKaleidoscopeKey", (KeyCode)279, "Press (host only) to spawn a Kaleidoscope (mutated Clown) in front of your camera."); DebugSpawnHouseEdgeKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnHouseEdgeKey", (KeyCode)281, "Press (host only) to spawn a House Edge (mutated Gambit) in front of your camera."); DebugSpawnResonanceKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnResonanceKey", (KeyCode)19, "Press (host only) to spawn a Resonance (mutated Upscream) in front of your camera."); DebugSpawnBloodBankKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnBloodBankKey", (KeyCode)91, "Press (host only) to spawn a Blood Bank (mutated Tick) in front of your camera."); DebugSpawnRailgunKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnRailgunKey", (KeyCode)93, "Press (host only) to spawn a Railgun (mutated Rugrat) in front of your camera."); DebugSpawnBlackoutKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnBlackoutKey", (KeyCode)92, "Press (host only) to spawn a Blackout (mutated Robe) in front of your camera."); DebugSpawnContagionKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnContagionKey", (KeyCode)59, "Press (host only) to spawn a Contagion (mutated Spewer) in front of your camera."); DebugSpawnNecromancerKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnNecromancerKey", (KeyCode)39, "Press (host only) to spawn a Necromancer (mutated Head Grabber) in front of your camera."); DebugSpawnHeartbreakKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnHeartbreakKey", (KeyCode)44, "Press (host only) to spawn a Heartbreak (mutated Heart Hugger) in front of your camera."); DebugSpawnDeathlightKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnDeathlightKey", (KeyCode)46, "Press (host only) to spawn a Deathlight (mutated Oogly) in front of your camera."); DebugSpawnAftershockKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnAftershockKey", (KeyCode)47, "Press (host only) to spawn an Aftershock (mutated Shadow Child) in front of your camera."); DebugSpawnParallaxKey = ((BaseUnityPlugin)this).Config.Bind("Debug", "SpawnParallaxKey", (KeyCode)96, "Press (host only) to spawn a Parallax (mutated Thin Man) in front of your camera."); _harmony = new Harmony("com.matsu.repomutations"); _harmony.PatchAll(); ArmDebugActions(); Log.LogInfo((object)string.Format("{0} {1} loaded with 28 mutants. Mutation chance = level x {2:P0}, capped at {3:P0}; guaranteed surge every {4} levels; current health multiplier = {5:0.00}x. Debug: Boomday Boy (F9), Poltergeist (F10), Meltdown Crew (F8), Snatcher (F7), Deathgaze (F6), Deadeye (F5), Trickster (F4), Big Bang (F3), Fenrir (F2), Glutton (F1), Alpha (F11), Belladonna (F12), Flambe (Insert), Redline (Home), Singularity (Delete), Faultline (PageUp), Kaleidoscope (End), House Edge (PageDown), Resonance (Pause), Blood Bank ([), Railgun (]), Blackout (Backslash), Contagion (;), Necromancer ('), Heartbreak (,), Deathlight (.), Aftershock (/), Parallax (`). Everyone in the lobby must install this mod.", "REPO Mutant Enemies", "1.1.0", MutationChancePerLevel.Value, MutationMaxChance.Value, MutationSurgeInterval.Value, CurrentHealthMultiplier())); } private void MigrateBalanceRevision1() { if (MutationBalanceRevision.Value < 1) { bool saveOnConfigSet = ((BaseUnityPlugin)this).Config.SaveOnConfigSet; ((BaseUnityPlugin)this).Config.SaveOnConfigSet = false; MigrateOldDefault(MutationHealthMultiplier, 2f, 1.65f); MigrateOldDefault(MutationHealthBonusPerLevel, 0.05f, 0.03f); MigrateOldDefault(MutationMaxHealthMultiplier, 3.5f, 2.5f); MigrateOldDefault(BoomdayFuseTime, 2.5f, 2.75f); MigrateOldDefault(BoomdayExplodeCooldown, 4f, 5.5f); MigrateOldDefault(BoomdayCoreDamage, 40, 35); MigrateOldDefault(BoomdayBalloonDamage, 20, 15); MigrateOldDefault(BoomdayBalloonTouchRadius, 1.3f, 1.15f); MigrateOldDefault(PoltergeistRange, 9f, 8f); MigrateOldDefault(PoltergeistPlayerFloatInterval, 1f, 1.15f); MigrateOldDefault(PoltergeistPlayerFloatForce, 8f, 6f); MigrateOldDefault(PoltergeistThrowInterval, 1.6f, 2f); MigrateOldDefault(PoltergeistInversionInterval, 8f, 10f); MigrateOldDefault(PoltergeistInversionSeconds, 1.35f, 1.1f); MigrateOldDefault(PoltergeistSlamForce, 24f, 18f); MigrateOldDefault(MeltdownFastSpeed, 2f, 1.75f); MigrateOldDefault(MeltdownHomingForce, 12f, 9f); MigrateOldDefault(MeltdownHeadFlightSeconds, 7f, 6.5f); MigrateOldDefault(MeltdownHeadDamage, 75, 50); MigrateOldDefault(SnatcherDamage, 25, 20); MigrateOldDefault(DeathgazeStareSeconds, 5.5f, 6f); MigrateOldDefault(DeathgazeBeamSeconds, 2.5f, 2.2f); MigrateOldDefault(DeathgazeBeamDamage, 45, 35); MigrateOldDefault(DeathgazeRepeatChargeMultiplier, 0.68f, 0.8f); MigrateOldDefault(DeathgazeMinimumStareSeconds, 2f, 2.75f); MigrateOldDefault(DeadeyeBeamSeconds, 3f, 2.5f); MigrateOldDefault(DeadeyeBeamDamage, 40, 35); MigrateOldDefault(TricksterAttackDamage, 50, 30); MigrateOldDefault(TricksterRedisguiseSeconds, 20f, 25f); MigrateOldDefault(ElsaCountdownSeconds, 3.5f, 4f); MigrateOldDefault(ElsaTransformBlastSize, 1.05f, 0.9f); MigrateOldDefault(ElsaTransformBlastDamage, 45, 35); MigrateOldDefault(BigBangExplosionSize, 1.2f, 1f); MigrateOldDefault(BigBangPlayerDamage, 80, 55); MigrateOldDefault(BigBangEnemyDamage, 150, 125); MigrateOldDefault(GluttonEatRadius, 2.5f, 2.25f); MigrateOldDefault(GluttonMaxSwallowed, 12, 8); MigrateOldDefault(GluttonHpPerPoint, 25, 10); MigrateOldDefault(GluttonDamagePerPoint, 4, 1); MigrateOldDefault(GluttonMassPerPoint, 0.6f, 0.4f); MigrateOldDefault(AlphaHuntSeconds, 12f, 9f); MigrateOldDefault(BelladonnaCargoCount, 4, 3); MigrateOldDefault(BelladonnaCargoRadius, 10f, 9f); MigrateOldDefault(BelladonnaCargoLaunchInterval, 0.18f, 0.25f); MigrateOldDefault(BelladonnaCargoImpactMultiplier, 6f, 4f); MigrateOldDefault(BelladonnaAttackDamage, 60, 35); MigrateOldDefault(BelladonnaAngerSpeedMultiplier, 2.5f, 1.75f); MigrateOldDefault(BelladonnaMemoryMultiplier, 2f, 1.5f); MigrateOldDefault(FlambeGrenadeSpeed, 5f, 4.5f); MigrateOldDefault(FlambeGrenadeFuse, 3f, 3.5f); MigrateOldDefault(RedlineSpeedMultiplier, 1.75f, 1.5f); MigrateOldDefault(RedlineWakeInterval, 4.5f, 5.5f); MigrateOldDefault(RedlineWakeSize, 0.8f, 0.7f); MigrateOldDefault(RedlineWakeDamage, 42, 32); MigrateOldDefault(SingularityPullRadius, 9f, 8f); MigrateOldDefault(SingularityPullForce, 16f, 12f); MigrateOldDefault(SingularityOrbitForce, 11f, 9f); MigrateOldDefault(SingularityLaunchForce, 18f, 14f); MigrateOldDefault(SingularityImpactMultiplier, 7f, 5f); MigrateOldDefault(FaultlineEruptionCount, 4, 3); MigrateOldDefault(FaultlineEruptionSpacing, 2.1f, 2f); MigrateOldDefault(FaultlineEruptionDelay, 0.8f, 1.1f); MigrateOldDefault(FaultlineEruptionSize, 0.75f, 0.65f); MigrateOldDefault(FaultlineEruptionDamage, 32, 22); MigrateOldDefault(KaleidoscopeVolleyInterval, 2.4f, 3f); MigrateOldDefault(KaleidoscopeWarningSeconds, 0.65f, 0.9f); MigrateOldDefault(KaleidoscopeBlastSize, 0.6f, 0.55f); MigrateOldDefault(KaleidoscopeBlastDamage, 28, 22); MigrateOldDefault(HouseEdgeBlastCount, 4, 3); MigrateOldDefault(HouseEdgeRingRadius, 12f, 10f); MigrateOldDefault(HouseEdgeWarningSeconds, 0.8f, 1.1f); MigrateOldDefault(HouseEdgeStepDelay, 0.11f, 0.16f); MigrateOldDefault(HouseEdgeBlastSize, 0.45f, 0.6f); MigrateOldDefault(HouseEdgeBlastDamage, 40, 30); MigrateOldDefault(ResonanceMarkRadius, 16f, 13f); MigrateOldDefault(ResonanceCountdown, 3f, 3.6f); MigrateOldDefault(ResonanceRequiredStillness, 0.75f, 0.55f); MigrateOldDefault(ResonanceDamage, 45, 32); MigrateOldDefault(ContagionInfectRadius, 9f, 8f); MigrateOldDefault(ContagionInfectCount, 3, 2); MigrateOldDefault(ContagionTrapSize, 0.9f, 0.75f); MigrateOldDefault(ContagionTrapDamage, 35, 22); MigrateOldDefault(BloodBankHealRadius, 9f, 8f); MigrateOldDefault(BloodBankHealMultiplier, 0.6f, 0.4f); MigrateOldDefault(BloodBankMaxHealPerPulse, 20, 12); MigrateOldDefault(BloodBankDamageResistance, 0.35f, 0.2f); MigrateOldDefault(BloodBankShieldSeconds, 4.5f, 3f); MigrateOldDefault(RailgunSpeedMultiplier, 1.65f, 1.45f); MigrateOldDefault(RailgunImpactMultiplier, 8f, 6f); MigrateOldDefault(RailgunChargeSeconds, 3f, 2.6f); MigrateOldDefault(BlackoutRadius, 14f, 12f); MigrateOldDefault(BlackoutLightMultiplier, 0.08f, 0.15f); MigrateOldDefault(BlackoutRefreshInterval, 0.45f, 0.5f); MigrateOldDefault(BlackoutSpeedMultiplier, 1.55f, 1.35f); MigrateOldDefault(NecromancerRecallRadius, 18f, 15f); MigrateOldDefault(NecromancerRecallCountdown, 5.5f, 6f); MigrateOldDefault(NecromancerLineBreakSeconds, 1.25f, 1f); MigrateOldDefault(NecromancerRecallDamage, 32, 25); MigrateOldDefault(NecromancerPullForce, 18f, 14f); MigrateOldDefault(HeartbreakMarkRadius, 14f, 12f); MigrateOldDefault(HeartbreakLinkSeconds, 8f, 9f); MigrateOldDefault(HeartbreakBreakDistance, 1.6f, 1.8f); MigrateOldDefault(HeartbreakContactSeconds, 1.1f, 0.8f); MigrateOldDefault(HeartbreakPulseSeconds, 1.35f, 1.8f); MigrateOldDefault(HeartbreakPulseDamage, 8, 5); MigrateOldDefault(HeartbreakSnapDamage, 35, 25); MigrateOldDefault(HeartbreakPullForce, 7.5f, 5.5f); MigrateOldDefault(DeathlightCaptureRange, 24f, 20f); MigrateOldDefault(DeathlightConeAngle, 34f, 30f); MigrateOldDefault(DeathlightRewindSeconds, 4.5f, 5f); MigrateOldDefault(DeathlightBreakSightSeconds, 1.1f, 0.8f); MigrateOldDefault(DeathlightRewindDamage, 26, 20); MigrateOldDefault(DeathlightRecaptureCooldown, 6f, 8f); MigrateOldDefault(AftershockCorridorLength, 12f, 10f); MigrateOldDefault(AftershockStartWidth, 9f, 8f); MigrateOldDefault(AftershockCloseSeconds, 2.1f, 2.6f); MigrateOldDefault(AftershockClapDamage, 45, 35); MigrateOldDefault(AftershockGrabDisableSeconds, 1.4f, 1f); MigrateOldDefault(ParallaxGateWarningSeconds, 0.65f, 1f); MigrateOldDefault(ParallaxGateDuration, 12f, 10f); MigrateOldDefault(ParallaxGateRadius, 1.5f, 1.25f); MigrateOldDefault(ParallaxGateDamage, 12, 8); MigrateOldDefault(ParallaxExitImpulse, 10f, 8f); MutationBalanceRevision.Value = 1; ((BaseUnityPlugin)this).Config.SaveOnConfigSet = saveOnConfigSet; ((BaseUnityPlugin)this).Config.Save(); Log.LogDebug((object)"Processed legacy balance revision 1 compatibility values."); } } private void MigrateBalanceRevision2() { if (MutationBalanceRevision.Value < 2) { bool saveOnConfigSet = ((BaseUnityPlugin)this).Config.SaveOnConfigSet; ((BaseUnityPlugin)this).Config.SaveOnConfigSet = false; MigrateOldDefault(MutationHealthMultiplier, 1.65f, 2f); MigrateOldDefault(MutationHealthBonusPerLevel, 0.03f, 0.05f); MigrateOldDefault(MutationMaxHealthMultiplier, 2.5f, 3.5f); MigrateOldDefault(BoomdayFuseRange, 4f, 5f); MigrateOldDefault(BoomdayFuseTime, 2.75f, 2.25f); MigrateOldDefault(BoomdayExplodeCooldown, 5.5f, 3.5f); MigrateOldDefault(BoomdayCoreDamage, 35, 55); MigrateOldDefault(BoomdayBalloonDamage, 15, 30); MigrateOldDefault(BoomdayBalloonTouchRadius, 1.15f, 1.5f); MigrateOldDefault(PoltergeistRange, 8f, 11f); MigrateOldDefault(PoltergeistPlayerFloatInterval, 1.15f, 0.8f); MigrateOldDefault(PoltergeistPlayerFloatForce, 6f, 10f); MigrateOldDefault(PoltergeistThrowInterval, 2f, 1.2f); MigrateOldDefault(PoltergeistInversionInterval, 10f, 6.5f); MigrateOldDefault(PoltergeistInversionSeconds, 1.1f, 1.6f); MigrateOldDefault(PoltergeistSlamForce, 18f, 30f); MigrateOldDefault(MeltdownFastSpeed, 1.75f, 2f); MigrateOldDefault(MeltdownHomingForce, 9f, 12f); MigrateOldDefault(MeltdownHeadFlightSeconds, 6.5f, 7f); MigrateOldDefault(MeltdownHeadDamage, 50, 75); MigrateOldDefault(SnatcherDamage, 20, 45); MigrateOldDefault(DeathgazeStareSeconds, 6f, 5.5f); MigrateOldDefault(DeathgazeBeamSeconds, 2.2f, 2.5f); MigrateOldDefault(DeathgazeBeamDamage, 35, 50); MigrateOldDefault(DeathgazeRepeatChargeMultiplier, 0.8f, 0.68f); MigrateOldDefault(DeathgazeMinimumStareSeconds, 2.75f, 2f); MigrateOldDefault(DeadeyeBeamSeconds, 2.5f, 3f); MigrateOldDefault(DeadeyeBeamDamage, 35, 55); MigrateOldDefault(TricksterAttackDamage, 30, 50); MigrateOldDefault(TricksterRedisguiseSeconds, 25f, 20f); MigrateOldDefault(ElsaCountdownSeconds, 4f, 3.5f); MigrateOldDefault(ElsaTransformBlastSize, 0.9f, 1.05f); MigrateOldDefault(ElsaTransformBlastDamage, 35, 60); MigrateOldDefault(BigBangExplosionSize, 1f, 1.2f); MigrateOldDefault(BigBangPlayerDamage, 55, 80); MigrateOldDefault(BigBangEnemyDamage, 125, 150); MigrateOldDefault(GluttonEatRadius, 2.25f, 2.5f); MigrateOldDefault(GluttonMaxSwallowed, 8, 12); MigrateOldDefault(GluttonHpPerPoint, 10, 25); MigrateOldDefault(GluttonDamagePerPoint, 1, 4); MigrateOldDefault(GluttonMassPerPoint, 0.4f, 0.6f); MigrateOldDefault(AlphaHuntSeconds, 9f, 15f); MigrateOldDefault(BelladonnaCargoCount, 3, 4); MigrateOldDefault(BelladonnaCargoRadius, 9f, 10f); MigrateOldDefault(BelladonnaCargoLaunchInterval, 0.25f, 0.18f); MigrateOldDefault(BelladonnaCargoImpactMultiplier, 4f, 6f); MigrateOldDefault(BelladonnaAttackDamage, 35, 60); MigrateOldDefault(BelladonnaAngerSpeedMultiplier, 1.75f, 2.5f); MigrateOldDefault(BelladonnaMemoryMultiplier, 1.5f, 2f); MigrateOldDefault(FlambeGrenadeSpeed, 4.5f, 5f); MigrateOldDefault(FlambeGrenadeFuse, 3.5f, 3f); MigrateOldDefault(RedlineSpeedMultiplier, 1.5f, 1.75f); MigrateOldDefault(RedlineWakeInterval, 5.5f, 4.5f); MigrateOldDefault(RedlineWakeSize, 0.7f, 0.8f); MigrateOldDefault(RedlineWakeDamage, 32, 55); MigrateOldDefault(SingularityPullRadius, 8f, 10f); MigrateOldDefault(SingularityPullForce, 12f, 18f); MigrateOldDefault(SingularityOrbitForce, 9f, 13f); MigrateOldDefault(SingularityLaunchForce, 14f, 20f); MigrateOldDefault(SingularityImpactMultiplier, 5f, 8f); MigrateOldDefault(FaultlineEruptionCount, 3, 4); MigrateOldDefault(FaultlineEruptionSpacing, 2f, 2.1f); MigrateOldDefault(FaultlineEruptionDelay, 1.1f, 0.8f); MigrateOldDefault(FaultlineEruptionSize, 0.65f, 0.75f); MigrateOldDefault(FaultlineEruptionDamage, 22, 40); MigrateOldDefault(FaultlineHitCooldown, 1.75f, 1.25f); MigrateOldDefault(KaleidoscopeVolleyInterval, 3f, 2.4f); MigrateOldDefault(KaleidoscopeWarningSeconds, 0.9f, 0.65f); MigrateOldDefault(KaleidoscopeBlastSize, 0.55f, 0.6f); MigrateOldDefault(KaleidoscopeBlastDamage, 22, 40); MigrateOldDefault(HouseEdgeBlastCount, 3, 4); MigrateOldDefault(HouseEdgeRingRadius, 10f, 12f); MigrateOldDefault(HouseEdgeWarningSeconds, 1.1f, 0.8f); MigrateOldDefault(HouseEdgeStepDelay, 0.16f, 0.11f); MigrateOldDefault(HouseEdgeBlastSize, 0.6f, 0.45f); MigrateOldDefault(HouseEdgeBlastDamage, 30, 55); MigrateOldDefault(ResonanceMarkRadius, 13f, 16f); MigrateOldDefault(ResonanceCountdown, 3.6f, 3f); MigrateOldDefault(ResonanceRequiredStillness, 0.55f, 0.75f); MigrateOldDefault(ResonanceDamage, 32, 55); MigrateOldDefault(ContagionInfectRadius, 8f, 9f); MigrateOldDefault(ContagionInfectCount, 2, 3); MigrateOldDefault(ContagionTrapSize, 0.75f, 0.9f); MigrateOldDefault(ContagionTrapDamage, 22, 50); MigrateOldDefault(BloodBankHealRadius, 8f, 10f); MigrateOldDefault(BloodBankHealMultiplier, 0.4f, 0.75f); MigrateOldDefault(BloodBankMaxHealPerPulse, 12, 25); MigrateOldDefault(BloodBankDamageResistance, 0.2f, 0.45f); MigrateOldDefault(BloodBankShieldSeconds, 3f, 6f); MigrateOldDefault(RailgunSpeedMultiplier, 1.45f, 1.75f); MigrateOldDefault(RailgunImpactMultiplier, 6f, 9f); MigrateOldDefault(RailgunChargeSeconds, 2.6f, 3.5f); MigrateOldDefault(BlackoutRadius, 12f, 16f); MigrateOldDefault(BlackoutLightMultiplier, 0.15f, 0.05f); MigrateOldDefault(BlackoutRefreshInterval, 0.5f, 0.45f); MigrateOldDefault(BlackoutSpeedMultiplier, 1.35f, 1.75f); MigrateOldDefault(NecromancerRecallRadius, 15f, 20f); MigrateOldDefault(NecromancerRecallCountdown, 6f, 5f); MigrateOldDefault(NecromancerLineBreakSeconds, 1f, 1.5f); MigrateOldDefault(NecromancerRecallDamage, 25, 50); MigrateOldDefault(NecromancerPullForce, 14f, 22f); MigrateOldDefault(HeartbreakMarkRadius, 12f, 16f); MigrateOldDefault(HeartbreakLinkSeconds, 9f, 8f); MigrateOldDefault(HeartbreakBreakDistance, 1.8f, 1.6f); MigrateOldDefault(HeartbreakContactSeconds, 0.8f, 1.1f); MigrateOldDefault(HeartbreakPulseSeconds, 1.8f, 1.35f); MigrateOldDefault(HeartbreakPulseDamage, 5, 10); MigrateOldDefault(HeartbreakSnapDamage, 25, 50); MigrateOldDefault(HeartbreakPullForce, 5.5f, 9f); MigrateOldDefault(DeathlightCaptureRange, 20f, 26f); MigrateOldDefault(DeathlightConeAngle, 30f, 38f); MigrateOldDefault(DeathlightRewindSeconds, 5f, 4f); MigrateOldDefault(DeathlightBreakSightSeconds, 0.8f, 1.25f); MigrateOldDefault(DeathlightRewindDamage, 20, 50); MigrateOldDefault(DeathlightRecaptureCooldown, 8f, 5f); MigrateOldDefault(AftershockCorridorLength, 10f, 14f); MigrateOldDefault(AftershockStartWidth, 8f, 10f); MigrateOldDefault(AftershockCloseSeconds, 2.6f, 2.1f); MigrateOldDefault(AftershockClapDamage, 35, 60); MigrateOldDefault(AftershockGrabDisableSeconds, 1f, 1.8f); MigrateOldDefault(ParallaxGateWarningSeconds, 1f, 0.6f); MigrateOldDefault(ParallaxGateDuration, 10f, 15f); MigrateOldDefault(ParallaxGateRadius, 1.25f, 1.75f); MigrateOldDefault(ParallaxGateDamage, 8, 25); MigrateOldDefault(ParallaxExitImpulse, 8f, 12f); MutationBalanceRevision.Value = 2; ((BaseUnityPlugin)this).Config.SaveOnConfigSet = saveOnConfigSet; ((BaseUnityPlugin)this).Config.Save(); Log.LogInfo((object)"Applied balance revision 2: restored strong defaults and raised underperforming mutants; custom values were preserved."); } } private static void MigrateOldDefault(ConfigEntry entry, int oldValue, int newValue) { if (entry.Value == oldValue) { entry.Value = newValue; } } private static void MigrateOldDefault(ConfigEntry entry, float oldValue, float newValue) { if (Mathf.Abs(entry.Value - oldValue) <= 0.0001f) { entry.Value = newValue; } } public static float CurrentHealthMultiplier() { int num = (((Object)(object)RunManager.instance != (Object)null) ? Mathf.Max(0, RunManager.instance.levelsCompleted) : 0); return Mathf.Clamp(MutationHealthMultiplier.Value + (float)num * Mathf.Max(0f, MutationHealthBonusPerLevel.Value), 0.1f, Mathf.Max(0.1f, MutationMaxHealthMultiplier.Value)); } internal static bool IsMutationEnabled(string mutantName) { string text = MutationDisabledMutants?.Value ?? ""; if (string.IsNullOrWhiteSpace(text)) { return true; } string text2 = NormalizeMutantName(mutantName); string[] array = text.Split(new char[4] { ',', ';', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < array.Length; i++) { if (NormalizeMutantName(array[i]) == text2) { return false; } } return true; } private static string NormalizeMutantName(string value) { StringBuilder stringBuilder = new StringBuilder(value.Length); string text = value.Normalize(NormalizationForm.FormD); foreach (char c in text) { if (CharUnicodeInfo.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark && char.IsLetterOrDigit(c)) { stringBuilder.Append(char.ToLowerInvariant(c)); } } return stringBuilder.ToString(); } private void ArmDebugActions() { try { Arm(DebugSpawnBoomdayKey, "Birthday", typeof(EnemyBirthdayBoy), "Boomday Boy"); Arm(DebugSpawnPoltergeistKey, "Floater", typeof(EnemyFloater), "Poltergeist"); Arm(DebugSpawnMeltdownKey, "Bomb", typeof(EnemyBombThrower), "Meltdown Crew"); Arm(DebugSpawnSnatcherKey, "Hidden", typeof(EnemyHidden), "Snatcher"); Arm(DebugSpawnDeathgazeKey, "Peeper", typeof(EnemyCeilingEye), "Deathgaze"); Arm(DebugSpawnDeadeyeKey, "Hunter", typeof(EnemyHunter), "Deadeye"); Arm(DebugSpawnTricksterKey, "Gnome", typeof(EnemyGnome), "Trickster"); Arm(DebugSpawnElsaKey, "Elsa", typeof(EnemyElsa), "Fenrir"); Arm(DebugSpawnBigBangKey, "Bang", typeof(EnemyBang), "Big Bang"); Arm(DebugSpawnStampedeKey, "Animal", typeof(EnemyAnimal), "Glutton"); Arm(DebugSpawnTyrantKey, "Duck", typeof(EnemyDuck), "Alpha"); Arm(DebugSpawnBelladonnaKey, "Tricycle", typeof(EnemyTricycle), "Belladonna"); Arm(DebugSpawnButcherKey, "Tumbler", typeof(EnemyTumbler), "Flambe"); Arm(DebugSpawnRedlineKey, "Runner", typeof(EnemyRunner), "Redline"); Arm(DebugSpawnSingularityKey, "Bowtie", typeof(EnemyBowtie), "Singularity"); Arm(DebugSpawnFaultlineKey, "Slow", typeof(EnemySlowWalker), "Faultline"); Arm(DebugSpawnKaleidoscopeKey, "Beamer", typeof(EnemyBeamer), "Kaleidoscope"); Arm(DebugSpawnHouseEdgeKey, "Spinny", typeof(EnemySpinny), "House Edge"); Arm(DebugSpawnResonanceKey, "Upscream", typeof(EnemyUpscream), "Resonance"); Arm(DebugSpawnBloodBankKey, "Tick", typeof(EnemyTick), "Blood Bank"); Arm(DebugSpawnRailgunKey, "Rugrat", typeof(EnemyValuableThrower), "Railgun"); Arm(DebugSpawnBlackoutKey, "Robe", typeof(EnemyRobe), "Blackout"); Arm(DebugSpawnContagionKey, "SlowMouth", typeof(EnemySlowMouth), "Contagion"); Arm(DebugSpawnNecromancerKey, "Head Grabber", typeof(EnemyHeadGrabber), "Necromancer"); Arm(DebugSpawnHeartbreakKey, "Heart Hugger", typeof(EnemyHeartHugger), "Heartbreak"); Arm(DebugSpawnDeathlightKey, "Oogly", typeof(EnemyOogly), "Deathlight"); Arm(DebugSpawnAftershockKey, "Shadow", typeof(EnemyShadow), "Aftershock"); Arm(DebugSpawnParallaxKey, "Thin Man", typeof(EnemyThinMan), "Parallax"); Log.LogInfo((object)$"[Debug] Input System debug keys armed ({_debugActions.Count})."); } catch (Exception arg) { Log.LogError((object)$"[Debug] ArmDebugActions failed: {arg}"); } static void Arm(ConfigEntry key, string nameContains, Type componentType, string label) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown string text = "/" + ((object)key.Value/*cast due to .constrained prefix*/).ToString().ToLowerInvariant(); InputAction val = new InputAction((string)null, (InputActionType)1, text, (string)null, (string)null, (string)null); val.performed += delegate { DebugSpawn(nameContains, componentType, label); }; val.Enable(); _debugActions.Add(val); } } private void Update() { //IL_0021: 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_0075: 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_00c9: 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_011d: 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_0171: 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_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: 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_0411: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) if (!_updateAlive) { _updateAlive = true; Log.LogInfo((object)"[Debug] Key handler alive (Update loop running)."); } if (Input.GetKeyDown(DebugSpawnBoomdayKey.Value)) { DebugSpawn("Birthday", typeof(EnemyBirthdayBoy), "Boomday Boy"); } if (Input.GetKeyDown(DebugSpawnPoltergeistKey.Value)) { DebugSpawn("Floater", typeof(EnemyFloater), "Poltergeist"); } if (Input.GetKeyDown(DebugSpawnMeltdownKey.Value)) { DebugSpawn("Bomb", typeof(EnemyBombThrower), "Meltdown Crew"); } if (Input.GetKeyDown(DebugSpawnSnatcherKey.Value)) { DebugSpawn("Hidden", typeof(EnemyHidden), "Snatcher"); } if (Input.GetKeyDown(DebugSpawnDeathgazeKey.Value)) { DebugSpawn("Peeper", typeof(EnemyCeilingEye), "Deathgaze"); } if (Input.GetKeyDown(DebugSpawnDeadeyeKey.Value)) { DebugSpawn("Hunter", typeof(EnemyHunter), "Deadeye"); } if (Input.GetKeyDown(DebugSpawnTricksterKey.Value)) { DebugSpawn("Gnome", typeof(EnemyGnome), "Trickster"); } if (Input.GetKeyDown(DebugSpawnElsaKey.Value)) { DebugSpawn("Elsa", typeof(EnemyElsa), "Fenrir"); } if (Input.GetKeyDown(DebugSpawnBigBangKey.Value)) { DebugSpawn("Bang", typeof(EnemyBang), "Big Bang"); } if (Input.GetKeyDown(DebugSpawnStampedeKey.Value)) { DebugSpawn("Animal", typeof(EnemyAnimal), "Glutton"); } if (Input.GetKeyDown(DebugSpawnTyrantKey.Value)) { DebugSpawn("Duck", typeof(EnemyDuck), "Alpha"); } if (Input.GetKeyDown(DebugSpawnBelladonnaKey.Value)) { DebugSpawn("Tricycle", typeof(EnemyTricycle), "Belladonna"); } if (Input.GetKeyDown(DebugSpawnButcherKey.Value)) { DebugSpawn("Tumbler", typeof(EnemyTumbler), "Flambe"); } if (Input.GetKeyDown(DebugSpawnRedlineKey.Value)) { DebugSpawn("Runner", typeof(EnemyRunner), "Redline"); } if (Input.GetKeyDown(DebugSpawnSingularityKey.Value)) { DebugSpawn("Bowtie", typeof(EnemyBowtie), "Singularity"); } if (Input.GetKeyDown(DebugSpawnFaultlineKey.Value)) { DebugSpawn("Slow", typeof(EnemySlowWalker), "Faultline"); } if (Input.GetKeyDown(DebugSpawnKaleidoscopeKey.Value)) { DebugSpawn("Beamer", typeof(EnemyBeamer), "Kaleidoscope"); } if (Input.GetKeyDown(DebugSpawnHouseEdgeKey.Value)) { DebugSpawn("Spinny", typeof(EnemySpinny), "House Edge"); } if (Input.GetKeyDown(DebugSpawnResonanceKey.Value)) { DebugSpawn("Upscream", typeof(EnemyUpscream), "Resonance"); } if (Input.GetKeyDown(DebugSpawnBloodBankKey.Value)) { DebugSpawn("Tick", typeof(EnemyTick), "Blood Bank"); } if (Input.GetKeyDown(DebugSpawnRailgunKey.Value)) { DebugSpawn("Rugrat", typeof(EnemyValuableThrower), "Railgun"); } if (Input.GetKeyDown(DebugSpawnBlackoutKey.Value)) { DebugSpawn("Robe", typeof(EnemyRobe), "Blackout"); } if (Input.GetKeyDown(DebugSpawnContagionKey.Value)) { DebugSpawn("SlowMouth", typeof(EnemySlowMouth), "Contagion"); } if (Input.GetKeyDown(DebugSpawnNecromancerKey.Value)) { DebugSpawn("Head Grabber", typeof(EnemyHeadGrabber), "Necromancer"); } if (Input.GetKeyDown(DebugSpawnHeartbreakKey.Value)) { DebugSpawn("Heart Hugger", typeof(EnemyHeartHugger), "Heartbreak"); } if (Input.GetKeyDown(DebugSpawnDeathlightKey.Value)) { DebugSpawn("Oogly", typeof(EnemyOogly), "Deathlight"); } if (Input.GetKeyDown(DebugSpawnAftershockKey.Value)) { DebugSpawn("Shadow", typeof(EnemyShadow), "Aftershock"); } if (Input.GetKeyDown(DebugSpawnParallaxKey.Value)) { DebugSpawn("Thin Man", typeof(EnemyThinMan), "Parallax"); } } private static void DebugSpawn(string nameContains, Type componentType, string label) { //IL_007f: 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_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_009e: 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_0146: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) try { Log.LogInfo((object)("[Debug] Key pressed → spawning " + label + "...")); if (Time.time - _lastDebugSpawn < 0.25f) { return; } _lastDebugSpawn = Time.time; if (!SemiFunc.IsMasterClientOrSingleplayer()) { Log.LogWarning((object)"[Debug] Spawn is host-only."); return; } Camera main = Camera.main; if ((Object)(object)main == (Object)null) { Log.LogWarning((object)"[Debug] No main camera; are you in a level?"); return; } Vector3 val = ((Component)main).transform.position + ((Component)main).transform.forward * 3f; EnemySetup val2 = FindEnemySetup(nameContains, componentType); if ((Object)(object)val2 == (Object)null) { int num = 0; StringBuilder stringBuilder = new StringBuilder(); foreach (EnemySetup allEnemy in Enemies.AllEnemies) { if (!((Object)(object)allEnemy == (Object)null)) { num++; if (num <= 8) { stringBuilder.Append(((Object)allEnemy).name).Append(", "); } } } Log.LogWarning((object)$"[Debug] {label} base enemy setup not found. AllEnemies={num} [{stringBuilder}]"); } else { ForceFuseUntil = Time.time + 5f; Enemies.SpawnEnemy(val2, val, Quaternion.identity, false); Log.LogInfo((object)$"[Debug] Spawned a {label} at {val}."); } } catch (Exception arg) { Log.LogError((object)$"[Debug] spawn error: {arg}"); } } private static EnemySetup? FindEnemySetup(string nameContains, Type componentType) { foreach (EnemySetup allEnemy in Enemies.AllEnemies) { if ((Object)(object)allEnemy != (Object)null && ((Object)allEnemy).name.IndexOf(nameContains, StringComparison.OrdinalIgnoreCase) >= 0) { return allEnemy; } } foreach (EnemySetup allEnemy2 in Enemies.AllEnemies) { if (allEnemy2?.spawnObjects == null) { continue; } foreach (PrefabRef spawnObject in allEnemy2.spawnObjects) { GameObject val = ((PrefabRef)(object)spawnObject)?.Prefab; if ((Object)(object)val != (Object)null && (Object)(object)val.GetComponentInChildren(componentType, true) != (Object)null) { return allEnemy2; } } } return null; } internal static void SpawnTricksterPair(Vector3 position) { //IL_004d: 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_005f: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ca: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } try { EnemySetup val = FindEnemySetup("Gnome", typeof(EnemyGnome)); if (val?.spawnObjects == null || val.spawnObjects.Count == 0) { Log.LogWarning((object)"[Trickster] Cannot split: Gnome setup was not found."); return; } Vector3 val2 = Vector3.Cross(Vector3.up, ((Object)(object)Camera.main != (Object)null) ? ((Component)Camera.main).transform.forward : Vector3.forward); Vector3 val3 = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref val3)).sqrMagnitude < 0.01f) { val3 = Vector3.right; } for (int i = 0; i < 2; i++) { EnemySetup obj = ScriptableObject.CreateInstance(); ((Object)obj).name = "MatsuTricksterSplit"; obj.spawnObjects = val.spawnObjects.GetRange(i % val.spawnObjects.Count, 1); Vector3 val4 = position + val3 * ((i == 0) ? (-0.45f) : 0.45f); Enemies.SpawnEnemy(obj, val4, Quaternion.identity, false); Object.Destroy((Object)(object)obj); } } catch (Exception arg) { Log.LogError((object)$"[Trickster] pair spawn error: {arg}"); } } public static SemiLaser? GetClownLaserPrefab() { if (_clownLaserSearched) { return _clownLaserPrefab; } _clownLaserSearched = true; try { EnemySetup val = FindEnemySetup("Beamer", typeof(EnemyBeamer)); if (val?.spawnObjects != null) { foreach (PrefabRef spawnObject in val.spawnObjects) { GameObject val2 = ((PrefabRef)(object)spawnObject)?.Prefab; EnemyBeamer val3 = (((Object)(object)val2 != (Object)null) ? val2.GetComponentInChildren(true) : null); if ((Object)(object)val3 != (Object)null && (Object)(object)val3.laser != (Object)null) { _clownLaserPrefab = val3.laser; break; } } } if ((Object)(object)_clownLaserPrefab == (Object)null) { Log.LogWarning((object)"[Deathgaze] Could not find the Clown/Beamer laser prefab; beams disabled."); } } catch (Exception arg) { Log.LogError((object)$"[Deathgaze] laser prefab lookup error: {arg}"); } return _clownLaserPrefab; } public static Item? GetGrenadeItem() { if (_grenadeSearched) { return _grenadeItem; } _grenadeSearched = true; try { Item val = null; foreach (Item allItem in Items.AllItems) { if ((Object)(object)allItem == (Object)null || allItem.prefab == null || (Object)(object)((PrefabRef)(object)allItem.prefab).Prefab == (Object)null) { continue; } string text = ((Object)allItem).name + " " + allItem.itemName; if (text.IndexOf("grenade", StringComparison.OrdinalIgnoreCase) >= 0 && !((Object)(object)((PrefabRef)(object)allItem.prefab).Prefab.GetComponentInChildren(true) == (Object)null)) { if (!IsVariant(text)) { _grenadeItem = allItem; break; } if (val == null) { val = allItem; } } } if (_grenadeItem == null) { _grenadeItem = val; } Log.LogInfo((object)("[Flambe] grenade item = " + (((Object)(object)_grenadeItem != (Object)null) ? ((Object)_grenadeItem).name : "NOT FOUND") + ".")); } catch (Exception arg) { Log.LogError((object)$"[Flambe] grenade item lookup error: {arg}"); } return _grenadeItem; static bool IsVariant(string n) { n = n.ToLowerInvariant(); if (!n.Contains("human") && !n.Contains("stun") && !n.Contains("duct") && !n.Contains("rubber") && !n.Contains("sticky")) { return n.Contains("shock"); } return true; } } public static void SpawnPackBanger(Vector3 pos) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) try { if (SemiFunc.IsMasterClientOrSingleplayer()) { if (_bangSetup == null) { _bangSetup = FindEnemySetup("Bang", typeof(EnemyBang)); } if ((Object)(object)_bangSetup == (Object)null) { Log.LogWarning((object)"[BigBang] Banger enemy setup not found."); return; } BangForceUntil = Time.time + 3f; Enemies.SpawnEnemy(_bangSetup, pos, Quaternion.identity, false); } } catch (Exception arg) { Log.LogError((object)$"[BigBang] spawn error: {arg}"); } } public static SemiLaser? GetPhotonBlasterLaserPrefab() { if (_blasterLaserSearched) { return _blasterLaserPrefab; } _blasterLaserSearched = true; try { foreach (Item allItem in Items.AllItems) { GameObject val = (((Object)(object)allItem != (Object)null && allItem.prefab != null) ? ((PrefabRef)(object)allItem.prefab).Prefab : null); if (!((Object)(object)val == (Object)null)) { ItemGunLaser componentInChildren = val.GetComponentInChildren(true); if ((Object)(object)componentInChildren != (Object)null && (Object)(object)componentInChildren.semiLaser != (Object)null) { _blasterLaserPrefab = componentInChildren.semiLaser; break; } } } if ((Object)(object)_blasterLaserPrefab == (Object)null) { Log.LogWarning((object)"[Deadeye] Could not find the Photon Blaster laser; falling back to the Clown laser."); } } catch (Exception arg) { Log.LogError((object)$"[Deadeye] blaster laser lookup error: {arg}"); } return _blasterLaserPrefab ?? GetClownLaserPrefab(); } public static PrefabRef? GetMeltdownHeadPrefabRef() { if (_meltdownHeadBuilt) { return _meltdownHeadRef; } PrefabRef meltdownHeadRef = default(PrefabRef); if (NetworkPrefabs.TryGetNetworkPrefabRef("Matsu/MeltdownExtraHead", ref meltdownHeadRef)) { _meltdownHeadBuilt = true; _meltdownHeadRef = meltdownHeadRef; return _meltdownHeadRef; } _meltdownHeadBuilt = true; try { EnemySetup val = FindEnemySetup("Bomb", typeof(EnemyBombThrower)); GameObject val2 = null; if (val?.spawnObjects != null) { foreach (PrefabRef spawnObject in val.spawnObjects) { GameObject val3 = ((PrefabRef)(object)spawnObject)?.Prefab; EnemyBombThrower val4 = (((Object)(object)val3 != (Object)null) ? val3.GetComponentInChildren(true) : null); if ((Object)(object)val4 != (Object)null && (Object)(object)val4.head != (Object)null) { val2 = ((Component)val4.head).gameObject; break; } } } if ((Object)(object)val2 == (Object)null) { Log.LogWarning((object)"[MeltdownCrew] head prefab not found; extra heads disabled."); return null; } GameObject val5 = Object.Instantiate(val2); ((Object)val5).name = "MatsuMeltdownExtraHead"; Object.DontDestroyOnLoad((Object)(object)val5); val5.SetActive(false); EnemyBombThrowerHead component = val5.GetComponent(); if ((Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); } val5.AddComponent(); _meltdownHeadRef = NetworkPrefabs.RegisterNetworkPrefab("Matsu/MeltdownExtraHead", val5); if (_meltdownHeadRef == null) { Log.LogWarning((object)"[MeltdownCrew] RegisterNetworkPrefab returned null; extra heads disabled."); } else { Log.LogInfo((object)"[MeltdownCrew] Registered the extra-head network prefab."); } } catch (Exception arg) { Log.LogError((object)$"[MeltdownCrew] head prefab build error: {arg}"); } return _meltdownHeadRef; } public static void SpawnMeltdownHead(Vector3 pos, Quaternion rot, Vector3 forward, float factor) { //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_006c: 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) try { PrefabRef meltdownHeadPrefabRef = GetMeltdownHeadPrefabRef(); if (meltdownHeadPrefabRef == null) { Log.LogWarning((object)"[MeltdownCrew] no head prefab ref; skipping spawn."); return; } GameObject val = NetworkPrefabs.SpawnNetworkPrefab(meltdownHeadPrefabRef, pos, rot, (byte)0, (object[])null); if ((Object)(object)val == (Object)null) { Log.LogWarning((object)"[MeltdownCrew] SpawnNetworkPrefab returned null."); return; } val.SetActive(true); MeltdownExtraHead component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Log.LogWarning((object)"[MeltdownCrew] spawned head has no driver component."); return; } component.Launch(factor, forward); Log.LogInfo((object)$"[MeltdownCrew] spawned extra head (factor {factor}, active={val.activeSelf}) at {pos}."); } catch (Exception arg) { Log.LogError((object)$"[MeltdownCrew] spawn head error: {arg}"); } } public void StartBalloonChain(List balloons, int damage, GameObject? popEffect, PhotonView? pv) { if (balloons != null && balloons.Count != 0 && SemiFunc.IsMasterClientOrSingleplayer()) { ((MonoBehaviour)this).StartCoroutine(BalloonChainRoutine(balloons, damage, popEffect, pv)); } } private IEnumerator BalloonChainRoutine(List balloons, int damage, GameObject? popEffect, PhotonView? pv) { foreach (GameObject balloon in balloons) { if ((Object)(object)balloon != (Object)null) { Vector3 position = balloon.transform.position; if (SemiFunc.IsMultiplayer() && (Object)(object)pv != (Object)null) { pv.RPC("BoomdayExplodeRPC", (RpcTarget)0, new object[3] { position, 0.7f, damage }); if ((Object)(object)popEffect != (Object)null) { pv.RPC("BoomdayVfxRPC", (RpcTarget)0, new object[1] { position }); } } else { FusionShared.ExplodeAuthoritative(position, 0.7f, damage, 0); if ((Object)(object)popEffect != (Object)null) { Object.Instantiate(popEffect, position, Quaternion.identity); } } Object.Destroy((Object)(object)balloon); } yield return (object)new WaitForSeconds(0.1f); } } } [HarmonyPatch(typeof(EnemyParent), "SpawnRPC")] internal static class EnemyParent_SpawnRPC_Patch { private static void Postfix(EnemyParent __instance) { MutationAttach.TryAttach(__instance); } } internal static class MutationAttach { private sealed class RollState { internal readonly uint Salt; internal readonly Dictionary MutatedIds = new Dictionary(); internal int Level = -1; internal RollState(uint salt) { Salt = salt; } } private static readonly RollState _boomday = new RollState(2952908801u); private static readonly RollState _poltergeist = new RollState(1343741953u); private static readonly RollState _cleanup = new RollState(3253338113u); private static readonly RollState _snatcher = new RollState(1518075905u); private static readonly RollState _deathgaze = new RollState(3735486465u); private static readonly RollState _deadeye = new RollState(3735879681u); private static readonly RollState _trickster = new RollState(2048655361u); private static readonly RollState _elsa = new RollState(4271964161u); private static readonly RollState _bang = new RollState(3131441153u); private static readonly RollState _animal = new RollState(1627848705u); private static readonly RollState _duck = new RollState(2717515777u); private static readonly RollState _tricycle = new RollState(3188785153u); private static readonly RollState _tumbler = new RollState(4054515713u); private static readonly RollState _runner = new RollState(2932932609u); private static readonly RollState _bowtie = new RollState(2963738625u); private static readonly RollState _slowWalker = new RollState(4194398209u); private static readonly RollState _beamer = new RollState(3390967809u); private static readonly RollState _spinny = new RollState(3983409153u); private static readonly RollState _upscream = new RollState(2924478465u); private static readonly RollState _tick = new RollState(2969620481u); private static readonly RollState _valuableThrower = new RollState(2853240833u); private static readonly RollState _robe = new RollState(2980839425u); private static readonly RollState _slowMouth = new RollState(3222775297u); private static readonly RollState _headGrabber = new RollState(1324089345u); private static readonly RollState _heartHugger = new RollState(1319567361u); private static readonly RollState _oogly = new RollState(12705793u); private static readonly RollState _shadow = new RollState(1521287169u); private static readonly RollState _thinMan = new RollState(2048524289u); private static int _surgeLoggedLevel = -1; private static int _mutDiag; public static void TryAttach(EnemyParent __instance) { //IL_049a: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)__instance == (Object)null) { return; } bool flag = Time.time <= Plugin.ForceFuseUntil; int key = EnemyId(__instance); EnemyBirthdayBoy componentInChildren = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { float chance = (flag ? 1f : GetMutationChance(_boomday)); bool value; bool flag2 = _boomday.MutatedIds.TryGetValue(key, out value) && value; bool flag3 = flag || Plugin.IsMutationEnabled("Boomday Boy"); if ((Object)(object)((Component)componentInChildren).GetComponent() == (Object)null && flag3 && (flag2 || ShouldMutate(__instance, chance, _boomday.Salt))) { ((Component)componentInChildren).gameObject.AddComponent(); SetMutationName(__instance, "Boomday Boy"); _boomday.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[BoomdayBoy] A Birthday Boy became a Boomday Boy."); } return; } EnemyFloater componentInChildren2 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null) { float chance2 = (flag ? 1f : GetMutationChance(_poltergeist)); bool value2; bool flag4 = _poltergeist.MutatedIds.TryGetValue(key, out value2) && value2; bool flag5 = flag || Plugin.IsMutationEnabled("Poltergeist"); if ((Object)(object)((Component)componentInChildren2).GetComponent() == (Object)null && flag5 && (flag4 || ShouldMutate(__instance, chance2, _poltergeist.Salt))) { ((Component)componentInChildren2).gameObject.AddComponent(); SetMutationName(__instance, "Poltergeist"); _poltergeist.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Poltergeist] A Mentalist mutated into a Poltergeist."); } return; } EnemyBombThrower componentInChildren3 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren3 != (Object)null) { float chance3 = (flag ? 1f : GetMutationChance(_cleanup)); bool value3; bool flag6 = _cleanup.MutatedIds.TryGetValue(key, out value3) && value3; bool flag7 = flag || Plugin.IsMutationEnabled("Meltdown Crew"); if ((Object)(object)((Component)componentInChildren3).GetComponent() == (Object)null && flag7 && (flag6 || ShouldMutate(__instance, chance3, _cleanup.Salt))) { ((Component)componentInChildren3).gameObject.AddComponent(); SetMutationName(__instance, "Meltdown Crew"); _cleanup.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[MeltdownCrew] A Cleanup Crew mutated into a Meltdown Crew."); } return; } EnemyHidden componentInChildren4 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren4 != (Object)null) { float chance4 = (flag ? 1f : GetMutationChance(_snatcher)); bool value4; bool flag8 = _snatcher.MutatedIds.TryGetValue(key, out value4) && value4; bool flag9 = flag || Plugin.IsMutationEnabled("Snatcher"); if ((Object)(object)((Component)componentInChildren4).GetComponent() == (Object)null && flag9 && (flag8 || ShouldMutate(__instance, chance4, _snatcher.Salt))) { ((Component)componentInChildren4).gameObject.AddComponent(); SetMutationName(__instance, "Snatcher"); _snatcher.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Snatcher] A Hidden mutated into a Snatcher."); } return; } EnemyCeilingEye componentInChildren5 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren5 != (Object)null) { float chance5 = (flag ? 1f : GetMutationChance(_deathgaze)); bool value5; bool flag10 = _deathgaze.MutatedIds.TryGetValue(key, out value5) && value5; bool flag11 = flag || Plugin.IsMutationEnabled("Deathgaze"); if ((Object)(object)((Component)componentInChildren5).GetComponent() == (Object)null && flag11 && (flag10 || ShouldMutate(__instance, chance5, _deathgaze.Salt))) { ((Component)componentInChildren5).gameObject.AddComponent(); SetMutationName(__instance, "Deathgaze"); _deathgaze.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Deathgaze] A Peeper mutated into a Deathgaze."); } return; } EnemyHunter componentInChildren6 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren6 != (Object)null) { float chance6 = (flag ? 1f : GetMutationChance(_deadeye)); bool value6; bool flag12 = _deadeye.MutatedIds.TryGetValue(key, out value6) && value6; bool flag13 = flag || Plugin.IsMutationEnabled("Deadeye"); if ((Object)(object)((Component)componentInChildren6).GetComponent() == (Object)null && flag13 && (flag12 || ShouldMutate(__instance, chance6, _deadeye.Salt))) { ((Component)componentInChildren6).gameObject.AddComponent(); SetMutationName(__instance, "Deadeye"); _deadeye.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Deadeye] A Huntsman mutated into a Deadeye."); } return; } EnemyGnome componentInChildren7 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren7 != (Object)null) { bool flag14 = TricksterFusion.ConsumeSplitSpawn(((Component)__instance).transform.position); EnemyParent instance = GnomeGroupAnchor(componentInChildren7) ?? __instance; int key2 = EnemyId(instance); float chance7 = (flag ? 1f : GetMutationChance(_trickster)); bool value7; bool flag15 = _trickster.MutatedIds.TryGetValue(key2, out value7) && value7; bool flag16 = flag14 || flag || Plugin.IsMutationEnabled("Trickster"); if ((Object)(object)((Component)componentInChildren7).GetComponent() == (Object)null && flag16 && (flag14 || flag15 || ShouldMutate(instance, chance7, _trickster.Salt))) { ((Component)componentInChildren7).gameObject.AddComponent(); if (flag14 && (Object)(object)((Component)componentInChildren7).GetComponent() == (Object)null) { ((Component)componentInChildren7).gameObject.AddComponent(); } SetMutationName(__instance, "Trickster"); _trickster.MutatedIds[key2] = true; Plugin.Log.LogInfo((object)("[Trickster] A four-Gnome group mutated into Tricksters" + (flag14 ? " (split child)" : "") + ".")); } return; } EnemyBang componentInChildren8 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren8 != (Object)null) { bool flag17 = !flag && Time.time <= Plugin.BangForceUntil; bool num = flag || flag17; float chance8 = (num ? 1f : GetMutationChance(_bang)); bool value8; bool flag18 = _bang.MutatedIds.TryGetValue(key, out value8) && value8; bool flag19 = num || Plugin.IsMutationEnabled("Big Bang"); if ((Object)(object)((Component)componentInChildren8).GetComponent() == (Object)null && flag19 && (flag18 || ShouldMutate(__instance, chance8, _bang.Salt))) { ((Component)componentInChildren8).gameObject.AddComponent(); if (flag17) { ((Component)componentInChildren8).gameObject.AddComponent(); } SetMutationName(__instance, "Big Bang"); _bang.MutatedIds[key] = true; Plugin.Log.LogInfo((object)("[BigBang] A Banger mutated into a Big Bang" + (flag17 ? " (squad member)" : "") + ".")); } return; } EnemyAnimal componentInChildren9 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren9 != (Object)null) { float chance9 = (flag ? 1f : GetMutationChance(_animal)); bool value9; bool flag20 = _animal.MutatedIds.TryGetValue(key, out value9) && value9; bool flag21 = flag || Plugin.IsMutationEnabled("Glutton"); if ((Object)(object)((Component)componentInChildren9).GetComponent() == (Object)null && flag21 && (flag20 || ShouldMutate(__instance, chance9, _animal.Salt))) { ((Component)componentInChildren9).gameObject.AddComponent(); SetMutationName(__instance, "Glutton"); _animal.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Glutton] An Animal mutated into a Glutton."); } return; } EnemyDuck componentInChildren10 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren10 != (Object)null) { float chance10 = (flag ? 1f : GetMutationChance(_duck)); bool value10; bool flag22 = _duck.MutatedIds.TryGetValue(key, out value10) && value10; bool flag23 = flag || Plugin.IsMutationEnabled("Alpha"); if ((Object)(object)((Component)componentInChildren10).GetComponent() == (Object)null && flag23 && (flag22 || ShouldMutate(__instance, chance10, _duck.Salt))) { ((Component)componentInChildren10).gameObject.AddComponent(); SetMutationName(__instance, "Alpha"); _duck.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Alpha] An Apex Predator mutated into an Alpha."); } return; } EnemyTricycle componentInChildren11 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren11 != (Object)null) { float chance11 = (flag ? 1f : GetMutationChance(_tricycle)); bool value11; bool flag24 = _tricycle.MutatedIds.TryGetValue(key, out value11) && value11; bool flag25 = flag || Plugin.IsMutationEnabled("Belladonna"); if ((Object)(object)((Component)componentInChildren11).GetComponent() == (Object)null && flag25 && (flag24 || ShouldMutate(__instance, chance11, _tricycle.Salt))) { ((Component)componentInChildren11).gameObject.AddComponent(); SetMutationName(__instance, "Belladonna"); _tricycle.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Belladonna] A Bella mutated into a Belladonna."); } return; } EnemyTumbler componentInChildren12 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren12 != (Object)null) { float chance12 = (flag ? 1f : GetMutationChance(_tumbler)); bool value12; bool flag26 = _tumbler.MutatedIds.TryGetValue(key, out value12) && value12; bool flag27 = flag || Plugin.IsMutationEnabled("Flambe"); if ((Object)(object)((Component)componentInChildren12).GetComponent() == (Object)null && flag27 && (flag26 || ShouldMutate(__instance, chance12, _tumbler.Salt))) { ((Component)componentInChildren12).gameObject.AddComponent(); SetMutationName(__instance, "Flambe"); _tumbler.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Flambe] A Chef mutated into a Flambe."); } return; } EnemyRunner componentInChildren13 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren13 != (Object)null) { float chance13 = (flag ? 1f : GetMutationChance(_runner)); bool value13; bool flag28 = _runner.MutatedIds.TryGetValue(key, out value13) && value13; bool flag29 = flag || Plugin.IsMutationEnabled("Redline"); if ((Object)(object)((Component)componentInChildren13).GetComponent() == (Object)null && flag29 && (flag28 || ShouldMutate(__instance, chance13, _runner.Salt))) { ((Component)componentInChildren13).gameObject.AddComponent(); SetMutationName(__instance, "Redline"); _runner.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Redline] A Reaper mutated into a Redline."); } return; } EnemyBowtie componentInChildren14 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren14 != (Object)null) { float chance14 = (flag ? 1f : GetMutationChance(_bowtie)); bool value14; bool flag30 = _bowtie.MutatedIds.TryGetValue(key, out value14) && value14; bool flag31 = flag || Plugin.IsMutationEnabled("Singularity"); if ((Object)(object)((Component)componentInChildren14).GetComponent() == (Object)null && flag31 && (flag30 || ShouldMutate(__instance, chance14, _bowtie.Salt))) { ((Component)componentInChildren14).gameObject.AddComponent(); SetMutationName(__instance, "Singularity"); _bowtie.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Singularity] A Bowtie mutated into a Singularity."); } return; } EnemySlowWalker componentInChildren15 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren15 != (Object)null) { float chance15 = (flag ? 1f : GetMutationChance(_slowWalker)); bool value15; bool flag32 = _slowWalker.MutatedIds.TryGetValue(key, out value15) && value15; bool flag33 = flag || Plugin.IsMutationEnabled("Faultline"); if ((Object)(object)((Component)componentInChildren15).GetComponent() == (Object)null && flag33 && (flag32 || ShouldMutate(__instance, chance15, _slowWalker.Salt))) { ((Component)componentInChildren15).gameObject.AddComponent(); SetMutationName(__instance, "Faultline"); _slowWalker.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Faultline] A Headman mutated into a Faultline."); } return; } EnemyBeamer componentInChildren16 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren16 != (Object)null) { float chance16 = (flag ? 1f : GetMutationChance(_beamer)); bool value16; bool flag34 = _beamer.MutatedIds.TryGetValue(key, out value16) && value16; bool flag35 = flag || Plugin.IsMutationEnabled("Kaleidoscope"); if ((Object)(object)((Component)componentInChildren16).GetComponent() == (Object)null && flag35 && (flag34 || ShouldMutate(__instance, chance16, _beamer.Salt))) { ((Component)componentInChildren16).gameObject.AddComponent(); SetMutationName(__instance, "Kaleidoscope"); _beamer.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Kaleidoscope] A Clown mutated into a Kaleidoscope."); } return; } EnemySpinny componentInChildren17 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren17 != (Object)null) { float chance17 = (flag ? 1f : GetMutationChance(_spinny)); bool value17; bool flag36 = _spinny.MutatedIds.TryGetValue(key, out value17) && value17; bool flag37 = flag || Plugin.IsMutationEnabled("House Edge"); if ((Object)(object)((Component)componentInChildren17).GetComponent() == (Object)null && flag37 && (flag36 || ShouldMutate(__instance, chance17, _spinny.Salt))) { ((Component)componentInChildren17).gameObject.AddComponent(); SetMutationName(__instance, "House Edge"); _spinny.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[HouseEdge] A Gambit mutated into the House Edge."); } return; } EnemyUpscream componentInChildren18 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren18 != (Object)null) { float chance18 = (flag ? 1f : GetMutationChance(_upscream)); bool value18; bool flag38 = _upscream.MutatedIds.TryGetValue(key, out value18) && value18; bool flag39 = flag || Plugin.IsMutationEnabled("Resonance"); if ((Object)(object)((Component)componentInChildren18).GetComponent() == (Object)null && flag39 && (flag38 || ShouldMutate(__instance, chance18, _upscream.Salt))) { ((Component)componentInChildren18).gameObject.AddComponent(); SetMutationName(__instance, "Resonance"); _upscream.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Resonance] An Upscream mutated into Resonance."); } return; } EnemyTick componentInChildren19 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren19 != (Object)null) { float chance19 = (flag ? 1f : GetMutationChance(_tick)); bool value19; bool flag40 = _tick.MutatedIds.TryGetValue(key, out value19) && value19; bool flag41 = flag || Plugin.IsMutationEnabled("Blood Bank"); if ((Object)(object)((Component)componentInChildren19).GetComponent() == (Object)null && flag41 && (flag40 || ShouldMutate(__instance, chance19, _tick.Salt))) { ((Component)componentInChildren19).gameObject.AddComponent(); SetMutationName(__instance, "Blood Bank"); _tick.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[BloodBank] A Tick mutated into a Blood Bank."); } return; } EnemyValuableThrower componentInChildren20 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren20 != (Object)null) { float chance20 = (flag ? 1f : GetMutationChance(_valuableThrower)); bool value20; bool flag42 = _valuableThrower.MutatedIds.TryGetValue(key, out value20) && value20; bool flag43 = flag || Plugin.IsMutationEnabled("Railgun"); if ((Object)(object)((Component)componentInChildren20).GetComponent() == (Object)null && flag43 && (flag42 || ShouldMutate(__instance, chance20, _valuableThrower.Salt))) { ((Component)componentInChildren20).gameObject.AddComponent(); SetMutationName(__instance, "Railgun"); _valuableThrower.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Railgun] A Rugrat mutated into a Railgun."); } return; } EnemyRobe componentInChildren21 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren21 != (Object)null) { float chance21 = (flag ? 1f : GetMutationChance(_robe)); bool value21; bool flag44 = _robe.MutatedIds.TryGetValue(key, out value21) && value21; bool flag45 = flag || Plugin.IsMutationEnabled("Blackout"); if ((Object)(object)((Component)componentInChildren21).GetComponent() == (Object)null && flag45 && (flag44 || ShouldMutate(__instance, chance21, _robe.Salt))) { ((Component)componentInChildren21).gameObject.AddComponent(); SetMutationName(__instance, "Blackout"); _robe.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Blackout] A Robe mutated into a Blackout."); } return; } EnemySlowMouth componentInChildren22 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren22 != (Object)null) { float chance22 = (flag ? 1f : GetMutationChance(_slowMouth)); bool value22; bool flag46 = _slowMouth.MutatedIds.TryGetValue(key, out value22) && value22; bool flag47 = flag || Plugin.IsMutationEnabled("Contagion"); if ((Object)(object)((Component)componentInChildren22).GetComponent() == (Object)null && flag47 && (flag46 || ShouldMutate(__instance, chance22, _slowMouth.Salt))) { ((Component)componentInChildren22).gameObject.AddComponent(); SetMutationName(__instance, "Contagion"); _slowMouth.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Contagion] A Spewer mutated into Contagion."); } return; } EnemyHeadGrabber componentInChildren23 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren23 != (Object)null) { float chance23 = (flag ? 1f : GetMutationChance(_headGrabber)); bool value23; bool flag48 = _headGrabber.MutatedIds.TryGetValue(key, out value23) && value23; bool flag49 = flag || Plugin.IsMutationEnabled("Necromancer"); if ((Object)(object)((Component)componentInChildren23).GetComponent() == (Object)null && flag49 && (flag48 || ShouldMutate(__instance, chance23, _headGrabber.Salt))) { ((Component)componentInChildren23).gameObject.AddComponent(); SetMutationName(__instance, "Necromancer"); _headGrabber.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Necromancer] A Head Grabber mutated into a Necromancer."); } return; } EnemyHeartHugger componentInChildren24 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren24 != (Object)null) { float chance24 = (flag ? 1f : GetMutationChance(_heartHugger)); bool value24; bool flag50 = _heartHugger.MutatedIds.TryGetValue(key, out value24) && value24; bool flag51 = flag || Plugin.IsMutationEnabled("Heartbreak"); if ((Object)(object)((Component)componentInChildren24).GetComponent() == (Object)null && flag51 && (flag50 || ShouldMutate(__instance, chance24, _heartHugger.Salt))) { ((Component)componentInChildren24).gameObject.AddComponent(); SetMutationName(__instance, "Heartbreak"); _heartHugger.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Heartbreak] A Heart Hugger mutated into Heartbreak."); } return; } EnemyOogly componentInChildren25 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren25 != (Object)null) { float chance25 = (flag ? 1f : GetMutationChance(_oogly)); bool value25; bool flag52 = _oogly.MutatedIds.TryGetValue(key, out value25) && value25; bool flag53 = flag || Plugin.IsMutationEnabled("Deathlight"); if ((Object)(object)((Component)componentInChildren25).GetComponent() == (Object)null && flag53 && (flag52 || ShouldMutate(__instance, chance25, _oogly.Salt))) { ((Component)componentInChildren25).gameObject.AddComponent(); SetMutationName(__instance, "Deathlight"); _oogly.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Deathlight] An Oogly mutated into a Deathlight."); } return; } EnemyShadow componentInChildren26 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren26 != (Object)null) { float chance26 = (flag ? 1f : GetMutationChance(_shadow)); bool value26; bool flag54 = _shadow.MutatedIds.TryGetValue(key, out value26) && value26; bool flag55 = flag || Plugin.IsMutationEnabled("Aftershock"); if ((Object)(object)((Component)componentInChildren26).GetComponent() == (Object)null && flag55 && (flag54 || ShouldMutate(__instance, chance26, _shadow.Salt))) { ((Component)componentInChildren26).gameObject.AddComponent(); SetMutationName(__instance, "Aftershock"); _shadow.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Aftershock] A Shadow Child mutated into an Aftershock."); } return; } EnemyThinMan componentInChildren27 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren27 != (Object)null) { float chance27 = (flag ? 1f : GetMutationChance(_thinMan)); bool value27; bool flag56 = _thinMan.MutatedIds.TryGetValue(key, out value27) && value27; bool flag57 = flag || Plugin.IsMutationEnabled("Parallax"); if ((Object)(object)((Component)componentInChildren27).GetComponent() == (Object)null && flag57 && (flag56 || ShouldMutate(__instance, chance27, _thinMan.Salt))) { ((Component)componentInChildren27).gameObject.AddComponent(); SetMutationName(__instance, "Parallax"); _thinMan.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Parallax] A Thin Man mutated into a Parallax."); } return; } EnemyElsa componentInChildren28 = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren28 != (Object)null) { float chance28 = (flag ? 1f : GetMutationChance(_elsa)); bool value28; bool flag58 = _elsa.MutatedIds.TryGetValue(key, out value28) && value28; bool flag59 = flag || Plugin.IsMutationEnabled("Fenrir"); if ((Object)(object)((Component)componentInChildren28).GetComponent() == (Object)null && flag59 && (flag58 || ShouldMutate(__instance, chance28, _elsa.Salt))) { ((Component)componentInChildren28).gameObject.AddComponent(); SetMutationName(__instance, "Fenrir"); _elsa.MutatedIds[key] = true; Plugin.Log.LogInfo((object)"[Fenrir] An Elsa mutated into Fenrir."); } } } catch (Exception arg) { Plugin.Log.LogError((object)$"[Mutation] attach error: {arg}"); } } private static void SetMutationName(EnemyParent parent, string name) { try { if (!((Object)(object)parent == (Object)null)) { parent.enemyName = name; parent.enemyNameLocalized = null; } } catch { } } private static EnemyParent? GnomeGroupAnchor(EnemyGnome gnome) { try { EnemyGnomeDirector instance = EnemyGnomeDirector.instance; if (instance?.gnomes == null) { Enemy enemy = gnome.enemy; return (enemy != null) ? ((Component)enemy).GetComponentInParent() : null; } int num = instance.gnomes.IndexOf(gnome); if (num < 0) { Enemy enemy2 = gnome.enemy; return (enemy2 != null) ? ((Component)enemy2).GetComponentInParent() : null; } int num2 = num - num % 4; if (num2 >= instance.gnomes.Count || (Object)(object)instance.gnomes[num2] == (Object)null) { Enemy enemy3 = gnome.enemy; return (enemy3 != null) ? ((Component)enemy3).GetComponentInParent() : null; } Enemy enemy4 = instance.gnomes[num2].enemy; return (enemy4 != null) ? ((Component)enemy4).GetComponentInParent() : null; } catch { Enemy enemy5 = gnome.enemy; return (enemy5 != null) ? ((Component)enemy5).GetComponentInParent() : null; } } private static float GetMutationChance(RollState state) { RunManager instance = RunManager.instance; if ((Object)(object)instance == (Object)null) { return 0f; } int num = instance.levelsCompleted + 1; if (state.Level == -1) { state.Level = num; } else if (num != state.Level) { state.Level = num; state.MutatedIds.Clear(); } int num2 = Mathf.Max(0, Plugin.MutationSurgeInterval.Value); if (num2 > 0 && num % num2 == 0) { if (_surgeLoggedLevel != num) { _surgeLoggedLevel = num; Plugin.Log.LogInfo((object)$"[Mutation Surge] Level {num}: every enabled supported enemy is guaranteed to mutate."); } return 1f; } return Mathf.Min((float)num * Plugin.MutationChancePerLevel.Value, Plugin.MutationMaxChance.Value); } private static int EnemyId(EnemyParent instance) { PhotonView photonView = ((MonoBehaviourPun)instance).photonView; if (!((Object)(object)photonView != (Object)null) || photonView.ViewID == 0) { return ((Object)instance).GetInstanceID(); } return photonView.ViewID; } private static bool ShouldMutate(EnemyParent instance, float chance, uint typeSalt) { if (chance <= 0f) { return false; } if (chance >= 1f) { return true; } PhotonView photonView = ((MonoBehaviourPun)instance).photonView; int num = (int)((uint)(((Object)(object)photonView != (Object)null && photonView.ViewID != 0) ? photonView.ViewID : ((Object)instance).GetInstanceID()) ^ typeSalt) * -1640531535; int num2 = (num ^ (num >>> 13)) * -1640531535; float num3 = (float)(uint)((num2 ^ (num2 >>> 16)) & 0xFFFFFF) / 16777216f; if (_mutDiag < 12) { _mutDiag++; Plugin.Log.LogInfo((object)$"[MutChance] {instance.enemyName} viewID={(((Object)(object)photonView != (Object)null) ? photonView.ViewID : (-1))} instId={((Object)instance).GetInstanceID()} chance={chance:F3} roll={num3:F3} -> {num3 < chance}"); } return num3 < chance; } } [HarmonyPatch(typeof(ParticleScriptExplosion), "Spawn")] internal static class ParticleScriptExplosion_Spawn_FlambeImmunity { internal static bool IsFlambeGrenade(Component c) { if ((Object)(object)c == (Object)null) { return false; } if ((Object)(object)c.GetComponentInParent() != (Object)null) { return true; } PhotonView componentInParent = c.GetComponentInParent(); object[] array = (((Object)(object)componentInParent != (Object)null) ? componentInParent.InstantiationData : null); if (array != null) { object[] array2 = array; for (int i = 0; i < array2.Length; i++) { if (array2[i] is string text && text == "MatsuFlambeGrenade") { return true; } } } return false; } private static void Prefix(ParticleScriptExplosion __instance, ref int enemyDamage) { try { if (IsFlambeGrenade((Component)(object)__instance)) { enemyDamage = 0; } } catch { } } private static void Postfix(ParticleScriptExplosion __instance, ParticlePrefabExplosion __result) { try { if ((Object)(object)__result == (Object)null || (Object)(object)__result.HurtCollider == (Object)null || __result.HurtCollider.ignoreObjects == null || !IsFlambeGrenade((Component)(object)__instance)) { return; } EnemyDirector instance = EnemyDirector.instance; if ((Object)(object)instance == (Object)null || instance.enemiesSpawned == null) { return; } foreach (EnemyParent item2 in instance.enemiesSpawned) { if (!((Object)(object)item2 == (Object)null)) { PhysGrabObject[] componentsInChildren = ((Component)item2).GetComponentsInChildren(true); foreach (PhysGrabObject item in componentsInChildren) { __result.HurtCollider.ignoreObjects.Add(item); } } } } catch (Exception arg) { Plugin.Log.LogError((object)$"[Flambe] spawn immunity error: {arg}"); } } } [HarmonyPatch(typeof(ItemGrenade), "Start")] internal static class ItemGrenade_Start_FlambeSync { private static void Postfix(ItemGrenade __instance) { try { if (ParticleScriptExplosion_Spawn_FlambeImmunity.IsFlambeGrenade((Component)(object)__instance)) { __instance.isSpawnedGrenade = true; __instance.tickTime = Plugin.FlambeGrenadeFuse.Value; } } catch (Exception arg) { Plugin.Log.LogError((object)$"[Flambe] grenade start-sync error: {arg}"); } } } [HarmonyPatch(typeof(EnemyBang), "OnDeath")] internal static class EnemyBang_OnDeath_Patch { private static bool Prefix(EnemyBang __instance) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_006c: 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) try { if ((Object)(object)__instance == (Object)null || (Object)(object)((Component)__instance).GetComponent() == (Object)null) { return true; } Enemy component = ((Component)__instance).GetComponent(); Vector3 val = (((Object)(object)component != (Object)null && (Object)(object)component.CenterTransform != (Object)null) ? component.CenterTransform.position : ((Component)__instance).transform.position); try { EnemyBangAnim anim = __instance.anim; if (anim != null) { Sound soundDeathSFX = anim.soundDeathSFX; if (soundDeathSFX != null) { soundDeathSFX.Play(val, 1f, 1f, 1f, 1f); } } EnemyBangAnim anim2 = __instance.anim; if (anim2 != null) { Sound soundDeathVO = anim2.soundDeathVO; if (soundDeathVO != null) { soundDeathVO.Play(val, 1f, 1f, 1f, 1f); } } } catch { } if (SemiFunc.IsMasterClientOrSingleplayer()) { EnemyParent componentInParent = ((Component)__instance).GetComponentInParent(); try { if (componentInParent != null) { componentInParent.Despawn(); } } catch { } } try { ParticleScriptExplosion component2 = ((Component)__instance).GetComponent(); if (component2 != null) { component2.Spawn(val, Plugin.BigBangExplosionSize.Value, Plugin.BigBangPlayerDamage.Value, Plugin.BigBangEnemyDamage.Value, 2f, false, false, 1f); } } catch { } try { ParticleSystem[] deathEffects = __instance.deathEffects; foreach (ParticleSystem obj4 in deathEffects) { if (obj4 != null) { obj4.Play(); } } } catch { } return false; } catch (Exception arg) { Plugin.Log.LogError((object)$"[BigBang] OnDeath patch error: {arg}"); return true; } } } [HarmonyPatch(typeof(EnemyBang), "ExplodeRPC")] internal static class EnemyBang_ExplodeRPC_Patch { private static bool Prefix(EnemyBang __instance, PhotonMessageInfo _info) { //IL_001e: 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_0091: 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_009e: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)__instance == (Object)null || (Object)(object)((Component)__instance).GetComponent() == (Object)null) { return true; } if (!SemiFunc.MasterOnlyRPC(_info)) { return false; } try { ParticleSystem[] deathEffects = __instance.deathEffects; foreach (ParticleSystem obj in deathEffects) { if (obj != null) { obj.Play(); } } } catch { } Enemy component = ((Component)__instance).GetComponent(); Vector3 val = (((Object)(object)component != (Object)null && (Object)(object)component.CenterTransform != (Object)null) ? component.CenterTransform.position : ((Component)__instance).transform.position); try { ParticleScriptExplosion component2 = ((Component)__instance).GetComponent(); if (component2 != null) { component2.Spawn(val, Plugin.BigBangExplosionSize.Value, Plugin.BigBangPlayerDamage.Value, Plugin.BigBangEnemyDamage.Value, 2f, false, false, 1f); } } catch { } return false; } catch (Exception arg) { Plugin.Log.LogError((object)$"[BigBang] ExplodeRPC patch error: {arg}"); return true; } } } [HarmonyPatch(typeof(EnemyBirthdayBoy), "OnDeath")] internal static class EnemyBirthdayBoy_OnDeath_Patch { private static void Postfix(EnemyBirthdayBoy __instance) { try { if (SemiFunc.IsMasterClientOrSingleplayer() && !((Object)(object)__instance == (Object)null)) { BoomdayBoyFusion component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null) { component.Detonate(); } } } catch (Exception arg) { Plugin.Log.LogError((object)$"[BoomdayBoy] OnDeath patch error: {arg}"); } } } [HarmonyPatch(typeof(EnemyBirthdayBoy), "RemoveBalloon")] internal static class EnemyBirthdayBoy_RemoveBalloon_Patch { private static void Prefix(EnemyBirthdayBoy __instance, Vector3 _position) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) try { if (!((Object)(object)__instance == (Object)null)) { BoomdayBoyFusion component = ((Component)__instance).GetComponent(); if (!((Object)(object)component == (Object)null) && __instance.balloons != null && __instance.balloons.TryGetValue(_position, out var value) && !((Object)(object)value == (Object)null)) { Vector3 position = value.transform.position; component.ExplodeBalloonAt(position); } } } catch { } } } [HarmonyPatch(typeof(Sound), "Play", new Type[] { typeof(Vector3), typeof(float), typeof(float), typeof(float), typeof(float) })] internal static class Sound_Play_TricksterSilence_Patch { private static bool Prefix(Vector3 position) { //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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) try { foreach (TricksterFusion activeDisguise in TricksterFusion.ActiveDisguises) { if (!((Object)(object)activeDisguise == (Object)null)) { Vector3 val = ((Component)activeDisguise).transform.position - position; if (((Vector3)(ref val)).sqrMagnitude <= 2.25f) { return false; } } } } catch { } return true; } } }