using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalLib.Modules; using Microsoft.CodeAnalysis; using ProjectSCP.SCP1507.NetcodePatcher; using SCP1507.Configurations; using SCP1507.DataClass; using SCP1507.FlamingoManager; using SCP1507.Patches; using SCP1507.SCP1507; using SCP1507.SCP1507Alpha; using Unity.Collections; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ProjectSCP.SCP1507")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.1.5.0")] [assembly: AssemblyInformationalVersion("1.1.5+135e7b678fbb21e64cb5a239eab957c0ab616d01")] [assembly: AssemblyProduct("SCP1507")] [assembly: AssemblyTitle("ProjectSCP.SCP1507")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.5.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.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 SCP1507 { [BepInPlugin("ProjectSCP.SCP1507", "SCP1507", "1.1.5")] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; public static AssetBundle? ModAssets; private readonly Harmony harmony = new Harmony("ProjectSCP.SCP1507"); public static Config FlamingoConfig { get; internal set; } private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; FlamingoConfig = new Config(((BaseUnityPlugin)this).Config); InitializeNetworkBehaviours(); Logger.LogInfo((object)"Plugin ProjectSCP.SCP1507 loading asset bundles"); string path = "scp1507modassets"; ModAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), path)); if ((Object)(object)ModAssets == (Object)null) { Logger.LogError((object)"Failed to load custom assets."); return; } Logger.LogInfo((object)"Extracting Enemies"); EnemyType val = ModAssets.LoadAsset("scp1507"); TerminalNode val2 = ModAssets.LoadAsset("SCP1507TN"); TerminalKeyword val3 = ModAssets.LoadAsset("SCP1507TK"); EnemyType val4 = ModAssets.LoadAsset("SCP1507Alpha"); TerminalNode val5 = ModAssets.LoadAsset("SCP1507ATN"); TerminalKeyword val6 = ModAssets.LoadAsset("SCP1507ATK"); Dictionary dictionary = new Dictionary { { (LevelTypes)16, 20 }, { (LevelTypes)64, 20 }, { (LevelTypes)(-1), FlamingoConfig.RARITY_ALPHA.Value }, { (LevelTypes)1024, 40 } }; Dictionary dictionary2 = new Dictionary(); NetworkPrefabs.RegisterNetworkPrefab(val4.enemyPrefab); NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab); Logger.LogInfo((object)"Registered Prfabs"); Enemies.RegisterEnemy(val, 0, (LevelTypes)(-1), val2, val3); Enemies.RegisterEnemy(val4, dictionary, dictionary2, val5, val6); Logger.LogInfo((object)"Registered enemies"); harmony.PatchAll(typeof(ConfigurationsPatch)); harmony.PatchAll(typeof(NoiseItemPatch)); harmony.PatchAll(typeof(PhysicsProp)); harmony.PatchAll(typeof(PlayerControllerBPatch)); harmony.PatchAll(typeof(RoundManagerPatch)); Logger.LogInfo((object)"Executed patches"); Logger.LogInfo((object)"Plugin ProjectSCP.SCP1507 is loaded!"); } private static void InitializeNetworkBehaviours() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } } public static class PluginInfo { public const string PLUGIN_GUID = "ProjectSCP.SCP1507"; public const string PLUGIN_NAME = "SCP1507"; public const string PLUGIN_VERSION = "1.1.5"; } } namespace SCP1507.SCP1507 { public class AnimationRelaySCP1507Alpha : MonoBehaviour { public Scp1507Alpha mainScript; public void AttackDoorAnimationHandle() { MonsterLogger("Started attack sequence against door! FROM ALPHA. This is not supposed to happen and may cause issue!", reportable: true); } public void AttackPlayerAnimationHandle() { mainScript.SwingAttackHitClientRpc(); } public void FootStepAnimationHandle() { mainScript.walkingSource.Play(); } private void MonsterLogger(string message, bool reportable = false) { if (!reportable) { Debug.Log((object)("[ProjectSCP.SCP1507][SCP1507Alpha.Animations][" + (reportable ? "PLEASE REPORT TO US IN THE DISCORD CHANNEL" : "Don't Report") + "] ~ " + message)); } else { Debug.LogError((object)("[ProjectSCP.SCP1507][SCP1507Alpha.Animations][" + (reportable ? "PLEASE REPORT TO US IN THE DISCORD CHANNEL" : "Don't Report") + "] ~ " + message)); } } } public class AnimationRelaySCP1507 : MonoBehaviour { public Scp1507 mainScript; public void AttackDoorAnimationHandle() { ((EnemyAI)mainScript).creatureSFX.PlayOneShot(mainScript.destroyDoor); mainScript.SwingAttackHitDoor(); } public void AttackPlayerAnimationHandle() { mainScript.SwingAttackHitClientRpc(); } public void FootStepAnimationHandle() { mainScript.walkingSource.Play(); } } public class Scp1507 : EnemyAI { [CompilerGenerated] private sealed class d__45 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Scp1507 <>4__this; public PlayerControllerB playerControllerB; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__45(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_005d: 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) int num = <>1__state; Scp1507 scp = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 1; return true; case 1: <>1__state = -1; ((MonoBehaviour)scp).StopCoroutine(scp.KillCoroutine); playerControllerB.DamagePlayer(scp.damage, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__30 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Scp1507 <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__30(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown int num = <>1__state; Scp1507 scp = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(3f); <>1__state = 1; return true; case 1: <>1__state = -1; scp.TriggerRampage(2000); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__6 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Rigidbody rigidbody; public float time; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; rigidbody.detectCollisions = false; <>2__current = (object)new WaitForSeconds(time); <>1__state = 1; return true; case 1: <>1__state = -1; rigidbody.detectCollisions = true; Object.Destroy((Object)(object)((Component)rigidbody).gameObject, 5f); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [NonSerialized] [Header("Alpha")] public Scp1507Alpha alpha; [NonSerialized] public int alphaId; private bool isAlphaAlive; [Header("Attack")] public float attackCooldown; private float attackCooldownBeheader; public int damage; public Transform AttackArea; private Coroutine KillCoroutine; [Header("Audio")] public AudioClip destroyDoor; public AudioClip[] honks; public AudioClip[] attacks; public AudioClip attackDoor; public AudioSource walkingSource; private global::SCP1507.FlamingoManager.FlamingoManager flamingoManager; [Header("LookAt")] public Transform lookAt; public Transform defaultLookAt; private Coroutine startCo; [NonSerialized] private NetworkVariable _playerNetVar = new NetworkVariable(default(NetworkBehaviourReference), (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public PlayerControllerB Scp1507TargetPlayer { get { //IL_0006: 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_0016: Expected O, but got Unknown return (PlayerControllerB)NetworkBehaviourReference.op_Implicit(_playerNetVar.Value); } set { //IL_0025: 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_0017: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)value == (Object)null) { _playerNetVar.Value = default(NetworkBehaviourReference); } else { _playerNetVar.Value = new NetworkBehaviourReference((NetworkBehaviour)(object)value); } } } private void DoAttackSound() { try { base.creatureSFX.PlayOneShot(attacks[RandomNumberGenerator.GetInt32(attacks.Length)]); } catch (ArgumentNullException) { } catch (NullReferenceException) { } } public void DoQuackSound() { try { base.creatureVoice.PlayOneShot(honks[RandomNumberGenerator.GetInt32(honks.Length)]); } catch (ArgumentNullException) { } catch (NullReferenceException) { } } private void OnTriggerEnter(Collider other) { MonsterLogger("We collided with something!"); if (Object.op_Implicit((Object)(object)((Component)other).gameObject.GetComponent())) { PlayAnimationClientRpc("AttackDoor", value: true); } } private void OnTriggerExit(Collider other) { if (Object.op_Implicit((Object)(object)((Component)other).gameObject.GetComponent())) { PlayAnimationClientRpc("AttackDoor", value: false); } } private void CheckIfCanBreakDoor(DoorLock Door) { //IL_0048: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_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_008b: 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_0098: Unknown result type (might be due to invalid IL or missing references) if (alpha.HitDoor(Door)) { return; } try { GameObject gameObject = ((Component)((Component)((Component)((Component)Door).transform.parent).transform.parent).transform.parent).gameObject; if (!Object.op_Implicit((Object)(object)gameObject.GetComponent()) && Vector3.Distance(((Component)this).transform.position, gameObject.transform.position) <= 4f) { NetworkObjectReference netObjRef = NetworkObjectReference.op_Implicit(gameObject); Vector3 val = ((Component)base.targetPlayer).transform.position - ((Component)this).transform.position; BashDoorClientRpc(netObjRef, ((Vector3)(ref val)).normalized * 20f); } } catch (NullReferenceException) { try { Door.OpenDoorAsEnemyClientRpc(); } catch (Exception ex) { Debug.Log((object)("The doors are not formatted the right way and as such Flamingo's may seems really stupid hitting doors " + ex)); } } } [ClientRpc] public void BashDoorClientRpc(NetworkObjectReference netObjRef, Vector3 Position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: 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_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_00a4: 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_014b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4184319842u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref Position); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4184319842u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null)) { GameObject gameObject = ((Component)val3).gameObject; Rigidbody val4 = gameObject.AddComponent(); AudioSource val5 = gameObject.AddComponent(); val5.spatialBlend = 1f; val5.maxDistance = 60f; val5.rolloffMode = (AudioRolloffMode)1; val5.volume = 1f; ((MonoBehaviour)this).StartCoroutine(TurnOffC(val4, 0.12f)); val4.AddForce(Position, (ForceMode)1); val5.PlayOneShot(destroyDoor); } } } [IteratorStateMachine(typeof(d__6))] private IEnumerator TurnOffC(Rigidbody rigidbody, float time) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0) { rigidbody = rigidbody, time = time }; } public void SwingAttackHitDoor() { //IL_0014: 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) int num = 512; if (((NetworkBehaviour)this).IsHost) { Collider[] array = Physics.OverlapBox(AttackArea.position, AttackArea.localScale, Quaternion.identity, num); if (array.Length != 0) { Collider[] array2 = array; foreach (Collider val in array2) { DoorLock component = ((Component)val).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { CheckIfCanBreakDoor(component); } } } } attackCooldown = attackCooldownBeheader; } private void Awake() { attackCooldownBeheader = attackCooldown; attackCooldown = 0f; startCo = ((MonoBehaviour)this).StartCoroutine(StartCoroutineFLAMINGO()); damage = Plugin.FlamingoConfig.DAMAGE_NORMAL.Value; if ((Object)(object)global::SCP1507.FlamingoManager.FlamingoManager.Instance != (Object)null) { flamingoManager = global::SCP1507.FlamingoManager.FlamingoManager.Instance; flamingoManager.RegisterScp1507Instance(this); } Random random = new Random(); bool value = random.Next(2) == 0; PlayAnimationClientRpc("DanceDirection", value); } [IteratorStateMachine(typeof(d__30))] private IEnumerator StartCoroutineFLAMINGO() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__30(0) { <>4__this = this }; } [ClientRpc] public void StartCallAlphaClientRpc(int x) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3896637521u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, x); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3896637521u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StopCoroutine(startCo); Scp1507Alpha[] array = Object.FindObjectsOfType(); foreach (Scp1507Alpha scp1507Alpha in array) { if (scp1507Alpha.alphaId == x) { alpha = scp1507Alpha; alphaId = x; isAlphaAlive = true; break; } } } private void LateUpdate() { //IL_0096: 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_004d: 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) if (isAlphaAlive) { if (alpha.LocalAnger >= 7) { if ((Object)(object)Scp1507TargetPlayer != (Object)null) { lookAt.position = Scp1507TargetPlayer.playerEye.position; } else { lookAt.position = defaultLookAt.position; } } else { lookAt.position = defaultLookAt.position; } } else if ((Object)(object)((EnemyAI)this).GetClosestPlayer(false, false, false) != (Object)null) { lookAt.position = ((Component)((EnemyAI)this).GetClosestPlayer(false, false, false)).transform.position; } attackCooldown += Time.deltaTime; } public override void DoAIInterval() { //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: 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_00c0: 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_00f3: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); switch (base.currentBehaviourStateIndex) { case 0: base.agent.isStopped = true; base.agent.speed = 5f; base.agent.ResetPath(); break; case 1: base.agent.isStopped = false; Scp1507TargetPlayer = ((EnemyAI)this).GetClosestPlayer(false, false, false); base.agent.speed = 5f; if (base.creatureAnimator.GetBool("Dancing")) { PlayAnimationClientRpc("Dancing", value: false); } if (!((Object)(object)Scp1507TargetPlayer != (Object)null)) { break; } if (Vector3.Distance(((Component)this).transform.position, ((Component)Scp1507TargetPlayer).transform.position) > 10f) { base.agent.SetDestination(RoundManager.Instance.GetRandomNavMeshPositionInRadius(((Component)alpha).transform.position, 10f, default(NavMeshHit))); base.agent.speed = 10f; } else if ((Object)(object)Scp1507TargetPlayer != (Object)null) { base.agent.SetDestination(((Component)Scp1507TargetPlayer).transform.position); if (Vector3.Distance(((Component)this).transform.position, ((Component)Scp1507TargetPlayer).transform.position) < 1.2f && attackCooldown >= 1f) { PlayAnimationClientRpc("Attack"); } } break; case 2: base.agent.speed = 5f; Scp1507TargetPlayer = ((EnemyAI)this).GetClosestPlayer(false, false, false); if ((Object)(object)Scp1507TargetPlayer != (Object)null) { base.agent.SetDestination(((Component)Scp1507TargetPlayer).transform.position); if (Vector3.Distance(((Component)this).transform.position, ((Component)Scp1507TargetPlayer).transform.position) < 1.2f && attackCooldown >= 1f) { PlayAnimationClientRpc("Attack"); } } else { base.agent.ResetPath(); } break; default: MonsterLogger("WRONG BEHAVIOUR STATE INDEX!", reportable: true); break; case 3: break; } } public void StopMoving(int flamingoId) { if (flamingoId == alphaId) { PlayAnimationClientRpc("Walking", value: false); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } } public void TriggerAlphaCharge(int flamingoId) { if (flamingoId == alphaId) { PlayAnimationClientRpc("Walking", value: true); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } } public void TriggerRampage(int flamingoId) { if (flamingoId == alphaId || flamingoId == 2000) { PlayAnimationClientRpc("Walking", value: true); ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } } private bool CheckIfPlayerDances() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts; int num = 0; if (num < allPlayerScripts.Length) { PlayerControllerB val = allPlayerScripts[num]; if (!(Vector3.Distance(((Component)val).transform.position, ((Component)this).transform.position) < 10f) && val.performingEmote) { return true; } } return false; } [ClientRpc] public void PlayAnimationClientRpc(string animationName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: 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_0088: 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_00ff: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(783826533u, val, (RpcDelivery)0); bool flag = animationName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(animationName, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 783826533u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureAnimator.SetTrigger(animationName); } } [ClientRpc] public void PlayAnimationClientRpc(string animationName, bool value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Invalid comparison between Unknown and I4 //IL_005f: 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_0088: 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_011a: 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_00c1: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3605508353u, val, (RpcDelivery)0); bool flag = animationName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(animationName, false); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3605508353u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureAnimator.SetBool(animationName, value); } } public void StartDance() { PlayAnimationClientRpc("Dancing", value: true); } public void StopDance() { PlayAnimationClientRpc("Dancing", value: false); } private void MonsterLogger(string message, bool reportable = false) { if (!reportable) { Plugin.Logger.LogInfo((object)("[ProjectSCP.SCP1507][SCP1507Instance][" + (reportable ? "PLEASE REPORT TO US IN THE DISCORD CHANNEL" : "Don't Report") + "] ~ " + message)); } else { Plugin.Logger.LogError((object)("[ProjectSCP.SCP1507][SCP1507Instance][" + (reportable ? "PLEASE REPORT TO US IN THE DISCORD CHANNEL" : "Don't Report") + "] ~ " + message)); } } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if ((Object)(object)playerWhoHit != (Object)null && isAlphaAlive) { alpha.LocalAnger += 5; try { alpha.GiveServerAngerServerRpc(playerWhoHit.actualClientId, alpha.LocalAnger); } catch (InvalidOperationException) { MonsterLogger("Small error on calling!"); throw; } } if (base.isEnemyDead) { return; } base.enemyHP -= force; if (((NetworkBehaviour)this).IsOwner && base.enemyHP <= 0 && !base.isEnemyDead) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); if ((Object)(object)global::SCP1507.FlamingoManager.FlamingoManager.Instance != (Object)null) { global::SCP1507.FlamingoManager.FlamingoManager.Instance.UnregisterScp1507Instance(this); } } } [ClientRpc] public void SwingAttackHitClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: 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_007c: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2851027910u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2851027910u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; int num = 8; Collider[] array = Physics.OverlapBox(AttackArea.position, AttackArea.localScale, Quaternion.identity, num); if (array.Length != 0) { Collider[] array2 = array; foreach (Collider val3 in array2) { PlayerControllerB val4 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val3, false, false); if ((Object)(object)val4 != (Object)null) { base.creatureSFX.PlayOneShot(attacks[RandomNumberGenerator.GetInt32(attacks.Length)]); MonsterLogger(val4.health.ToString()); KillCoroutine = ((MonoBehaviour)this).StartCoroutine(DamagePlayerCoroutine(val4)); } } } attackCooldown = attackCooldownBeheader; } [IteratorStateMachine(typeof(d__45))] private IEnumerator DamagePlayerCoroutine(PlayerControllerB playerControllerB) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__45(0) { <>4__this = this, playerControllerB = playerControllerB }; } protected override void __initializeVariables() { if (_playerNetVar == null) { throw new Exception("Scp1507._playerNetVar cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)_playerNetVar).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)_playerNetVar, "_playerNetVar"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)_playerNetVar); ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(4184319842u, new RpcReceiveHandler(__rpc_handler_4184319842), "BashDoorClientRpc"); ((NetworkBehaviour)this).__registerRpc(3896637521u, new RpcReceiveHandler(__rpc_handler_3896637521), "StartCallAlphaClientRpc"); ((NetworkBehaviour)this).__registerRpc(783826533u, new RpcReceiveHandler(__rpc_handler_783826533), "PlayAnimationClientRpc"); ((NetworkBehaviour)this).__registerRpc(3605508353u, new RpcReceiveHandler(__rpc_handler_3605508353), "PlayAnimationClientRpc"); ((NetworkBehaviour)this).__registerRpc(2851027910u, new RpcReceiveHandler(__rpc_handler_2851027910), "SwingAttackHitClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_4184319842(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjRef, default(ForNetworkSerializable)); Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((Scp1507)(object)target).BashDoorClientRpc(netObjRef, position); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3896637521(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int x = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref x); target.__rpc_exec_stage = (__RpcExecStage)1; ((Scp1507)(object)target).StartCallAlphaClientRpc(x); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_783826533(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_0061: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string animationName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Scp1507)(object)target).PlayAnimationClientRpc(animationName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3605508353(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_0067: 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_009a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string animationName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationName, false); } bool value = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref value, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Scp1507)(object)target).PlayAnimationClientRpc(animationName, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2851027910(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Scp1507)(object)target).SwingAttackHitClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Scp1507"; } } public class HatHandler : MonoBehaviour { public List allHats; private void Awake() { if (Plugin.FlamingoConfig.CUSTOM_HAT.Value) { int @int = RandomNumberGenerator.GetInt32(allHats.Count); allHats[@int].SetActive(true); allHats.RemoveAt(@int); } foreach (GameObject allHat in allHats) { Object.Destroy((Object)(object)allHat); } } } public enum State { Unmoving, AlphaCharge, Rampage, None } } namespace SCP1507.Patches { [HarmonyPatch(typeof(GrabbableObject))] internal class GrabbableObjectPatch { [HarmonyPatch("GrabServerRpc")] [HarmonyPostfix] private static void PostFix(GrabbableObject __instance) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)"WE DID GRAB ITEM!"); if ((Object)(object)global::SCP1507.FlamingoManager.FlamingoManager.Instance != (Object)null) { global::SCP1507.FlamingoManager.FlamingoManager.Instance.PickupItemTrigger(__instance.playerHeldBy, ((Component)__instance).transform.position); } } } [HarmonyPatch(typeof(NoisemakerProp))] internal class NoiseItemPatch { [HarmonyPatch("ItemActivate")] [HarmonyPrefix] private static bool PreFix(NoisemakerProp __instance, bool used, bool buttonDown = true) { if ((Object)(object)global::SCP1507.FlamingoManager.FlamingoManager.Instance != (Object)null) { Debug.Log((object)"Activated!"); if (((Object)__instance).name == "Airhorn(Clone)") { Debug.Log((object)"It's an Airhorn!"); global::SCP1507.FlamingoManager.FlamingoManager.Instance.AirHornCheck(((GrabbableObject)__instance).playerHeldBy); } if (((Object)__instance).name == "Clownhorn(Clone)") { Debug.Log((object)"It's a clown Horn"); global::SCP1507.FlamingoManager.FlamingoManager.Instance.ClownHornCheck(((GrabbableObject)__instance).playerHeldBy); } } return true; } } [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerControllerBPatch { [HarmonyPatch("StartPerformingEmoteServerRpc")] [HarmonyPostfix] private static void PostFixStart(PlayerControllerB __instance) { if ((Object)(object)global::SCP1507.FlamingoManager.FlamingoManager.Instance != (Object)null) { global::SCP1507.FlamingoManager.FlamingoManager.Instance.StartEmoting(__instance); } } [HarmonyPatch("StopPerformingEmoteServerRpc")] [HarmonyPostfix] private static void PostFixStop(PlayerControllerB __instance) { if ((Object)(object)global::SCP1507.FlamingoManager.FlamingoManager.Instance != (Object)null) { global::SCP1507.FlamingoManager.FlamingoManager.Instance.StopEmoting(__instance); } } } [HarmonyPatch(typeof(RoundManager))] internal class RoundManagerPatch { [HarmonyPatch("UnloadSceneObjectsEarly")] [HarmonyPostfix] private static void PostFixStart(RoundManager __instance) { if ((Object)(object)global::SCP1507.FlamingoManager.FlamingoManager.Instance != (Object)null) { global::SCP1507.FlamingoManager.FlamingoManager.Instance.DestroyManagerClientRpc(); } } } } namespace SCP1507.FlamingoManager { public class FlamingoManager : MonoBehaviour { [CompilerGenerated] private sealed class d__16 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public FlamingoManager <>4__this; public int numberOfHonks; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown int num = <>1__state; FlamingoManager flamingoManager = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; flamingoManager.honksDone = 0; break; case 1: <>1__state = -1; flamingoManager.honksDone++; break; } if (flamingoManager.honksDone < numberOfHonks) { flamingoManager.allFlamingo[RandomNumberGenerator.GetInt32(flamingoManager.allFlamingo.Count)].DoQuackSound(); <>2__current = (object)new WaitForSeconds(RandomFloatBetween(0.1f, 1f)); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static FlamingoManager _instance; private List allFlamingo; private List playersDoingEmotes; private int honksDone; public static FlamingoManager Instance => _instance; private void Awake() { allFlamingo = new List(); playersDoingEmotes = new List(); if ((Object)(object)_instance != (Object)null && (Object)(object)_instance != (Object)(object)this) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } _instance = this; ((MonoBehaviour)this).InvokeRepeating("CheckIfSeen", 2f, 7f); ((MonoBehaviour)this).InvokeRepeating("Emotehandles", 5f, 1f); ((MonoBehaviour)this).InvokeRepeating("HonkManager", 5f, 6f); } public void RegisterScp1507Instance(Scp1507 instance) { allFlamingo.Add(instance); } public void UnregisterScp1507Instance(Scp1507 instance) { foreach (Scp1507 item in allFlamingo) { if ((Object)(object)item == (Object)(object)instance) { allFlamingo.Remove(instance); break; } } } public void AirHornCheck(PlayerControllerB playerHeldBy) { //IL_001c: 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) foreach (Scp1507 item in allFlamingo) { float num = Vector3.Distance(((Component)playerHeldBy).transform.position, ((Component)item).transform.position); if (num <= 5f && (Object)(object)item.alpha != (Object)null) { item.alpha.LocalAnger++; item.alpha.GiveServerAngerServerRpc(playerHeldBy.actualClientId, item.alpha.LocalAnger); break; } } } public void ClownHornCheck(PlayerControllerB playerHeldBy) { //IL_001c: 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) foreach (Scp1507 item in allFlamingo) { float num = Vector3.Distance(((Component)playerHeldBy).transform.position, ((Component)item).transform.position); if (num <= 5f && (Object)(object)item.alpha != (Object)null) { item.alpha.LocalAnger--; item.alpha.GiveServerAngerServerRpc(playerHeldBy.actualClientId, item.alpha.LocalAnger); break; } } } public void PickupItemTrigger(PlayerControllerB playerHeldBy, Vector3 positionOfPickup) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) foreach (Scp1507 item in allFlamingo) { float num = Vector3.Distance(positionOfPickup, ((Component)item).transform.position); if (num <= 5f) { item.alpha.LocalAnger += 2; item.alpha.GiveServerAngerServerRpc(playerHeldBy.actualClientId, item.alpha.LocalAnger); break; } } } public void CheckIfSeen() { //IL_0075: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB[] array = RoundManager.Instance.playersManager.allPlayerScripts.Where((PlayerControllerB player) => !player.isPlayerDead && player.isPlayerControlled && player.isInsideFactory).ToArray(); if (array.Length == 0) { return; } PlayerControllerB val = array[RandomNumberGenerator.GetInt32(array.Length)]; foreach (Scp1507 item in allFlamingo) { if ((Object)(object)item == (Object)null || !val.HasLineOfSightToPosition(((Component)item).transform.position, 45f, 60, -1f, -1) || !((Object)(object)item.alpha != (Object)null)) { continue; } item.alpha.LocalAnger += 2; GrabbableObject[] itemSlots = val.ItemSlots; foreach (GrabbableObject val2 in itemSlots) { if ((Object)(object)val2 == (Object)null) { continue; } MonsterLogger("1 DONE"); if (val2.isHeld) { MonsterLogger("2 DONE"); if ((Object)(object)((Component)val2).gameObject.GetComponent() != (Object)null) { MonsterLogger("Holding shovel!"); item.alpha.LocalAnger += 3; break; } if ((Object)(object)((Component)val2).gameObject.GetComponent() != (Object)null) { item.alpha.LocalAnger += 3; break; } if ((Object)(object)((Component)val2).gameObject.GetComponent() != (Object)null) { item.alpha.LocalAnger += 7; break; } } } item.alpha.GiveServerAngerServerRpc(val.actualClientId, item.alpha.LocalAnger); break; } } public void Emotehandles() { foreach (EmoteTime playersDoingEmote in playersDoingEmotes) { playersDoingEmote.TimeEmoting++; if (allFlamingo != null) { switch (playersDoingEmote.TimeEmoting) { case 10: allFlamingo[0].alpha.LocalAnger--; allFlamingo[0].alpha.GiveServerAngerServerRpc(playersDoingEmote.ClientId, allFlamingo[0].alpha.LocalAnger); break; case 20: allFlamingo[0].alpha.LocalAnger -= 2; allFlamingo[0].alpha.GiveServerAngerServerRpc(playersDoingEmote.ClientId, allFlamingo[0].alpha.LocalAnger); break; case 30: allFlamingo[0].alpha.LocalAnger -= 3; allFlamingo[0].alpha.GiveServerAngerServerRpc(playersDoingEmote.ClientId, allFlamingo[0].alpha.LocalAnger); break; case 40: allFlamingo[0].alpha.LocalAnger -= 4; allFlamingo[0].alpha.GiveServerAngerServerRpc(playersDoingEmote.ClientId, allFlamingo[0].alpha.LocalAnger); break; } } } } public void StartEmoting(PlayerControllerB actualPlayer) { //IL_002b: 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) PlayerControllerB actualPlayer2 = actualPlayer; bool flag = false; try { foreach (Scp1507 item in allFlamingo) { try { if (Vector3.Distance(((Component)item).transform.position, ((Component)actualPlayer2).transform.position) < 6f) { item.StartDance(); flag = true; } } catch (NullReferenceException) { UnregisterScp1507Instance(item); } } } catch (InvalidOperationException) { } if (flag && playersDoingEmotes.FirstOrDefault((EmoteTime e) => e.ClientId == actualPlayer2.actualClientId) == null) { playersDoingEmotes.Add(new EmoteTime(actualPlayer2.actualClientId)); } } public void HonkManager() { if (allFlamingo.Count != 0) { int num = allFlamingo.Count / 3; num++; ((MonoBehaviour)this).StartCoroutine(HonkForTimes(num)); } } [IteratorStateMachine(typeof(d__16))] private IEnumerator HonkForTimes(int numberOfHonks) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__16(0) { <>4__this = this, numberOfHonks = numberOfHonks }; } public void StopEmoting(PlayerControllerB actualPlayer) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB actualPlayer2 = actualPlayer; bool flag = false; foreach (Scp1507 item in allFlamingo) { if (!((Object)(object)item == (Object)null) && Vector3.Distance(((Component)item).transform.position, ((Component)actualPlayer2).transform.position) < 6f) { item.StopDance(); flag = true; } } if (flag) { playersDoingEmotes.Remove(playersDoingEmotes.FirstOrDefault((EmoteTime e) => e.ClientId == actualPlayer2.actualClientId)); } } public static float RandomFloatBetween(float min, float max) { Random random = new Random(); double num = max - min; double num2 = random.NextDouble(); double num3 = num2 * num + (double)min; return (float)num3; } [ClientRpc] public void DestroyManagerClientRpc() { Object.Destroy((Object)(object)((Component)this).gameObject); } private void OnDestroy() { ((MonoBehaviour)this).StopAllCoroutines(); ((MonoBehaviour)this).CancelInvoke("CheckIfSeen"); ((MonoBehaviour)this).CancelInvoke("Emotehandles"); ((MonoBehaviour)this).CancelInvoke("HonkManager"); } private void MonsterLogger(string message, bool reportable = false) { if (!reportable) { Plugin.Logger.Log((LogLevel)16, (object)("[ProjectSCP.SCP1507][SCP1507Manager][" + (reportable ? "PLEASE REPORT TO US IN THE DISCORD CHANNEL" : "Don't Report") + "] ~ " + message)); } else { Plugin.Logger.Log((LogLevel)2, (object)("[ProjectSCP.SCP1507][SCP1507Manager][" + (reportable ? "PLEASE REPORT TO US IN THE DISCORD CHANNEL" : "Don't Report") + "] ~ " + message)); } } } } namespace SCP1507.DataClass { public class PlayerRecord { private PlayerControllerB playerControllerB; private ulong clientId; private int angerMeter; private bool angered; public PlayerControllerB PlayerControllerB => playerControllerB; public ulong ClientId => clientId; public bool Angered { get { if (!playerControllerB.isPlayerDead && playerControllerB.isInsideFactory) { return angered; } return false; } } public int AngerMeter { get { return angerMeter; } set { if (value <= 0) { angerMeter = 0; return; } if (value >= Plugin.FlamingoConfig.ANGER_FOR_ANGRY_FLAMINGO.Value) { angered = true; } angerMeter = value; } } public PlayerRecord(ulong clientId, int angerMeter) { this.clientId = clientId; this.angerMeter = angerMeter; if (this.angerMeter >= Plugin.FlamingoConfig.ANGER_FOR_ANGRY_FLAMINGO.Value) { angered = true; } PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (val.playerClientId == clientId) { playerControllerB = val; } } } } } namespace SCP1507.SCP1507Alpha { public class EmoteTime { private ulong clientId; private int timeEmoting; public int TimeEmoting { get { return timeEmoting; } set { timeEmoting = value; } } public ulong ClientId => clientId; public EmoteTime(ulong clientId) { this.clientId = clientId; timeEmoting = 0; } } public class Scp1507Alpha : EnemyAI { [CompilerGenerated] private sealed class d__52 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Scp1507Alpha <>4__this; private int 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__52(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown int num = <>1__state; Scp1507Alpha scp1507Alpha = <>4__this; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; } else { <>1__state = -1; 5__2 = 0; } while (!scp1507Alpha.CheckIfLocalPlayerHasVisionToCurrentPosition_ONEPLAYER()) { 5__2 = 0; } 5__2++; switch (5__2) { case 10: scp1507Alpha.AddToAnger(1); break; case 20: scp1507Alpha.AddToAnger(2); break; case 30: scp1507Alpha.AddToAnger(3); break; case 40: scp1507Alpha.AddToAnger(4); break; } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__61 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB playerControllerB; public Scp1507Alpha <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__61(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0051: 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) int num = <>1__state; Scp1507Alpha scp1507Alpha = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; case 1: <>1__state = -1; playerControllerB.DamagePlayer(scp1507Alpha.damage, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); ((MonoBehaviour)scp1507Alpha).StopCoroutine(scp1507Alpha.KillCoroutine); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Scp1507Alpha <>4__this; private Scp1507[] <>7__wrap1; private int <>7__wrap2; private Scp1507 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>7__wrap1 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown int num = <>1__state; Scp1507Alpha scp1507Alpha = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>7__wrap1 = Object.FindObjectsOfType(); <>7__wrap2 = 0; break; case 1: <>1__state = -1; 5__4.TriggerAlphaCharge(scp1507Alpha.alphaId); 5__4 = null; <>7__wrap2++; break; } if (<>7__wrap2 < <>7__wrap1.Length) { 5__4 = <>7__wrap1[<>7__wrap2]; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; } <>7__wrap1 = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__9 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Scp1507Alpha <>4__this; private Scp1507[] <>7__wrap1; private int <>7__wrap2; private Scp1507 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>7__wrap1 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown int num = <>1__state; Scp1507Alpha scp1507Alpha = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>7__wrap1 = Object.FindObjectsOfType(); <>7__wrap2 = 0; break; case 1: <>1__state = -1; 5__4.TriggerRampage(scp1507Alpha.alphaId); 5__4 = null; <>7__wrap2++; break; } if (<>7__wrap2 < <>7__wrap1.Length) { 5__4 = <>7__wrap1[<>7__wrap2]; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; } <>7__wrap1 = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__13 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Scp1507Alpha <>4__this; private Scp1507[] <>7__wrap1; private int <>7__wrap2; private Scp1507 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>7__wrap1 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown int num = <>1__state; Scp1507Alpha scp1507Alpha = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>7__wrap1 = Object.FindObjectsOfType(); <>7__wrap2 = 0; break; case 1: <>1__state = -1; 5__4.StopMoving(scp1507Alpha.alphaId); 5__4 = null; <>7__wrap2++; break; } if (<>7__wrap2 < <>7__wrap1.Length) { 5__4 = <>7__wrap1[<>7__wrap2]; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; } <>7__wrap1 = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__2 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Scp1507Alpha <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown int num = <>1__state; Scp1507Alpha scp1507Alpha = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; scp1507Alpha.DoQuackSound(); break; } if (!((EnemyAI)scp1507Alpha).isEnemyDead) { <>2__current = (object)new WaitForSeconds(global::SCP1507.FlamingoManager.FlamingoManager.RandomFloatBetween(5f, 10f)); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private List currentBreakingDoors; [Header("Make anger")] public int alphaId; private int localAnger; public List listOfAnger; [Header("NetStats")] private ulong localPlayerId; private PlayerControllerB localPlayer; [Header("Audio")] public AudioClip[] honks; public AudioClip[] attacks; public AudioSource walkingSource; [Header("FlamingoBasics")] private bool isSeen; [Header("Attack")] public int damage; public Transform AttackArea; public float attackCooldown; private float attackCooldownBeheader; [Header("Look")] public Transform lookAt; public Transform defaultLookAt; private Coroutine beingLookedAtCoroutine; private Coroutine KillCoroutine; private int numberOfFlamingos; [NonSerialized] private NetworkVariable _playerNetVar = new NetworkVariable(default(NetworkBehaviourReference), (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public int LocalAnger { get { return localAnger; } set { localAnger = value; } } public PlayerControllerB Scp1507AlphaTargetPlayer { get { //IL_0006: 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_0016: Expected O, but got Unknown return (PlayerControllerB)NetworkBehaviourReference.op_Implicit(_playerNetVar.Value); } set { //IL_0022: 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) if ((Object)(object)value == (Object)null) { _playerNetVar.Value = NetworkBehaviourReference.op_Implicit((NetworkBehaviour)null); } else { _playerNetVar.Value = new NetworkBehaviourReference((NetworkBehaviour)(object)value); } } } private void DoAttackSound() { try { base.creatureSFX.PlayOneShot(attacks[RandomNumberGenerator.GetInt32(attacks.Length)]); } catch (ArgumentNullException) { } catch (NullReferenceException) { } } private void DoQuackSound() { try { base.creatureVoice.PlayOneShot(honks[RandomNumberGenerator.GetInt32(honks.Length)]); } catch (ArgumentNullException) { } catch (NullReferenceException) { } } [IteratorStateMachine(typeof(d__2))] private IEnumerator QuackAlpha() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0) { <>4__this = this }; } public bool HitDoor(DoorLock door) { foreach (DoorHold currentBreakingDoor in currentBreakingDoors) { if ((Object)(object)door == (Object)(object)currentBreakingDoor.Door) { currentBreakingDoor.NumberOfHits++; if (currentBreakingDoor.CanBreak) { return true; } return false; } } currentBreakingDoors.Add(new DoorHold(door)); return false; } public void DeleteDoor(DoorLock door) { foreach (DoorHold currentBreakingDoor in currentBreakingDoors) { if ((Object)(object)door == (Object)(object)currentBreakingDoor.Door) { currentBreakingDoors.Remove(currentBreakingDoor); } } } public void SpawnNewFlamingo() { //IL_0060: 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_0072: 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_00a0: Unknown result type (might be due to invalid IL or missing references) List list = new List(); SelectableLevel currentLevel = RoundManager.Instance.currentLevel; list.AddRange(RoundManager.Instance.currentLevel.Enemies); SpawnableEnemyWithRarity val = list.Find((SpawnableEnemyWithRarity x) => x.enemyType.enemyName.ToLower() == "scp1507"); if (val != null) { GameObject val2 = NetworkObjectReference.op_Implicit(RoundManager.Instance.SpawnEnemyGameObject(RoundManager.Instance.GetRandomNavMeshPositionInRadius(((Component)this).transform.position, 10f, default(NavMeshHit)), (float)Random.RandomRangeInt(0, 360), RoundManager.Instance.currentLevel.Enemies.IndexOf(val), val.enemyType)); val2.GetComponent().StartCallAlphaClientRpc(alphaId); numberOfFlamingos++; if (RandomNumberGenerator.GetInt32(100) <= Plugin.FlamingoConfig.CHANCE_SPAWN_NEW_ALPHA.Value && Plugin.FlamingoConfig.CAN_SPAWN_ALPHA.Value) { SpawnNewAlphaFlamingo(); } } } public void SpawnNewAlphaFlamingo() { //IL_0060: 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_0072: 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_00a0: Unknown result type (might be due to invalid IL or missing references) List list = new List(); SelectableLevel currentLevel = RoundManager.Instance.currentLevel; list.AddRange(RoundManager.Instance.currentLevel.Enemies); SpawnableEnemyWithRarity val = list.Find((SpawnableEnemyWithRarity x) => x.enemyType.enemyName.ToLower() == "scp1507alpha"); if (val != null) { GameObject val2 = NetworkObjectReference.op_Implicit(RoundManager.Instance.SpawnEnemyGameObject(RoundManager.Instance.GetRandomNavMeshPositionInRadius(((Component)this).transform.position, 10f, default(NavMeshHit)), (float)Random.RandomRangeInt(0, 360), RoundManager.Instance.currentLevel.Enemies.IndexOf(val), val.enemyType)); val2.GetComponent().StartCallAlphaClientRpc(alphaId); } } public void ActivateRampage() { ((MonoBehaviour)this).StartCoroutine(OrderRampage()); } [IteratorStateMachine(typeof(d__9))] private IEnumerator OrderRampage() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0) { <>4__this = this }; } public void StartCrusade() { MonsterLogger("Calling Crusade! "); Scp1507[] array = Object.FindObjectsOfType(); foreach (Scp1507 scp in array) { ((MonoBehaviour)this).StartCoroutine(OrderCrusade()); } } [IteratorStateMachine(typeof(d__11))] private IEnumerator OrderCrusade() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0) { <>4__this = this }; } public void StopMoving() { Scp1507[] array = Object.FindObjectsOfType(); foreach (Scp1507 scp in array) { ((MonoBehaviour)this).StartCoroutine(OrderStop()); } } [IteratorStateMachine(typeof(d__13))] private IEnumerator OrderStop() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0) { <>4__this = this }; } [ServerRpc(RequireOwnership = false)] public void GiveServerAngerServerRpc(ulong clientId, int anger) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: 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_0096: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1748763037u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clientId); BytePacker.WriteValueBitPacked(val2, anger); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1748763037u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; try { PlayerRecord playerByClientId = GetPlayerByClientId(clientId); playerByClientId.AngerMeter = anger; MonsterLogger("Player is " + playerByClientId.AngerMeter); } catch (KeyNotFoundException value) { Console.WriteLine(value); listOfAnger.Add(new PlayerRecord(clientId, anger)); } } [ClientRpc] public void StartLookAtCoroutineClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: 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_007c: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(100667040u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 100667040u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (beingLookedAtCoroutine == null) { beingLookedAtCoroutine = ((MonoBehaviour)this).StartCoroutine(CheckIfLookedCoroutine()); } } } [ClientRpc] public void PlayAnimationClientRpc(string animationName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: 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_0088: 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_00ff: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(81093682u, val, (RpcDelivery)0); bool flag = animationName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(animationName, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 81093682u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureAnimator.SetTrigger(animationName); } } [ClientRpc] public void PlayAnimationClientRpc(string animationName, bool value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Invalid comparison between Unknown and I4 //IL_005f: 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_0088: 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_011a: 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_00c1: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3413923772u, val, (RpcDelivery)0); bool flag = animationName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(animationName, false); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3413923772u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureAnimator.SetBool(animationName, value); } } private void Awake() { numberOfFlamingos = 0; damage = Plugin.FlamingoConfig.DAMAGE_NORMAL.Value; alphaId = RandomNumberGenerator.GetInt32(1000); localAnger = 0; listOfAnger = new List(); } public override void Start() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown ((EnemyAI)this).Start(); localPlayer = RoundManager.Instance.playersManager.localPlayerController; localPlayerId = localPlayer.playerClientId; StartAlphaSearch(); attackCooldownBeheader = attackCooldown; attackCooldown = 0f; PlayAnimationClientRpc("IsAlpha", value: true); if ((Object)(object)global::SCP1507.FlamingoManager.FlamingoManager.Instance == (Object)null) { GameObject val = new GameObject("Scp1507Manager"); val.AddComponent(); } } private void LateUpdate() { //IL_003f: 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) if (!base.isEnemyDead) { if ((Object)(object)Scp1507AlphaTargetPlayer != (Object)null) { lookAt.position = Scp1507AlphaTargetPlayer.playerEye.position; } else { lookAt.position = defaultLookAt.position; } } attackCooldown += Time.deltaTime; } public override void DoAIInterval() { //IL_0111: 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_0132: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); switch (base.currentBehaviourStateIndex) { case 0: base.agent.isStopped = true; PlayAnimationClientRpc("Walking", value: false); if (!CheckIfAPlayerHasVisionToCurrentPosition()) { ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } if (FindAlphaTarget()) { StartCrusade(); ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } break; case 1: base.agent.isStopped = false; PlayAnimationClientRpc("Walking", value: true); if (CheckIfAPlayerHasVisionToCurrentPosition()) { ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } if (FindAlphaTarget()) { StartCrusade(); ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } if (RandomNumberGenerator.GetInt32(100) <= Plugin.FlamingoConfig.CHANCE_SPAWN_NEW_FLAMINGO.Value && numberOfFlamingos <= Plugin.FlamingoConfig.MAXIMUM_NUMBER_OF_FLAMINGO.Value) { SpawnNewFlamingo(); } break; case 2: base.agent.isStopped = false; ((MonoBehaviour)this).StopCoroutine(base.searchCoroutine); PlayAnimationClientRpc("Walking", value: true); base.agent.SetDestination(((Component)Scp1507AlphaTargetPlayer).transform.position); if (Vector3.Distance(((Component)this).transform.position, ((Component)Scp1507AlphaTargetPlayer).transform.position) < 1.2f && attackCooldown >= attackCooldownBeheader) { PlayAnimationClientRpc("Attack"); } if (!Scp1507AlphaTargetPlayer.isInsideFactory || Scp1507AlphaTargetPlayer.isPlayerDead) { base.agent.ResetPath(); StartAlphaSearch(); StopMoving(); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } break; default: MonsterLogger("WRONG BEHAVIOUR STATE INDEX!", reportable: true); break; } } private bool CheckIfPlayerDances() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts; int num = 0; if (num < allPlayerScripts.Length) { PlayerControllerB val = allPlayerScripts[num]; if (Vector3.Distance(((Component)val).transform.position, ((Component)this).transform.position) < 6f && val.performingEmote) { return true; } } return false; } private void StartAlphaSearch() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (base.searchCoroutine == null) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } } private bool FindAlphaTarget() { if (listOfAnger == null) { MonsterLogger("List of Anger is null", reportable: true); return false; } int num = 0; PlayerRecord playerRecord = null; foreach (PlayerRecord item in listOfAnger) { if (item == null) { MonsterLogger("Encounteed a null value Entry", reportable: true); } else if (item.Angered && num < item.AngerMeter) { num = item.AngerMeter; playerRecord = item; } } if (playerRecord == null) { return false; } Scp1507AlphaTargetPlayer = playerRecord.PlayerControllerB; return true; } private bool CheckIfAPlayerHasVisionToCurrentPosition() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (val.HasLineOfSightToPosition(((Component)this).transform.position, 45f, 60, -1f, -1)) { isSeen = true; return true; } } return false; } private bool CheckIfLocalPlayerHasVisionToCurrentPosition_ONEPLAYER() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) if (localPlayer.HasLineOfSightToPosition(((Component)this).transform.position, 45f, 60, -1f, -1)) { isSeen = true; return true; } return false; } [IteratorStateMachine(typeof(d__52))] private IEnumerator CheckIfLookedCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__52(0) { <>4__this = this }; } public void AddToAnger(int x) { localAnger += x; GiveServerAngerServerRpc(localPlayerId, localAnger); } public void SetToAnger(int x) { localAnger = x; GiveServerAngerServerRpc(localPlayerId, localAnger); } public void RemoveToAnger(int x) { localAnger -= x; GiveServerAngerServerRpc(localPlayerId, localAnger); } private PlayerRecord? GetPlayerByClientId(ulong clientId) { for (int i = 0; i < listOfAnger.Count; i++) { if (listOfAnger[i].ClientId == clientId) { return listOfAnger[i]; } } throw new KeyNotFoundException("Player with the given ClientId was not found. CREATING NEW PROFILE"); } private void MonsterLogger(string message, bool reportable = false) { if (!reportable) { Plugin.Logger.Log((LogLevel)16, (object)("[ProjectSCP.SCP1507][SCP1507Alpha][" + (reportable ? "PLEASE REPORT TO US IN THE DISCORD CHANNEL" : "Don't Report") + "] ~ " + message)); } else { Plugin.Logger.Log((LogLevel)2, (object)("[ProjectSCP.SCP1507][SCP1507Alpha][" + (reportable ? "PLEASE REPORT TO US IN THE DISCORD CHANNEL" : "Don't Report") + "] ~ " + message)); } } public override void OnDestroy() { ((EnemyAI)this).OnDestroy(); } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if ((Object)(object)playerWhoHit != (Object)null) { GiveServerAngerServerRpc(playerWhoHit.actualClientId, 20); } if (base.isEnemyDead) { return; } base.enemyHP -= force; if (((NetworkBehaviour)this).IsOwner && base.enemyHP <= 0 && !base.isEnemyDead) { if (base.searchCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(base.searchCoroutine); } ((EnemyAI)this).KillEnemyOnOwnerClient(false); ActivateRampage(); } } [ClientRpc] public void SwingAttackHitClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: 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_007c: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4249217996u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4249217996u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; int num = 8; Collider[] array = Physics.OverlapBox(AttackArea.position, AttackArea.localScale, Quaternion.identity, num); if (array.Length != 0) { Collider[] array2 = array; foreach (Collider val3 in array2) { PlayerControllerB val4 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val3, false, false); if ((Object)(object)val4 != (Object)null) { DoAttackSound(); KillCoroutine = ((MonoBehaviour)this).StartCoroutine(DamagePlayerCoroutine(val4)); } } } attackCooldown = 0f; } [IteratorStateMachine(typeof(d__61))] private IEnumerator DamagePlayerCoroutine(PlayerControllerB playerControllerB) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__61(0) { <>4__this = this, playerControllerB = playerControllerB }; } protected override void __initializeVariables() { if (_playerNetVar == null) { throw new Exception("Scp1507Alpha._playerNetVar cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)_playerNetVar).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)_playerNetVar, "_playerNetVar"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)_playerNetVar); ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1748763037u, new RpcReceiveHandler(__rpc_handler_1748763037), "GiveServerAngerServerRpc"); ((NetworkBehaviour)this).__registerRpc(100667040u, new RpcReceiveHandler(__rpc_handler_100667040), "StartLookAtCoroutineClientRpc"); ((NetworkBehaviour)this).__registerRpc(81093682u, new RpcReceiveHandler(__rpc_handler_81093682), "PlayAnimationClientRpc"); ((NetworkBehaviour)this).__registerRpc(3413923772u, new RpcReceiveHandler(__rpc_handler_3413923772), "PlayAnimationClientRpc"); ((NetworkBehaviour)this).__registerRpc(4249217996u, new RpcReceiveHandler(__rpc_handler_4249217996), "SwingAttackHitClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_1748763037(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0043: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong clientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref clientId); int anger = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref anger); target.__rpc_exec_stage = (__RpcExecStage)1; ((Scp1507Alpha)(object)target).GiveServerAngerServerRpc(clientId, anger); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_100667040(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Scp1507Alpha)(object)target).StartLookAtCoroutineClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_81093682(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_0061: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string animationName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Scp1507Alpha)(object)target).PlayAnimationClientRpc(animationName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3413923772(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_0067: 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_009a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string animationName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationName, false); } bool value = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref value, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Scp1507Alpha)(object)target).PlayAnimationClientRpc(animationName, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4249217996(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Scp1507Alpha)(object)target).SwingAttackHitClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Scp1507Alpha"; } } public class DoorHold { private DoorLock door; private int numberOfHits; private bool canBreak; public DoorLock Door => door; public bool CanBreak => canBreak; public int NumberOfHits { get { return numberOfHits; } set { numberOfHits = value; if (numberOfHits >= 10) { canBreak = true; } } } public DoorHold(DoorLock door) { this.door = door; numberOfHits = 1; } } public enum StateA { Seen, Walking, Targeting } } namespace SCP1507.Configurations { [Serializable] public class Config : SyncedInstance { public ConfigEntry MAXIMUM_NUMBER_OF_FLAMINGO { get; private set; } public ConfigEntry CAN_SPAWN_ALPHA { get; private set; } public ConfigEntry CHANCE_SPAWN_NEW_FLAMINGO { get; private set; } public ConfigEntry RARITY_ALPHA { get; private set; } public ConfigEntry CHANCE_SPAWN_NEW_ALPHA { get; private set; } public ConfigEntry DAMAGE_ALPHA { get; private set; } public ConfigEntry DAMAGE_NORMAL { get; private set; } public ConfigEntry ANGER_FOR_ANGRY_FLAMINGO { get; private set; } public ConfigEntry CUSTOM_HAT { get; private set; } public Config(ConfigFile cfg) { InitInstance(this); MAXIMUM_NUMBER_OF_FLAMINGO = cfg.Bind("Flamingo Spawn", "Maximum number of flamingo!", 30, "This value defines the number of flamingo there can be on the map. It does not take alpha's into account"); CAN_SPAWN_ALPHA = cfg.Bind("Flamingo Spawn", "Can alpha spawn alpha?", false, "Enabling this option will make alpha able to spawn other alpha's. This can go out of hand quickly"); CHANCE_SPAWN_NEW_FLAMINGO = cfg.Bind("Flamingo Spawn", "Spawn speed flamingo", 4, "Every 0.2 seconds, the alpha will generate a number between 0 and 100. If the number generated is lower than the value specified, he will spawn a new flamingo. The higher this value the more likely a flamingo will spawn. Do not"); RARITY_ALPHA = cfg.Bind("Flamingo Spawn", "Rarity alpha flamingo", 40, "This is the rarity for an alpha flamingo to spawn direcly registered into the game"); CHANCE_SPAWN_NEW_ALPHA = cfg.Bind("Flamingo Spawn", "Chances to spawn a new alpha by alpha", 10, "Whenever a flamingo is summoned this is the chance for it to summon an additional alpha flamingo. See Spawn speed flamingo for how this value works."); DAMAGE_ALPHA = cfg.Bind("Stats", "Chances to spawn alpha", 20, "What are the chance for an alpha to spawn when spawning a new flamingo"); DAMAGE_NORMAL = cfg.Bind("Stats", "Chances to spawn alpha", 5, "This is the amount of raw damage dealt by flamingo"); ANGER_FOR_ANGRY_FLAMINGO = cfg.Bind("Anger", "Anger before flamingos are angry", 10, "This is the amount of anger before the flamingo's are angry"); CUSTOM_HAT = cfg.Bind("Cosmetics", "Can flamingos have custom hat?", true, "True = yes, false = no"); } public static void RequestSync() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (!SyncedInstance.IsClient) { return; } FastBufferWriter val = default(FastBufferWriter); ((FastBufferWriter)(ref val))..ctor(SyncedInstance.IntSize, (Allocator)2, -1); try { SyncedInstance.MessageManager.SendNamedMessage("Xilef992SCP1507_OnRequestConfigSync", 0uL, val, (NetworkDelivery)3); } finally { ((IDisposable)(FastBufferWriter)(ref val)).Dispose(); } } public static void OnRequestSync(ulong clientId, FastBufferReader _) { //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_0068: Unknown result type (might be due to invalid IL or missing references) if (!SyncedInstance.IsHost) { return; } Plugin.Logger.LogInfo((object)$"Config sync request received from client: {clientId}"); byte[] array = SyncedInstance.SerializeToBytes(SyncedInstance.Instance); int num = array.Length; FastBufferWriter val = default(FastBufferWriter); ((FastBufferWriter)(ref val))..ctor(num + SyncedInstance.IntSize, (Allocator)2, -1); try { ((FastBufferWriter)(ref val)).WriteValueSafe(ref num, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteBytesSafe(array, -1, 0); SyncedInstance.MessageManager.SendNamedMessage("Xilef992SCP1507_OnReceiveConfigSync", clientId, val, (NetworkDelivery)3); } catch (Exception arg) { Plugin.Logger.LogInfo((object)$"Error occurred syncing config with client: {clientId}\n{arg}"); } finally { ((IDisposable)(FastBufferWriter)(ref val)).Dispose(); } } public static void OnReceiveSync(ulong _, FastBufferReader reader) { //IL_0024: 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) if (!((FastBufferReader)(ref reader)).TryBeginRead(SyncedInstance.IntSize)) { Plugin.Logger.LogError((object)"Config sync error: Could not begin reading buffer."); return; } int num = default(int); ((FastBufferReader)(ref reader)).ReadValueSafe(ref num, default(ForPrimitives)); if (!((FastBufferReader)(ref reader)).TryBeginRead(num)) { Plugin.Logger.LogError((object)"Config sync error: Host could not sync."); return; } byte[] data = new byte[num]; ((FastBufferReader)(ref reader)).ReadBytesSafe(ref data, num, 0); SyncedInstance.SyncInstance(data); Plugin.Logger.LogInfo((object)"Successfully synced config with host."); } } public static class ConfigurationsPatch { [CompilerGenerated] private static class <>O { public static HandleNamedMessageDelegate <0>__OnRequestSync; public static HandleNamedMessageDelegate <1>__OnReceiveSync; } [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] public static void InitializeLocalPlayer() { //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_0068: Expected O, but got Unknown //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_0031: Expected O, but got Unknown if (((NetworkBehaviour)RoundManager.Instance).IsHost) { CustomMessagingManager messageManager = SyncedInstance.MessageManager; object obj = <>O.<0>__OnRequestSync; if (obj == null) { HandleNamedMessageDelegate val = Config.OnRequestSync; <>O.<0>__OnRequestSync = val; obj = (object)val; } messageManager.RegisterNamedMessageHandler("SCP1507_OnRequestConfigSync", (HandleNamedMessageDelegate)obj); SyncedInstance.Synced = true; return; } SyncedInstance.Synced = false; CustomMessagingManager messageManager2 = SyncedInstance.MessageManager; object obj2 = <>O.<1>__OnReceiveSync; if (obj2 == null) { HandleNamedMessageDelegate val2 = Config.OnReceiveSync; <>O.<1>__OnReceiveSync = val2; obj2 = (object)val2; } messageManager2.RegisterNamedMessageHandler("SCP1507_OnReceiveConfigSync", (HandleNamedMessageDelegate)obj2); Config.RequestSync(); } [HarmonyPostfix] [HarmonyPatch(typeof(GameNetworkManager), "StartDisconnect")] public static void PlayerLeave() { SyncedInstance.RevertSync(); } } public class SyncedInstance { [NonSerialized] protected static int IntSize = 4; internal static CustomMessagingManager MessageManager => NetworkManager.Singleton.CustomMessagingManager; internal static bool IsClient => NetworkManager.Singleton.IsClient; internal static bool IsHost => NetworkManager.Singleton.IsHost; public static T Default { get; private set; } public static T Instance { get; private set; } public static bool Synced { get; internal set; } protected void InitInstance(T instance) { Default = instance; Instance = instance; IntSize = 4; } internal static void SyncInstance(byte[] data) { Instance = DeserializeFromBytes(data); Synced = true; } internal static void RevertSync() { Instance = Default; Synced = false; } public static byte[] SerializeToBytes(T val) { BinaryFormatter binaryFormatter = new BinaryFormatter(); using MemoryStream memoryStream = new MemoryStream(); try { binaryFormatter.Serialize(memoryStream, val); return memoryStream.ToArray(); } catch (Exception arg) { Debug.Log((object)$"Error serializing instance: {arg}"); return null; } } public static T DeserializeFromBytes(byte[] data) { BinaryFormatter binaryFormatter = new BinaryFormatter(); using MemoryStream serializationStream = new MemoryStream(data); try { return (T)binaryFormatter.Deserialize(serializationStream); } catch (Exception arg) { Debug.Log((object)$"Error deserializing instance: {arg}"); return default(T); } } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedINetworkSerializable(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); } } } namespace ProjectSCP.SCP1507.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }