using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using CSync.Lib;
using CSync.Util;
using GameNetcodeStuff;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using NightmareFoxy.NetcodePatcher;
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("NightmareFoxy")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("This is nightmare Foxy from the FNAF 4")]
[assembly: AssemblyFileVersion("1.1.5.0")]
[assembly: AssemblyInformationalVersion("1.1.5+fec2fcd5e3e627aaed9204ead1f2c354cdda4d32")]
[assembly: AssemblyProduct("NightmareFoxy")]
[assembly: AssemblyTitle("NightmareFoxy")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.5.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
static <Module>()
{
}
}
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[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 ExampleEnemy
{
public class FoxyAi : EnemyAI
{
private enum State
{
Down,
Standing,
ChargePose,
Running,
Seen,
Jumping
}
public AudioSource howlingAudioSRC;
public ParticleSystem footSpeed;
public Light eyesLight;
public AudioClip portalSFX;
public AudioClip deactivate;
public AudioClip activate;
public BoxCollider foxyCollider;
[Header("Engine Stuff")]
public AudioSource engine;
public AudioClip idle1;
public AudioClip idle2;
[Header("Whenseen")]
public AudioClip fallOnKnee;
public AudioClip fallOnBody;
public AudioClip fallOnKneeVariant;
public AudioClip destroyDoor;
public AudioClip train;
[Header("Footstep")]
public AudioSource footStepAudio;
public AudioClip footStep1;
public AudioClip footStep2;
public AudioClip footStep3;
public AudioClip footStep4;
[Header("Kill Animation")]
public AudioClip[] killAnimationSound;
public AudioClip[] howlAudioSounds;
public Transform killZone;
public Material foxEyes;
private int generatedNumber;
private bool justSwitchedBehaviour;
private float timer;
private bool startedHowling;
private float duration = 3f;
private float currentDuration;
private float oldspeed;
private PlayerControllerB localPlayer;
public List<DoorLock> doorLocked;
public override void Start()
{
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
((EnemyAI)this).Start();
duration = SyncedInstance<FoxyConfig>.Instance.TIME_TO_SLOW_DOWN.Value;
foxEyes.SetFloat("_Strenght", 0f);
base.agent.angularSpeed = 10000f;
justSwitchedBehaviour = false;
timer = 0f;
foxyCollider.size = new Vector3(4.531483f, 21.24057f, 5.783448f);
base.agent.updateRotation = true;
localPlayer = RoundManager.Instance.playersManager.localPlayerController;
}
public override void Update()
{
((EnemyAI)this).Update();
if (justSwitchedBehaviour)
{
timer += Time.deltaTime;
if (timer >= 5f)
{
timer = 0f;
justSwitchedBehaviour = false;
}
}
}
public override void DoAIInterval()
{
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_0137: Unknown result type (might be due to invalid IL or missing references)
//IL_0147: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
//IL_02de: Unknown result type (might be due to invalid IL or missing references)
//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
//IL_052c: Unknown result type (might be due to invalid IL or missing references)
//IL_0531: Unknown result type (might be due to invalid IL or missing references)
//IL_0535: Unknown result type (might be due to invalid IL or missing references)
//IL_053a: Unknown result type (might be due to invalid IL or missing references)
//IL_0550: Unknown result type (might be due to invalid IL or missing references)
//IL_059f: Unknown result type (might be due to invalid IL or missing references)
//IL_05a4: Unknown result type (might be due to invalid IL or missing references)
//IL_05a8: Unknown result type (might be due to invalid IL or missing references)
//IL_05ad: Unknown result type (might be due to invalid IL or missing references)
//IL_0396: Unknown result type (might be due to invalid IL or missing references)
//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
((EnemyAI)this).DoAIInterval();
if (((NetworkBehaviour)this).IsHost)
{
if (!justSwitchedBehaviour)
{
generatedNumber = RandomNumberGenerator.GetInt32(1, SyncedInstance<FoxyConfig>.Instance.CHANCE_NEXT_PHASE.Value);
}
else
{
generatedNumber = 100;
}
}
switch (base.currentBehaviourStateIndex)
{
case 0:
footSpeed.Stop();
engine.Stop();
base.movingTowardsTargetPlayer = false;
base.agent.isStopped = true;
base.agent.ResetPath();
base.targetPlayer = null;
base.creatureAnimator.speed = 1f;
footSpeed.Stop();
if (((NetworkBehaviour)this).IsHost && generatedNumber <= 1)
{
((EnemyAI)this).SwitchToBehaviourClientRpc(1);
engine.PlayOneShot(portalSFX);
}
break;
case 1:
footSpeed.Stop();
foxyCollider.size = new Vector3(foxyCollider.size.x, foxyCollider.size.y, 6.619311f);
foxyCollider.center = new Vector3(foxyCollider.center.x, foxyCollider.center.y, 0.8878318f);
base.creatureAnimator.speed = 1f;
base.agent.isStopped = true;
base.agent.ResetPath();
if (generatedNumber <= 1)
{
((EnemyAI)this).SwitchToBehaviourClientRpc(2);
((MonoBehaviour)this).StartCoroutine(EyesManager(opening: true));
}
break;
case 2:
if (!engine.isPlaying)
{
engine.clip = idle1;
engine.Play(3uL);
engine.loop = true;
}
base.creatureAnimator.speed = 1f;
base.agent.isStopped = true;
base.agent.ResetPath();
if (generatedNumber <= 2 && !startedHowling)
{
engine.clip = idle2;
base.creatureAnimator.speed = 0f;
base.agent.speed = 0f;
engine.Play();
startedHowling = true;
if (((NetworkBehaviour)this).IsHost)
{
((MonoBehaviour)this).StartCoroutine(CloseHunt(RandomNumberGenerator.GetInt32(SyncedInstance<FoxyConfig>.Instance.MIN_AMOUNT_HOWL.Value, SyncedInstance<FoxyConfig>.Instance.MAX_AMOUNT_HOWL.Value)));
}
}
break;
case 3:
foxyCollider.size = new Vector3(foxyCollider.size.x, foxyCollider.size.y, 30f);
foxyCollider.center = new Vector3(foxyCollider.center.x, foxyCollider.center.y, 12.56404f);
if ((Object)(object)base.targetPlayer == (Object)null || base.targetPlayer.isPlayerDead || !base.targetPlayer.isInsideFactory)
{
if (((NetworkBehaviour)this).IsHost)
{
FetchTarget();
}
if ((Object)(object)base.targetPlayer == (Object)null)
{
((EnemyAI)this).SwitchToBehaviourClientRpc(4);
((MonoBehaviour)this).StartCoroutine(EyesManager(opening: false));
break;
}
}
Debug.Log((object)base.targetPlayer.isInsideFactory);
if (!base.targetPlayer.isInsideFactory)
{
((EnemyAI)this).SwitchToBehaviourClientRpc(0);
}
if (base.targetPlayer.HasLineOfSightToPosition(((Component)this).transform.position, 45f, 60, -1f) || !base.targetPlayer.isInsideFactory || !base.targetPlayer.isPlayerControlled || base.targetPlayer.isPlayerDead)
{
((EnemyAI)this).SwitchToBehaviourClientRpc(4);
((MonoBehaviour)this).StartCoroutine(EyesManager(opening: false));
break;
}
base.movingTowardsTargetPlayer = true;
((EnemyAI)this).SetDestinationToPosition(((Component)base.targetPlayer).transform.position, false);
if (base.agent.speed <= SyncedEntry<float>.op_Implicit(SyncedInstance<FoxyConfig>.Instance.MAX_SPEED))
{
NavMeshAgent agent = base.agent;
agent.speed += 0.1f * SyncedInstance<FoxyConfig>.Instance.SPEED_MULTIPLIER.Value;
Animator creatureAnimator = base.creatureAnimator;
creatureAnimator.speed += 0.02f * SyncedInstance<FoxyConfig>.Instance.SPEED_MULTIPLIER.Value;
}
else
{
base.creatureVoice.PlayOneShot(train);
}
BreakDoorServerRpc();
if (!footSpeed.isPlaying)
{
footSpeed.Play();
}
break;
case 4:
{
Vector3 velocity;
if (currentDuration < duration)
{
float num = currentDuration / duration;
float speed = Mathf.Lerp(base.agent.speed, 0f, num);
float speed2 = Mathf.Lerp(base.creatureAnimator.speed, 0f, num);
base.agent.speed = speed;
base.creatureAnimator.speed = speed2;
currentDuration += Time.deltaTime;
Transform transform = ((Component)this).transform;
velocity = base.agent.velocity;
transform.rotation = Quaternion.LookRotation(((Vector3)(ref velocity)).normalized);
((EnemyAI)this).SetDestinationToPosition(((Component)base.targetPlayer).transform.position, false);
}
else
{
base.agent.speed = 0f;
base.creatureAnimator.speed = 0f;
}
if (base.agent.speed <= 0.1f)
{
Transform transform2 = ((Component)this).transform;
velocity = base.agent.velocity;
transform2.rotation = Quaternion.LookRotation(((Vector3)(ref velocity)).normalized);
base.agent.ResetPath();
base.agent.speed = 0f;
base.creatureAnimator.speed = 0.8f;
DoAnimationClientRpc("GotSeen");
((MonoBehaviour)this).StartCoroutine(EyesManager(opening: false));
((EnemyAI)this).SwitchToBehaviourClientRpc(5);
footSpeed.Stop();
if (((NetworkBehaviour)this).IsHost)
{
((MonoBehaviour)this).StartCoroutine(WaitAndGoBackUp(RandomNumberGenerator.GetInt32(10, 30)));
}
}
break;
}
default:
if (((NetworkBehaviour)this).IsHost)
{
((EnemyAI)this).SwitchToBehaviourClientRpc(1);
}
break;
case 5:
break;
}
}
private IEnumerator CloseHunt(int howling)
{
int howlingStore = howling;
yield return (object)new WaitForSeconds(4f);
while (howlingStore > 0)
{
HowlClientRpc();
yield return (object)new WaitForSeconds(3f);
howlingStore--;
}
startedHowling = false;
base.creatureAnimator.speed = 0f;
base.agent.speed = 0f;
((EnemyAI)this).SwitchToBehaviourClientRpc(3);
UnlockAllDoorClientRpc();
}
private IEnumerator WaitAndGoBackUp(int x)
{
base.movingTowardsTargetPlayer = false;
base.agent.isStopped = true;
base.agent.ResetPath();
base.agent.speed = 0f;
yield return (object)new WaitForSeconds((float)x);
((EnemyAI)this).SwitchToBehaviourClientRpc(0);
}
private IEnumerator EyesManager(bool opening)
{
float num = (opening ? 2f : 0f);
float num2 = (opening ? 0f : 2f);
if (opening)
{
engine.PlayOneShot(activate);
}
else
{
engine.PlayOneShot(deactivate);
}
bool flag = true;
float num3 = 0f;
while (flag)
{
foxEyes.SetFloat("_Strenght", Mathf.Lerp(num2, num, num3 / 10f));
num3 += Time.deltaTime;
if (foxEyes.GetFloat("_Strenght") == num)
{
break;
}
}
yield break;
}
public override void OnCollideWithPlayer(Collider other)
{
//IL_0197: Unknown result type (might be due to invalid IL or missing references)
//IL_019d: Unknown result type (might be due to invalid IL or missing references)
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_015c: Unknown result type (might be due to invalid IL or missing references)
PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false);
if ((Object)(object)val == (Object)(object)base.targetPlayer)
{
if (3 == base.currentBehaviourStateIndex)
{
Debug.Log((object)"Agent has reached the destination!");
((EnemyAI)this).SwitchToBehaviourClientRpc(5);
base.agent.speed = 0f;
((MonoBehaviour)this).StartCoroutine(FoxyKills(base.targetPlayer));
}
if (4 == base.currentBehaviourStateIndex)
{
if (base.agent.speed >= SyncedInstance<FoxyConfig>.Instance.MAX_SPEED.Value / (100f / SyncedInstance<FoxyConfig>.Instance.SPEED_FOXY_KILLS.Value))
{
Debug.Log((object)("Agent has reached the destination. Current Speed = " + base.agent.speed));
((EnemyAI)this).SwitchToBehaviourClientRpc(5);
base.agent.speed = 0f;
((MonoBehaviour)this).StartCoroutine(FoxyKills(base.targetPlayer));
}
else if (base.agent.speed >= SyncedInstance<FoxyConfig>.Instance.MAX_SPEED.Value / (100f / SyncedInstance<FoxyConfig>.Instance.SPEED_FOXY_DAMAGES.Value))
{
Debug.Log((object)("Agent has reached the destination. Current speed to low = " + base.agent.speed));
base.targetPlayer.DamagePlayer(SyncedInstance<FoxyConfig>.Instance.FOXY_DAMAGES.Value, true, true, (CauseOfDeath)0, 0, false, default(Vector3));
base.agent.speed = 0f;
}
}
}
else if (3 == base.currentBehaviourStateIndex)
{
if (base.agent.speed > 5f)
{
val.DamagePlayer(2, true, true, (CauseOfDeath)0, 0, false, default(Vector3));
}
}
else if (4 == base.currentBehaviourStateIndex && base.agent.speed > 2f)
{
val.DamagePlayer(1, true, true, (CauseOfDeath)0, 0, false, default(Vector3));
}
}
public void FetchTarget()
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Expected O, but got Unknown
//IL_0038: 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)
List<string> list = new List<string>();
PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts;
foreach (PlayerControllerB val in allPlayerScripts)
{
if (val.isInsideFactory)
{
NavMeshPath val2 = new NavMeshPath();
if (NavMesh.CalculatePath(((Component)base.agent).transform.position, ((Component)val).transform.position, -1, val2))
{
list.Add(((Object)val).name);
}
}
}
if (list.Count > 0)
{
SetTargetPlayerClientRpc(list[RandomNumberGenerator.GetInt32(0, list.Count)]);
base.agent.speed = 0f;
base.creatureAnimator.speed = 0f;
}
else
{
base.targetPlayer = null;
SetTargetPlayerClientRpc("NoneCode1234567890");
}
}
public void FootStepHandler()
{
if (localPlayer.isInsideFactory)
{
switch (RandomNumberGenerator.GetInt32(0, 4))
{
case 0:
footStepAudio.PlayOneShot(footStep1);
break;
case 1:
footStepAudio.PlayOneShot(footStep2);
break;
case 2:
footStepAudio.PlayOneShot(footStep3);
break;
case 3:
footStepAudio.PlayOneShot(footStep4);
break;
}
}
}
public void FallOnKnee()
{
if (RandomNumberGenerator.GetInt32(0, 101) != 0)
{
base.creatureVoice.PlayOneShot(fallOnKnee);
}
else
{
base.creatureVoice.PlayOneShot(fallOnKneeVariant);
}
}
public void FallOnBody()
{
base.creatureVoice.PlayOneShot(fallOnBody);
}
private IEnumerator FoxyKills(PlayerControllerB player)
{
((EnemyAI)this).SwitchToBehaviourClientRpc(5);
base.agent.speed = 0f;
base.creatureAnimator.speed = 1f;
base.movingTowardsTargetPlayer = false;
base.agent.isStopped = true;
base.agent.ResetPath();
oldspeed = player.movementSpeed;
player.movementSpeed = 0f;
((MonoBehaviour)this).StartCoroutine(RotatePlayerToMe(player));
((Component)this).transform.LookAt(((Component)player).transform.position, Vector3.up);
DoAnimationClientRpc("Kill");
yield return (object)new WaitForSeconds(5f);
player.movementSpeed = oldspeed;
engine.Stop();
footSpeed.Stop();
}
private IEnumerator RotatePlayerToMe(PlayerControllerB PCB)
{
if (Object.op_Implicit((Object)(object)PCB))
{
Vector3 Position = ((Component)this).transform.position - ((Component)PCB).gameObject.transform.position;
while (PCB.health != 0)
{
PlayerSmoothLookAt(Position, PCB);
yield return null;
}
}
}
private void PlayerSmoothLookAt(Vector3 newDirection, PlayerControllerB PCB)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
((Component)PCB).gameObject.transform.rotation = Quaternion.Lerp(((Component)PCB).gameObject.transform.rotation, Quaternion.LookRotation(newDirection), Time.deltaTime * 5f);
}
[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_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3511689484u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3511689484u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost) || base.currentBehaviourStateIndex != 3)
{
return;
}
int num = 8;
Collider[] array = Physics.OverlapBox(killZone.position, killZone.localScale, Quaternion.identity, num);
if (array.Length == 0)
{
return;
}
Collider[] array2 = array;
foreach (Collider val3 in array2)
{
Debug.Log((object)"Player In punishable zone!");
PlayerControllerB val4 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val3, false, false);
if ((Object)(object)val4 != (Object)null && (Object)(object)val4 == (Object)(object)base.targetPlayer)
{
base.agent.speed = 0f;
base.agent.ResetPath();
base.creatureAnimator.speed = 1.5f;
((EnemyAI)this).SwitchToBehaviourClientRpc(5);
((MonoBehaviour)this).StartCoroutine(FoxyKills(base.targetPlayer));
}
}
}
[ClientRpc]
public void KillTargetPlayerClientRpc()
{
//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_00c8: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1615635752u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1615635752u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
((EnemyAI)this).SwitchToBehaviourClientRpc(1);
base.targetPlayer.KillPlayer(Vector3.back, true, (CauseOfDeath)1, 2);
base.targetPlayer = null;
}
}
}
[ClientRpc]
public void DoAnimationClientRpc(string x)
{
//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_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 != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3968041817u, val, (RpcDelivery)0);
bool flag = x != null;
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
if (flag)
{
((FastBufferWriter)(ref val2)).WriteValueSafe(x, false);
}
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3968041817u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
base.creatureAnimator.SetTrigger(x);
}
}
public void PlayKillSound(int x)
{
base.creatureVoice.PlayOneShot(killAnimationSound[x]);
}
[ClientRpc]
public void SetTargetPlayerClientRpc(string name)
{
//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_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 != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(124945276u, val, (RpcDelivery)0);
bool flag = name != null;
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
if (flag)
{
((FastBufferWriter)(ref val2)).WriteValueSafe(name, false);
}
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 124945276u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
if (name == "NoneCode1234567890")
{
base.targetPlayer = null;
}
PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts;
foreach (PlayerControllerB val3 in allPlayerScripts)
{
if (((Object)val3).name == name)
{
base.targetPlayer = val3;
}
}
}
[ClientRpc]
public void HowlClientRpc()
{
//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)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1082449678u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1082449678u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
int num = 200;
if (num == 0)
{
howlingAudioSRC.PlayOneShot(howlAudioSounds[2]);
}
else if (num <= 120)
{
howlingAudioSRC.PlayOneShot(howlAudioSounds[1]);
}
else
{
howlingAudioSRC.PlayOneShot(howlAudioSounds[0]);
}
}
}
[ClientRpc]
public void UnlockAllDoorClientRpc()
{
//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)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1674194139u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1674194139u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
DoorLock[] array = Object.FindObjectsOfType(typeof(DoorLock)) as DoorLock[];
foreach (DoorLock val3 in array)
{
if (val3.isLocked)
{
doorLocked.Add(val3);
val3.UnlockDoorClientRpc();
val3.isLocked = false;
}
}
}
[ServerRpc]
public void BreakDoorServerRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Invalid comparison between Unknown and I4
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Invalid comparison between Unknown and I4
//IL_0159: Unknown result type (might be due to invalid IL or missing references)
//IL_0164: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_0187: Unknown result type (might be due to invalid IL or missing references)
//IL_0192: Unknown result type (might be due to invalid IL or missing references)
//IL_0197: Unknown result type (might be due to invalid IL or missing references)
//IL_019c: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
return;
}
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(995844436u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 995844436u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
{
return;
}
DoorLock[] array = Object.FindObjectsOfType(typeof(DoorLock)) as DoorLock[];
foreach (DoorLock val3 in array)
{
try
{
GameObject gameObject = ((Component)((Component)((Component)((Component)val3).transform.parent).transform.parent).transform.parent).gameObject;
if (!Object.op_Implicit((Object)(object)gameObject.GetComponent<Rigidbody>()) && Vector3.Distance(((Component)this).transform.position, gameObject.transform.position) <= 4f)
{
NetworkObjectReference netObjRef = NetworkObjectReference.op_Implicit(gameObject);
Vector3 val4 = ((Component)base.targetPlayer).transform.position - ((Component)this).transform.position;
BashDoorClientRpc(netObjRef, ((Vector3)(ref val4)).normalized * 20f);
}
}
catch (NullReferenceException)
{
try
{
val3.OpenDoorAsEnemyClientRpc();
}
catch (Exception ex)
{
Debug.Log((object)("The doors are not formated the right way and as such foxy 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_013d: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(381373278u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable));
((FastBufferWriter)(ref val2)).WriteValueSafe(ref Position);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 381373278u, val, (RpcDelivery)0);
}
NetworkObject val3 = default(NetworkObject);
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null))
{
GameObject gameObject = ((Component)val3).gameObject;
Rigidbody val4 = gameObject.AddComponent<Rigidbody>();
AudioSource obj = gameObject.AddComponent<AudioSource>();
obj.spatialBlend = 1f;
obj.maxDistance = 60f;
obj.rolloffMode = (AudioRolloffMode)1;
obj.volume = 1f;
((MonoBehaviour)this).StartCoroutine(TurnOffC(val4, 0.12f));
val4.AddForce(Position, (ForceMode)1);
obj.PlayOneShot(destroyDoor);
}
}
}
private IEnumerator TurnOffC(Rigidbody rigidbody, float time)
{
rigidbody.detectCollisions = false;
yield return (object)new WaitForSeconds(time);
rigidbody.detectCollisions = true;
Object.Destroy((Object)(object)((Component)rigidbody).gameObject, 5f);
}
protected override void __initializeVariables()
{
((EnemyAI)this).__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_FoxyAi()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Expected O, but got Unknown
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Expected O, but got Unknown
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Expected O, but got Unknown
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(3511689484u, new RpcReceiveHandler(__rpc_handler_3511689484));
NetworkManager.__rpc_func_table.Add(1615635752u, new RpcReceiveHandler(__rpc_handler_1615635752));
NetworkManager.__rpc_func_table.Add(3968041817u, new RpcReceiveHandler(__rpc_handler_3968041817));
NetworkManager.__rpc_func_table.Add(124945276u, new RpcReceiveHandler(__rpc_handler_124945276));
NetworkManager.__rpc_func_table.Add(1082449678u, new RpcReceiveHandler(__rpc_handler_1082449678));
NetworkManager.__rpc_func_table.Add(1674194139u, new RpcReceiveHandler(__rpc_handler_1674194139));
NetworkManager.__rpc_func_table.Add(995844436u, new RpcReceiveHandler(__rpc_handler_995844436));
NetworkManager.__rpc_func_table.Add(381373278u, new RpcReceiveHandler(__rpc_handler_381373278));
}
private static void __rpc_handler_3511689484(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)2;
((FoxyAi)(object)target).SwingAttackHitClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1615635752(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)2;
((FoxyAi)(object)target).KillTargetPlayerClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3968041817(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<bool>(ref flag, default(ForPrimitives));
string x = null;
if (flag)
{
((FastBufferReader)(ref reader)).ReadValueSafe(ref x, false);
}
target.__rpc_exec_stage = (__RpcExecStage)2;
((FoxyAi)(object)target).DoAnimationClientRpc(x);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_124945276(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<bool>(ref flag, default(ForPrimitives));
string targetPlayerClientRpc = null;
if (flag)
{
((FastBufferReader)(ref reader)).ReadValueSafe(ref targetPlayerClientRpc, false);
}
target.__rpc_exec_stage = (__RpcExecStage)2;
((FoxyAi)(object)target).SetTargetPlayerClientRpc(targetPlayerClientRpc);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1082449678(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)2;
((FoxyAi)(object)target).HowlClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1674194139(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)2;
((FoxyAi)(object)target).UnlockAllDoorClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_995844436(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Invalid comparison between Unknown and I4
NetworkManager networkManager = target.NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
}
else
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((FoxyAi)(object)target).BreakDoorServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_381373278(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<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable));
Vector3 position = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
target.__rpc_exec_stage = (__RpcExecStage)2;
((FoxyAi)(object)target).BashDoorClientRpc(netObjRef, position);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "FoxyAi";
}
}
public class FoxyConfig : SyncedConfig<FoxyConfig>
{
[DataMember]
public SyncedEntry<float> MAX_SPEED { get; private set; }
[DataMember]
public SyncedEntry<int> CHANCE_NEXT_PHASE { get; private set; }
[DataMember]
public SyncedEntry<float> SPEED_MULTIPLIER { get; private set; }
[DataMember]
public SyncedEntry<float> TIME_TO_SLOW_DOWN { get; private set; }
[DataMember]
public SyncedEntry<int> RARITY { get; private set; }
[DataMember]
public SyncedEntry<int> MIN_AMOUNT_HOWL { get; private set; }
[DataMember]
public SyncedEntry<int> MAX_AMOUNT_HOWL { get; private set; }
[DataMember]
public SyncedEntry<float> SPEED_FOXY_KILLS { get; private set; }
[DataMember]
public SyncedEntry<float> SPEED_FOXY_DAMAGES { get; private set; }
[DataMember]
public SyncedEntry<int> FOXY_DAMAGES { get; private set; }
public FoxyConfig(ConfigFile cfg)
: base("NightmareFoxy")
{
ConfigManager.Register<FoxyConfig>(this);
MAX_SPEED = Extensions.BindSyncedEntry<float>(cfg, "Difficulty", "Maximum speed", 10f, "This is the maximum speed foxy can go at! Please note that to high might actually slow him down in the end for the game won't handle his speed properly, 20 is REALLY fast");
RARITY = Extensions.BindSyncedEntry<int>(cfg, "Spawn", "His chance rarity", 20, "Refer to other guids for better idea on how that works, I am sadly not qualified enough to explain it well");
CHANCE_NEXT_PHASE = Extensions.BindSyncedEntry<int>(cfg, "Difficulty", "His chance of going to the next phase", 125, "Every 0.2 seconds, foxy will generate a random number from 0-this number. If this number is 1, he will go to the next phase. There are four inactive state and 1 state where he chases you");
SPEED_MULTIPLIER = Extensions.BindSyncedEntry<float>(cfg, "Difficulty", "Speed multiplier", 1f, "Every 0.2 seconds, FOxy will add 0.01 to his speed which leads to him being faster and faster. This number multiplies this 0.01 directly to whatever number you want!");
TIME_TO_SLOW_DOWN = Extensions.BindSyncedEntry<float>(cfg, "Difficulty", "Slow down speed", 3f, "Time it takes in seconds for foxy to loose all his speed in seconds");
MIN_AMOUNT_HOWL = Extensions.BindSyncedEntry<int>(cfg, "Audio", "Minimum amount of Howl", 4, "This is for the howls before he starts chasing you");
MAX_AMOUNT_HOWL = Extensions.BindSyncedEntry<int>(cfg, "Audio", "Maximum amount of Howl", 7, "This is for the howls before he starts chasing you");
SPEED_FOXY_KILLS = Extensions.BindSyncedEntry<float>(cfg, "Kill Behaviour", "Seen Amount of speed needed to kill", 50f, "This is for the howls before he starts chasing you. DON'T ENTER 0, ENTER 1 INSTEAD. This is a percentage relative to Foxy's Max speed");
SPEED_FOXY_DAMAGES = Extensions.BindSyncedEntry<float>(cfg, "Kill Behaviour", "Seen Amount of speed needed to deal damage", 25f, "This is for the howls before he starts chasing you. DON'T ENTER 0, ENTER 1 instead. This is a percentage relative to Foxy's Max speed");
FOXY_DAMAGES = Extensions.BindSyncedEntry<int>(cfg, "Kill Behaviour", "Foxy Damage", 40, "Amount of damage Foxy does to you when he doesn't have the speed to kill you");
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("Xilef992NightmareFoxy", "NightmareFoxy", "1.1.5")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
public const string ModGUID = "Xilef992NightmareFoxy";
internal static ManualLogSource Logger;
public static AssetBundle ModAssets;
private FoxyConfig _configuration;
private void Awake()
{
Logger = ((BaseUnityPlugin)this).Logger;
_configuration = new FoxyConfig(((BaseUnityPlugin)this).Config);
InitializeNetworkBehaviours();
string path = "foxymodasset";
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;
}
EnemyType obj = ModAssets.LoadAsset<EnemyType>("Foxy");
TerminalNode val = ModAssets.LoadAsset<TerminalNode>("FoxyTN");
TerminalKeyword val2 = ModAssets.LoadAsset<TerminalKeyword>("FoxyTK");
NetworkPrefabs.RegisterNetworkPrefab(obj.enemyPrefab);
Enemies.RegisterEnemy(obj, SyncedEntry<int>.op_Implicit(SyncedInstance<FoxyConfig>.Instance.RARITY), (LevelTypes)(-1), (SpawnType)0, val, val2);
Debug.Log((object)" ░░░░░░░░░░ \n ░░░▒▒▒▒▒▒▒▒▒▒▒▒░░░ \n ░░▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░ \n ░░▒▒▓▓▓▓▓▒▒░░░░░░░▒▒▓▓▓▒▒░ \n ░▒▒▓▓▓▓▒▒░ ░░▒▓▓▒▒░ \n ░▒▒▓▓▓▒▒░ ░░▒▓▒░ \n ░▒▒▓▓▓▒░░ \n ░▒▓▓▓▓▒░ \n ░▒▓▓▓▒▒░ \n ░▒▓▓▓▒▒░ \n ░▒▓▓▓▒▒▒░ \n ░▒▓▓▓▒▒▒░ \n ░▒▓▓▓▓▒▒▒░ \n ░▒▓▓▓▓▒▒▒░░ \n ░▒▓▓▓▓▒░▒░░ \n ░▒▒▓▓▓▓▒▒▒░ \n ░▒▒▓▓▓▒▒▒░ \n ▒▒▓▓▓▒▒▒░ \n ▒▓▓▓▓▒▒░ \n ░▒▓▓▓▓▒▒ \n ░▒▓█████▓▒░░ \n ░▒▓███████████▓▓▒░ \n ░▒▓██▓▓▓████▓▓▓▓▓██▓▒░ \n ░▒▓█▓▓▓▓▓████▓▓▓▓▓▓███▒░ \n ░▓▓▓▓▓▓███████▓▓▓▓▓████▒░ \n ░▒▓█████████████▓▓▓▓████▓░ \n ░░▓███████████████████████▓░ \n ░▒▓███████████████████████▓░ \n ░▒▓███████████████████████▓▒ \n ░▓▓███████████████████████▓▓░ \n ░▓▓███████████████████████▓▓░ \n ░▒▓█████████████████████████▓░ \n ░▒▓█████████████████████████▓▒ \n ░▒▓█████████████████████████▓▓░ \n ░▒▓██████████████████████████▓░ \n ░▒▓██████████████████████████▓░ \n ░▒▓▓██████████████████████▓▓▒░ \n ░░▒▒▒▒▓▓▓▓▓▓▓▒▒▒▒░░░░ ");
Logger.LogInfo((object)"Plugin NightmareFoxy is loaded!");
}
private static void InitializeNetworkBehaviours()
{
Type[] types = Assembly.GetExecutingAssembly().GetTypes();
for (int i = 0; i < types.Length; i++)
{
MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
foreach (MethodInfo methodInfo in methods)
{
if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0)
{
methodInfo.Invoke(null, null);
}
}
}
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "NightmareFoxy";
public const string PLUGIN_NAME = "NightmareFoxy";
public const string PLUGIN_VERSION = "1.1.5";
}
}
namespace NightmareFoxy.NetcodePatcher
{
[AttributeUsage(AttributeTargets.Module)]
internal class NetcodePatchedAssemblyAttribute : Attribute
{
}
}