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.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HitchBloodsworth.Configuration;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using ReavsStuff.HitchBloodsworth.NetcodePatcher;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.VFX;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ReavsStuff.HitchBloodsworth")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.0.2.0")]
[assembly: AssemblyInformationalVersion("0.0.2")]
[assembly: AssemblyProduct("HitchBloodsworth")]
[assembly: AssemblyTitle("ReavsStuff.HitchBloodsworth")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.2.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.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 HitchBloodsworth
{
internal class HitchBloodsworthAI : EnemyAI
{
public enum State
{
Idle,
RoamSearch,
Chasing,
Attacking,
Recharge
}
[CompilerGenerated]
private static class <>O
{
public static RpcReceiveHandler <0>____rpc_handler_765643871;
public static RpcReceiveHandler <1>____rpc_handler_1643187542;
public static RpcReceiveHandler <2>____rpc_handler_3561751384;
public static RpcReceiveHandler <3>____rpc_handler_2545207594;
}
private AISearchRoutine hitchSearchRoutine = null;
private readonly float maxIdleTime = 5f;
public float currentIdleTime = 0f;
private readonly float maxAttackDelay = 3f;
public float currentAttackTime = 0f;
public float currentRechargeTimer = 0f;
private float timeSinceNewRandPos;
public bool canAttack = false;
public bool attackingDone = false;
public bool isRecharging = false;
public bool targetingPlayer = false;
public bool sawAttack = false;
public bool attackTriggerBool = false;
public bool attackMovement = false;
public bool setChaseSpeed = false;
public float setChaseSpeedNumber;
private bool attackingPlayer;
private bool enteredChaseMode;
public float noticePlayerTimer;
private bool lostPlayerInChase;
private bool beginningChasingThisClient;
private float checkLineofSightInterval;
private Coroutine attackingPlayerCoroutine;
private Vector3 lastPositionOfSeenPlayer;
private Vector3 previousPosition;
private float previousVelocity;
private float averageVelocity;
private float velocityInterval;
private float velocityAverageCount;
private float agentSpeedWithNegative;
[Space(5f)]
public float BaseAcceleration = 55f;
public float SpeedAccelerationEffect = 2f;
public float SpeedIncreaseRate = 5f;
private float lastTimeHit;
private Random enemyRandom = null;
private Vector3 positionRandomness;
private Vector3 stalkPos;
private static readonly Color hitchGlowColourIdle = new Color(0.1f, 0.1f, 0.1f);
private static readonly Color hitchGlowColourRecharge = Color.blue;
private static readonly Color hitchGlowColourRoaming = Color.green;
private static readonly Color hitchGlowColourChasing = Color.yellow;
private static readonly Color hitchGlowColourAttacking = Color.red;
private AudioSource audioSource;
private Animator animationController;
private Material hitchColourMaterial;
private Light headLight;
private List<Light> miscLights;
private static readonly float agentAccelerationMax = 20f;
private static readonly float agentAccelerationMinDefault = 10f;
public float agentAccelerationCurrent;
private static readonly float agentAngularMax = 150f;
private static readonly float agentAngularMinDefault = 120f;
public float agentAngularCurrent;
private static readonly string walkChaseAnimTriggerName = "startWalking";
private static readonly string attackAnimTriggerName = "sawAttack";
private int observedState = -1;
private Color currentHitchColour = hitchGlowColourRoaming;
private float currentHitchColourIntensity = 0f;
private Vector3 lastChasePosition = Vector3.zero;
private Vector3 targetPosition;
private readonly float volumeGet = PluginConfig.HitchVolumeAdjustment.Value;
private readonly float roamSpeedGet = PluginConfig.HitchRoamSpeed.Value;
private readonly float chaseSpeedGet = PluginConfig.HitchChaseSpeed.Value;
private readonly float damageGet = PluginConfig.HitchDamage.Value;
private readonly float rechargeGet = PluginConfig.HitchRechargeDuration.Value;
private readonly bool instakillGet = PluginConfig.HitchInstakill.Value;
private float hitchVolume;
private float hitchRoamSpeed;
private float hitchChaseSpeed;
private float hitchDamage;
private float hitchRecharge;
private bool hitchInstakill = false;
public GameObject[] glowingBodyParts;
public Material[] glowingBodyPartsMaterial;
[Header("Hitch")]
public bool DebugToCamera = false;
public AudioClip AudioClipRoaming;
public AudioClip AudioClipChasing;
public AudioClip AudioClipAttacking;
public Transform turnCompass = null;
public Transform attackArea = null;
private float temporartyBlindnessTime;
private bool temporaryBlindessDone = false;
private float scanningWidth;
private float scanningWidthDefault = 150f;
private float scanningWidthBlindness = 0f;
private float scanningLength;
private float scanningLengthBlindness = 0f;
private bool enemyHasBeenKilled = false;
public VisualEffect visualEffects;
private static VFXExposedProperty keyVFXBeginTrigger;
private static VFXExposedProperty keyVFXEndTrigger;
private static readonly string keyVFXBeginTriggerName = "StartSparks";
private static readonly string keyVFXEndTriggerName = "StopSparks";
[Conditional("DEBUG")]
private void LogIfDebugBuild(string text)
{
Plugin.Logger.LogInfo((object)text);
}
public void SetConfigValues()
{
if (volumeGet > 1f)
{
hitchVolume = 1f;
}
else if (volumeGet < 0.1f)
{
hitchVolume = 0.1f;
}
else
{
hitchVolume = volumeGet;
}
if (roamSpeedGet > 6f)
{
hitchRoamSpeed = 6f;
}
else if (roamSpeedGet < 2f)
{
hitchRoamSpeed = 2f;
}
else
{
hitchRoamSpeed = roamSpeedGet;
}
if (chaseSpeedGet > 8f)
{
hitchChaseSpeed = 8f;
}
else if (chaseSpeedGet < 4f)
{
hitchChaseSpeed = 4f;
}
else
{
hitchChaseSpeed = chaseSpeedGet;
}
if (damageGet > 35f)
{
hitchDamage = 35f;
}
else if (damageGet < 15f)
{
hitchDamage = 15f;
}
else
{
hitchDamage = damageGet;
}
if (rechargeGet > 2f)
{
hitchRecharge = 2f;
}
else if (rechargeGet < 0.5f)
{
hitchRecharge = 0.5f;
}
else
{
hitchRecharge = rechargeGet;
}
hitchInstakill = instakillGet;
}
public override void Start()
{
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Expected O, but got Unknown
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_0196: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: Unknown result type (might be due to invalid IL or missing references)
((EnemyAI)this).Start();
audioSource = ((Component)this).GetComponent<AudioSource>();
animationController = ((Component)this).GetComponent<Animator>();
SetConfigValues();
base.agent.acceleration = 300f;
base.agent.angularSpeed = 180f;
setChaseSpeedNumber = hitchChaseSpeed;
base.openDoorSpeedMultiplier = 100f;
keyVFXBeginTrigger.name = keyVFXBeginTriggerName;
keyVFXEndTrigger.name = keyVFXEndTriggerName;
hitchSearchRoutine = new AISearchRoutine();
miscLights = new List<Light>();
Light[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren<Light>();
Light[] array = componentsInChildren;
foreach (Light val in array)
{
if (((Object)((Component)val).gameObject).name == "headLight")
{
headLight = val;
}
else if (((Object)((Component)val).gameObject).name == "miscLight")
{
miscLights.Add(val);
((Behaviour)val).enabled = false;
}
}
headLight.intensity = 0f;
((Behaviour)headLight).enabled = true;
targetPosition = Vector3.zero;
agentAccelerationCurrent = agentAccelerationMinDefault;
agentAngularCurrent = agentAngularMinDefault;
DoAnimationClientRpc("IdlingT");
currentAttackTime = 0f;
timeSinceNewRandPos = 0f;
currentIdleTime = 0f;
currentRechargeTimer = 0f;
positionRandomness = new Vector3(0f, 0f, 0f);
temporaryBlindessDone = false;
enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex);
SwitchState(State.Idle);
}
public void StartAnimVFX()
{
visualEffects.SendEvent(keyVFXBeginTrigger.name);
}
public void EndAnimVFX()
{
visualEffects.SendEvent(keyVFXEndTrigger.name);
}
public override void DoAIInterval()
{
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0155: Unknown result type (might be due to invalid IL or missing references)
((EnemyAI)this).DoAIInterval();
if (StartOfRound.Instance.livingPlayers == 0 || base.isEnemyDead || enemyHasBeenKilled)
{
audioSource.loop = false;
audioSource.Stop();
base.creatureVoice.Stop();
base.creatureSFX.Stop();
}
else
{
if (isRecharging)
{
return;
}
switch (base.currentBehaviourStateIndex)
{
case 0:
base.addPlayerVelocityToDestination = 0f;
if (!hitchSearchRoutine.inProgress)
{
((EnemyAI)this).StartSearch(((Component)this).transform.position, hitchSearchRoutine);
}
break;
case 1:
base.addPlayerVelocityToDestination = 0f;
if (!hitchSearchRoutine.inProgress)
{
((EnemyAI)this).StartSearch(((Component)this).transform.position, hitchSearchRoutine);
}
break;
case 2:
base.addPlayerVelocityToDestination = 1f;
if (lostPlayerInChase)
{
base.movingTowardsTargetPlayer = false;
if (!hitchSearchRoutine.inProgress)
{
hitchSearchRoutine.searchWidth = 30f;
((EnemyAI)this).StartSearch(lastPositionOfSeenPlayer, hitchSearchRoutine);
}
}
else if (hitchSearchRoutine.inProgress)
{
((EnemyAI)this).StopSearch(hitchSearchRoutine, true);
base.movingTowardsTargetPlayer = true;
}
break;
}
}
}
public override void FinishedCurrentSearchRoutine()
{
((EnemyAI)this).FinishedCurrentSearchRoutine();
hitchSearchRoutine.searchWidth = Mathf.Clamp(hitchSearchRoutine.searchWidth + 10f, 1f, 100f);
}
private void CalculateColours()
{
//IL_05a3: Unknown result type (might be due to invalid IL or missing references)
//IL_05c6: Unknown result type (might be due to invalid IL or missing references)
//IL_05e9: Unknown result type (might be due to invalid IL or missing references)
//IL_060c: Unknown result type (might be due to invalid IL or missing references)
//IL_062f: Unknown result type (might be due to invalid IL or missing references)
//IL_0652: Unknown result type (might be due to invalid IL or missing references)
//IL_0675: Unknown result type (might be due to invalid IL or missing references)
//IL_0493: Unknown result type (might be due to invalid IL or missing references)
//IL_0498: Unknown result type (might be due to invalid IL or missing references)
//IL_04a2: Unknown result type (might be due to invalid IL or missing references)
//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
//IL_04ce: Unknown result type (might be due to invalid IL or missing references)
//IL_04d3: Unknown result type (might be due to invalid IL or missing references)
//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: 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_0141: Unknown result type (might be due to invalid IL or missing references)
//IL_0146: Unknown result type (might be due to invalid IL or missing references)
//IL_016d: Unknown result type (might be due to invalid IL or missing references)
//IL_0172: Unknown result type (might be due to invalid IL or missing references)
//IL_017c: Unknown result type (might be due to invalid IL or missing references)
//IL_023e: Unknown result type (might be due to invalid IL or missing references)
//IL_024e: 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_0536: Unknown result type (might be due to invalid IL or missing references)
//IL_0540: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_026e: Unknown result type (might be due to invalid IL or missing references)
//IL_0273: Unknown result type (might be due to invalid IL or missing references)
//IL_027d: Unknown result type (might be due to invalid IL or missing references)
//IL_0282: 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_02ae: Unknown result type (might be due to invalid IL or missing references)
//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
//IL_01df: Unknown result type (might be due to invalid IL or missing references)
//IL_0389: Unknown result type (might be due to invalid IL or missing references)
//IL_038e: Unknown result type (might be due to invalid IL or missing references)
//IL_0398: Unknown result type (might be due to invalid IL or missing references)
//IL_039d: Unknown result type (might be due to invalid IL or missing references)
//IL_03c4: Unknown result type (might be due to invalid IL or missing references)
//IL_03c9: Unknown result type (might be due to invalid IL or missing references)
//IL_03d3: Unknown result type (might be due to invalid IL or missing references)
//IL_030c: Unknown result type (might be due to invalid IL or missing references)
//IL_0311: Unknown result type (might be due to invalid IL or missing references)
//IL_031b: Unknown result type (might be due to invalid IL or missing references)
//IL_0421: Unknown result type (might be due to invalid IL or missing references)
//IL_0426: Unknown result type (might be due to invalid IL or missing references)
//IL_0430: Unknown result type (might be due to invalid IL or missing references)
if (!isRecharging)
{
if (base.currentBehaviourStateIndex == 0)
{
currentHitchColour = Color.Lerp(currentHitchColour, hitchGlowColourIdle, Time.deltaTime);
currentHitchColourIntensity = Mathf.Lerp(currentHitchColourIntensity, 1000f, Time.deltaTime);
headLight.color = Color.Lerp(currentHitchColour, hitchGlowColourIdle, Time.deltaTime);
headLight.intensity = Mathf.Lerp(headLight.intensity, 500f, Time.deltaTime * 8f);
foreach (Light miscLight in miscLights)
{
miscLight.color = Color.Lerp(currentHitchColour, hitchGlowColourIdle, Time.deltaTime);
miscLight.intensity = Mathf.Lerp(miscLight.intensity, 150f, Time.deltaTime * 8f);
}
}
else if (base.currentBehaviourStateIndex == 1)
{
currentHitchColour = Color.Lerp(currentHitchColour, hitchGlowColourRoaming, Time.deltaTime);
currentHitchColourIntensity = Mathf.Lerp(currentHitchColourIntensity, 2000f, Time.deltaTime);
headLight.color = Color.Lerp(currentHitchColour, hitchGlowColourRoaming, Time.deltaTime);
headLight.intensity = Mathf.Lerp(headLight.intensity, 1000f, Time.deltaTime * 8f);
foreach (Light miscLight2 in miscLights)
{
miscLight2.color = Color.Lerp(currentHitchColour, hitchGlowColourRoaming, Time.deltaTime);
miscLight2.intensity = Mathf.Lerp(miscLight2.intensity, 200f, Time.deltaTime * 8f);
}
}
else if (base.currentBehaviourStateIndex == 2 && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 5f)
{
currentHitchColour = Color.Lerp(currentHitchColour, hitchGlowColourChasing, Time.deltaTime);
currentHitchColourIntensity = Mathf.Lerp(currentHitchColourIntensity, 4500f, Time.deltaTime);
headLight.color = Color.Lerp(currentHitchColour, hitchGlowColourChasing, Time.deltaTime);
headLight.intensity = Mathf.Lerp(headLight.intensity, 2000f, Time.deltaTime * 4f);
foreach (Light miscLight3 in miscLights)
{
miscLight3.color = Color.Lerp(currentHitchColour, hitchGlowColourChasing, Time.deltaTime);
miscLight3.intensity = Mathf.Lerp(miscLight3.intensity, 300f, Time.deltaTime * 8f);
}
}
else if (base.currentBehaviourStateIndex == 2 && sawAttack)
{
currentHitchColour = Color.Lerp(currentHitchColour, hitchGlowColourAttacking, Time.deltaTime);
currentHitchColourIntensity = Mathf.Lerp(currentHitchColourIntensity, 3500f, Time.deltaTime);
headLight.color = Color.Lerp(currentHitchColour, hitchGlowColourAttacking, Time.deltaTime);
headLight.intensity = Mathf.Lerp(headLight.intensity, 1500f, Time.deltaTime);
foreach (Light miscLight4 in miscLights)
{
miscLight4.color = Color.Lerp(currentHitchColour, hitchGlowColourAttacking, Time.deltaTime);
miscLight4.intensity = Mathf.Lerp(miscLight4.intensity, 400f, Time.deltaTime * 8f);
}
}
}
else if (isRecharging)
{
currentHitchColour = Color.Lerp(currentHitchColour, hitchGlowColourRecharge, Time.deltaTime);
currentHitchColourIntensity = Mathf.Lerp(currentHitchColourIntensity, 500f, Time.deltaTime);
headLight.color = Color.Lerp(currentHitchColour, hitchGlowColourRecharge, Time.deltaTime);
headLight.intensity = Mathf.Lerp(headLight.intensity, 100f, Time.deltaTime * 4f);
foreach (Light miscLight5 in miscLights)
{
miscLight5.color = Color.Lerp(currentHitchColour, hitchGlowColourRecharge, Time.deltaTime);
miscLight5.intensity = Mathf.Lerp(miscLight5.intensity, 100f, Time.deltaTime * 8f);
}
}
((Renderer)glowingBodyParts[0].GetComponent<SkinnedMeshRenderer>()).material.SetColor("_EmissiveColor", currentHitchColour);
((Renderer)glowingBodyParts[1].GetComponent<SkinnedMeshRenderer>()).material.SetColor("_EmissiveColor", currentHitchColour);
((Renderer)glowingBodyParts[2].GetComponent<SkinnedMeshRenderer>()).material.SetColor("_EmissiveColor", currentHitchColour);
((Renderer)glowingBodyParts[3].GetComponent<SkinnedMeshRenderer>()).material.SetColor("_EmissiveColor", currentHitchColour);
((Renderer)glowingBodyParts[4].GetComponent<SkinnedMeshRenderer>()).material.SetColor("_EmissiveColor", currentHitchColour);
((Renderer)glowingBodyParts[5].GetComponent<SkinnedMeshRenderer>()).material.SetColor("_EmissiveColor", currentHitchColour);
((Renderer)glowingBodyParts[6].GetComponent<SkinnedMeshRenderer>()).material.SetColor("_EmissiveColor", currentHitchColour);
}
public override void Update()
{
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_0152: Unknown result type (might be due to invalid IL or missing references)
//IL_0157: Unknown result type (might be due to invalid IL or missing references)
//IL_081a: Unknown result type (might be due to invalid IL or missing references)
//IL_082a: Unknown result type (might be due to invalid IL or missing references)
//IL_085b: Unknown result type (might be due to invalid IL or missing references)
//IL_0872: Unknown result type (might be due to invalid IL or missing references)
//IL_0882: Unknown result type (might be due to invalid IL or missing references)
//IL_0891: Unknown result type (might be due to invalid IL or missing references)
//IL_0896: Unknown result type (might be due to invalid IL or missing references)
//IL_08a6: Unknown result type (might be due to invalid IL or missing references)
//IL_060b: Unknown result type (might be due to invalid IL or missing references)
//IL_061b: Unknown result type (might be due to invalid IL or missing references)
//IL_0786: Unknown result type (might be due to invalid IL or missing references)
//IL_078b: Unknown result type (might be due to invalid IL or missing references)
((EnemyAI)this).Update();
if (base.isEnemyDead || enemyHasBeenKilled)
{
return;
}
if (!((NetworkBehaviour)this).IsOwner)
{
base.inSpecialAnimation = false;
}
ObserveState();
CalculateColours();
CalculateAgentSpeed();
currentAttackTime += Time.deltaTime;
if ((Object)(object)base.targetPlayer == (Object)null)
{
currentIdleTime += Time.deltaTime;
}
currentRechargeTimer += Time.deltaTime;
if (temporartyBlindnessTime <= 1.5f && !temporaryBlindessDone)
{
temporartyBlindnessTime += Time.deltaTime;
scanningWidth = scanningWidthBlindness;
scanningLength = 0f;
}
else if (temporartyBlindnessTime >= 1.5f && !temporaryBlindessDone)
{
scanningWidth = scanningWidthDefault;
scanningLength = 1f;
temporaryBlindessDone = true;
}
if (isRecharging)
{
return;
}
if (GameNetworkManager.Instance.localPlayerController.HasLineOfSightToPosition(((Component)this).transform.position + Vector3.up * 0.25f, 50f, 25, 5f))
{
if (base.currentBehaviourStateIndex == 2)
{
GameNetworkManager.Instance.localPlayerController.IncreaseFearLevelOverTime(0.8f, 1f);
}
else
{
GameNetworkManager.Instance.localPlayerController.IncreaseFearLevelOverTime(0.8f, 0.25f);
}
}
switch (base.currentBehaviourStateIndex)
{
case 0:
{
if (sawAttack)
{
break;
}
if (enteredChaseMode)
{
enteredChaseMode = false;
hitchSearchRoutine.searchWidth = 25f;
beginningChasingThisClient = false;
noticePlayerTimer = 0f;
base.useSecondaryAudiosOnAnimatedObjects = false;
base.agent.stoppingDistance = 2f;
base.agent.speed = 0f;
}
if (checkLineofSightInterval <= 0.05f)
{
checkLineofSightInterval += Time.deltaTime;
break;
}
checkLineofSightInterval = 0f;
if (!temporaryBlindessDone)
{
break;
}
PlayerControllerB val4 = ((EnemyAI)this).CheckLineOfSightForPlayer(scanningWidth, 60, -1);
if ((Object)(object)val4 == (Object)(object)GameNetworkManager.Instance.localPlayerController && temporaryBlindessDone)
{
noticePlayerTimer = Mathf.Clamp(noticePlayerTimer + 0.05f, 0f, 10f);
if (noticePlayerTimer > 0.2f && !beginningChasingThisClient)
{
beginningChasingThisClient = true;
BeginChasingPlayerServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId);
((EnemyAI)this).ChangeOwnershipOfEnemy(val4.actualClientId);
}
}
else
{
noticePlayerTimer -= Time.deltaTime;
}
if (currentIdleTime >= maxIdleTime)
{
((EnemyAI)this).SwitchToBehaviourState(1);
}
break;
}
case 1:
{
if (sawAttack)
{
break;
}
if (enteredChaseMode)
{
enteredChaseMode = false;
hitchSearchRoutine.searchWidth = 25f;
beginningChasingThisClient = false;
noticePlayerTimer = 0f;
base.agent.stoppingDistance = 2f;
base.agent.speed = hitchChaseSpeed;
}
if (checkLineofSightInterval <= 0.05f)
{
checkLineofSightInterval += Time.deltaTime;
break;
}
checkLineofSightInterval = 0f;
if (!temporaryBlindessDone)
{
break;
}
PlayerControllerB val3 = ((EnemyAI)this).CheckLineOfSightForPlayer(scanningWidth, 60, -1);
if ((Object)(object)val3 == (Object)(object)GameNetworkManager.Instance.localPlayerController && temporaryBlindessDone)
{
noticePlayerTimer = Mathf.Clamp(noticePlayerTimer + 0.05f, 0f, 10f);
if (noticePlayerTimer > 0.2f && !beginningChasingThisClient)
{
beginningChasingThisClient = true;
BeginChasingPlayerServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId);
((EnemyAI)this).ChangeOwnershipOfEnemy(val3.actualClientId);
}
}
else
{
noticePlayerTimer -= Time.deltaTime;
}
if (currentIdleTime >= maxIdleTime * 3f)
{
((EnemyAI)this).SwitchToBehaviourState(0);
}
break;
}
case 2:
{
if (sawAttack)
{
break;
}
if (!enteredChaseMode)
{
enteredChaseMode = true;
lostPlayerInChase = false;
checkLineofSightInterval = 0f;
beginningChasingThisClient = false;
base.agent.stoppingDistance = 0.5f;
base.agent.speed = 0f;
}
if (checkLineofSightInterval <= 0.075f)
{
checkLineofSightInterval += Time.deltaTime;
break;
}
checkLineofSightInterval = 0f;
if (!temporaryBlindessDone)
{
break;
}
if (!attackingPlayer && (Object)(object)base.targetPlayer != (Object)null && attackingPlayerCoroutine == null && base.currentBehaviourStateIndex == 2 && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < 3f)
{
attackingPlayer = true;
sawAttack = true;
attackingPlayerCoroutine = ((MonoBehaviour)this).StartCoroutine(AttackingPlayerAnimation((int)base.targetPlayer.playerClientId));
AttackPlayerServerRpc((int)base.targetPlayer.playerClientId);
}
if (base.inSpecialAnimation)
{
break;
}
if (lostPlayerInChase)
{
PlayerControllerB val = ((EnemyAI)this).CheckLineOfSightForPlayer(scanningWidth, 60, -1);
if (Object.op_Implicit((Object)(object)val) && temporaryBlindessDone)
{
noticePlayerTimer = 0f;
lostPlayerInChase = false;
if ((Object)(object)val != (Object)(object)base.targetPlayer)
{
((EnemyAI)this).SetMovingTowardsTargetPlayer(val);
attackingPlayer = false;
((EnemyAI)this).ChangeOwnershipOfEnemy(val.actualClientId);
}
}
else
{
noticePlayerTimer -= 0.075f;
if (noticePlayerTimer < -15f)
{
((EnemyAI)this).SwitchToBehaviourState(1);
}
}
break;
}
PlayerControllerB val2 = ((EnemyAI)this).CheckLineOfSightForPlayer(scanningWidth, 70 * (int)scanningLength, -1);
if ((Object)(object)val2 != (Object)null && temporaryBlindessDone)
{
noticePlayerTimer = 0f;
lastPositionOfSeenPlayer = ((Component)val2).transform.position;
if ((Object)(object)val2 != (Object)(object)base.targetPlayer)
{
base.targetPlayer = val2;
attackingPlayer = false;
((EnemyAI)this).ChangeOwnershipOfEnemy(base.targetPlayer.actualClientId);
}
}
else
{
noticePlayerTimer += 0.075f;
if (noticePlayerTimer > 1.8f)
{
lostPlayerInChase = true;
}
}
break;
}
}
int currentBehaviourStateIndex = base.currentBehaviourStateIndex;
if ((Object)(object)base.targetPlayer != (Object)null && currentBehaviourStateIndex == 2 && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < 4f)
{
turnCompass.LookAt(((Component)base.targetPlayer.gameplayCamera).transform.position);
((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, turnCompass.eulerAngles.y, 0f)), 12f * Time.deltaTime);
}
}
private void CalculateAgentSpeed()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: 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)
//IL_014a: Unknown result type (might be due to invalid IL or missing references)
//IL_014f: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = ((Component)this).transform.position - previousPosition;
float num = ((Vector3)(ref val)).magnitude / (Time.deltaTime / 1.4f);
if (velocityInterval <= 0f)
{
previousVelocity = averageVelocity;
velocityInterval = 0.05f;
velocityAverageCount += 1f;
if (velocityAverageCount > 5f)
{
averageVelocity += (num - averageVelocity) / 3f;
}
else
{
averageVelocity += num;
if (velocityAverageCount == 2f)
{
averageVelocity /= velocityAverageCount;
}
}
}
else
{
velocityInterval -= Time.deltaTime;
}
if (((NetworkBehaviour)this).IsOwner && averageVelocity - num > Mathf.Clamp(num * 0.17f, 2f, 100f) && ((num > 3f) & (base.currentBehaviourStateIndex == 2)))
{
agentSpeedWithNegative *= 0.2f;
}
previousPosition = ((Component)this).transform.position;
if (base.currentBehaviourStateIndex == 0)
{
base.agent.speed = 0f;
}
else if (base.currentBehaviourStateIndex == 1)
{
base.agent.speed = hitchRoamSpeed;
base.agent.acceleration = 150f;
}
else
{
if (base.currentBehaviourStateIndex != 2)
{
return;
}
if (!attackMovement)
{
if (setChaseSpeedNumber < 20f)
{
setChaseSpeedNumber += 2.5f;
}
base.agent.speed = Mathf.Clamp(setChaseSpeedNumber, hitchChaseSpeed, hitchChaseSpeed * 2f);
base.agent.acceleration = 350f;
}
else
{
setChaseSpeedNumber = 5f;
base.agent.speed = hitchChaseSpeed;
base.agent.acceleration = 200f;
}
}
}
private void AttackAnimationVariables()
{
base.agent.speed = hitchChaseSpeed * 1.25f;
audioSource.pitch = Random.Range(0.85f, 1.25f);
audioSource.Stop();
audioSource.loop = false;
DoAnimationClientRpc("AttackingT");
audioSource.PlayOneShot(AudioClipAttacking, hitchVolume);
}
private IEnumerator AttackingPlayerAnimation(int playerId)
{
attackingDone = false;
attackTriggerBool = false;
attackMovement = true;
PlayerControllerB playerScript = StartOfRound.Instance.allPlayerScripts[playerId];
if (!base.isEnemyDead)
{
base.agent.speed = hitchChaseSpeed * 1.25f;
audioSource.pitch = Random.Range(0.85f, 1.25f);
audioSource.Stop();
audioSource.loop = false;
DoAnimationClientRpc("AttackingT");
audioSource.PlayOneShot(AudioClipAttacking, hitchVolume);
yield return (object)new WaitUntil((Func<bool>)(() => attackTriggerBool));
if ((float)playerScript.health < 30f || hitchInstakill)
{
SawAttackKillClientRpc();
}
else
{
SawAttackHitClientRpc();
}
yield return (object)new WaitUntil((Func<bool>)(() => attackingDone));
base.movingTowardsTargetPlayer = false;
attackMovement = false;
base.agent.isStopped = true;
base.agent.speed = 0f;
DoAnimationClientRpc("RechargeT");
isRecharging = true;
currentRechargeTimer = 0f;
yield return (object)new WaitForSecondsRealtime(hitchRecharge);
DoAnimationClientRpc("Recharge2T");
yield return (object)new WaitUntil((Func<bool>)(() => !isRecharging));
sawAttack = false;
base.agent.isStopped = false;
attackingPlayer = false;
attackingPlayerCoroutine = null;
((EnemyAI)this).SwitchToBehaviourState(0);
}
}
public void AttackTriggerFunction()
{
attackTriggerBool = true;
}
public void AttackDoneAnimation()
{
attackingDone = true;
}
public void DeactiveReacharge()
{
isRecharging = false;
}
[ClientRpc]
public void DoAnimationClientRpc(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_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(3904742051u, val, (RpcDelivery)0);
bool flag = animationName != null;
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
if (flag)
{
((FastBufferWriter)(ref val2)).WriteValueSafe(animationName, false);
}
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3904742051u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
base.creatureAnimator.SetTrigger(animationName);
}
}
[ClientRpc]
public void SawAttackKillClientRpc()
{
//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_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_011f: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
//IL_016a: Unknown result type (might be due to invalid IL or missing references)
//IL_0179: Unknown result type (might be due to invalid IL or missing references)
//IL_0183: Unknown result type (might be due to invalid IL or missing references)
//IL_0189: 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_01a2: 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(3777976070u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3777976070u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
int num = 8;
Collider[] array = Physics.OverlapBox(attackArea.position, attackArea.localScale, Quaternion.identity, num);
if (array.Length == 0)
{
return;
}
Collider[] array2 = array;
foreach (Collider val3 in array2)
{
PlayerControllerB val4 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val3, false, false);
if ((Object)(object)val4 != (Object)null)
{
val4.DropBlood(Vector3.forward, true, false);
val4.DropBlood(Vector3.left, true, false);
val4.DropBlood(Vector3.right, true, false);
val4.DropBlood(Vector3.up, true, false);
val4.DropBlood(Vector3.back, true, false);
val4.DropBlood(Vector3.down, true, false);
val4.KillPlayer(Vector3.zero, true, (CauseOfDeath)6, 1, default(Vector3));
val4.DamagePlayer(100, true, true, (CauseOfDeath)0, 0, false, default(Vector3));
val4.snapToServerPosition = false;
val4.disableLookInput = false;
currentAttackTime = 0f;
canAttack = false;
attackTriggerBool = false;
}
}
}
[ClientRpc]
public void SawAttackHitClientRpc()
{
//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_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
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(2403213789u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2403213789u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
int num = 8;
Collider[] array = Physics.OverlapBox(attackArea.position, attackArea.localScale, Quaternion.identity, num);
if (array.Length == 0)
{
return;
}
Collider[] array2 = array;
foreach (Collider val3 in array2)
{
PlayerControllerB val4 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val3, false, false);
if ((Object)(object)val4 != (Object)null)
{
val4.DamagePlayer((int)hitchDamage, true, true, (CauseOfDeath)0, 0, false, default(Vector3));
currentAttackTime = 0f;
canAttack = false;
attackTriggerBool = false;
}
}
}
public void ObserveState()
{
if (base.currentBehaviourStateIndex == observedState)
{
return;
}
if (base.enemyHP <= 0)
{
audioSource.Stop();
return;
}
switch (base.currentBehaviourStateIndex)
{
case 0:
currentIdleTime = 0f;
audioSource.pitch = Random.Range(0.6f, 0.7f);
audioSource.clip = AudioClipRoaming;
audioSource.loop = true;
audioSource.volume = hitchVolume;
audioSource.Play();
DoAnimationClientRpc("IdlingT");
setChaseSpeed = false;
break;
case 1:
audioSource.pitch = Random.Range(0.8f, 1.2f);
audioSource.clip = AudioClipRoaming;
audioSource.loop = true;
audioSource.volume = hitchVolume;
audioSource.Play();
DoAnimationClientRpc("SearchingT");
setChaseSpeed = false;
break;
case 2:
audioSource.pitch = Random.Range(0.75f, 1.25f);
audioSource.clip = AudioClipChasing;
audioSource.loop = true;
audioSource.volume = hitchVolume;
audioSource.Play();
DoAnimationClientRpc("ChasingT");
break;
}
observedState = base.currentBehaviourStateIndex;
}
public IEnumerator KillingEnemyAnimation()
{
yield return (object)new WaitUntil((Func<bool>)(() => attackingPlayerCoroutine == null));
if (attackingPlayerCoroutine != null)
{
((MonoBehaviour)this).StopCoroutine(attackingPlayerCoroutine);
}
if (base.searchCoroutine != null)
{
((MonoBehaviour)this).StopCoroutine(base.searchCoroutine);
}
((EnemyAI)this).KillEnemyOnOwnerClient(false);
}
public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
{
((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID);
if (base.isEnemyDead)
{
audioSource.Stop();
audioSource.loop = false;
return;
}
base.enemyHP -= force;
agentSpeedWithNegative = Random.Range(-2.8f, -2f);
lastTimeHit = Time.realtimeSinceStartup;
averageVelocity = 0f;
if (((NetworkBehaviour)this).IsOwner && base.enemyHP <= 0)
{
enemyHasBeenKilled = true;
((MonoBehaviour)this).StartCoroutine(KillingEnemyAnimation());
}
}
public void Footsteps()
{
base.creatureSFX.pitch = Random.Range(0.8f, 1.2f);
base.creatureSFX.PlayOneShot(base.enemyType.audioClips[Random.Range(0, 2)]);
}
public void FootstepHeavy()
{
base.creatureSFX.pitch = Random.Range(0.7f, 1.1f);
base.creatureSFX.PlayOneShot(base.enemyType.audioClips[3]);
}
public void SwitchState(State state)
{
((EnemyAI)this).SwitchToBehaviourState((int)state);
}
[ServerRpc]
public void SwitchStateServerRpc(State state)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: 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_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: 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
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(1518961145u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<State>(ref state, default(ForEnums));
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1518961145u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
((EnemyAI)this).SwitchToBehaviourServerRpc((int)state);
}
}
[ClientRpc]
public void SwitchStateClientRpc(State state)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: 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_0097: 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(1898914933u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<State>(ref state, default(ForEnums));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1898914933u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
((EnemyAI)this).SwitchToBehaviourClientRpc((int)state);
}
}
}
[ServerRpc(RequireOwnership = false)]
public void AttackPlayerServerRpc(int playerId)
{
//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_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Invalid comparison between Unknown and I4
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Invalid comparison between Unknown and I4
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
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(1582046511u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerId);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1582046511u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
{
return;
}
NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager;
if (networkManager2 != null && networkManager2.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager2.IsClient || networkManager2.IsHost))
{
ServerRpcParams val3 = default(ServerRpcParams);
FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendServerRpc(3561751384u, val3, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val4, playerId);
((NetworkBehaviour)this).__endSendServerRpc(ref val4, 3561751384u, val3, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager2.IsServer || networkManager2.IsHost))
{
AttackPlayerClientRpc(playerId);
}
}
}
[ClientRpc]
public void AttackPlayerClientRpc(int playerId)
{
//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_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Invalid comparison between Unknown and I4
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Invalid comparison between Unknown and I4
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
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(1622435775u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerId);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1622435775u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager;
if (networkManager2 != null && networkManager2.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager2.IsServer || networkManager2.IsHost))
{
ClientRpcParams val3 = default(ClientRpcParams);
FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendClientRpc(2545207594u, val3, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val4, playerId);
((NetworkBehaviour)this).__endSendClientRpc(ref val4, 2545207594u, val3, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager2.IsClient || networkManager2.IsHost) && !((NetworkBehaviour)this).IsOwner && attackingPlayerCoroutine == null)
{
((MonoBehaviour)this).StartCoroutine(AttackingPlayerAnimation(playerId));
}
}
}
[ServerRpc(RequireOwnership = false)]
public void BeginChasingPlayerServerRpc(int playerObjectId)
{
//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_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Invalid comparison between Unknown and I4
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Invalid comparison between Unknown and I4
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
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(1382931893u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerObjectId);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1382931893u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
{
return;
}
NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager;
if (networkManager2 != null && networkManager2.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager2.IsClient || networkManager2.IsHost))
{
ServerRpcParams val3 = default(ServerRpcParams);
FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendServerRpc(765643871u, val3, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val4, playerObjectId);
((NetworkBehaviour)this).__endSendServerRpc(ref val4, 765643871u, val3, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager2.IsServer || networkManager2.IsHost))
{
BeginChasingPlayerClientRpc(playerObjectId);
}
}
}
[ClientRpc]
public void BeginChasingPlayerClientRpc(int playerObjectId)
{
//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_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Invalid comparison between Unknown and I4
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Invalid comparison between Unknown and I4
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
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(2163460171u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerObjectId);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2163460171u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
NetworkManager networkManager2 = ((NetworkBehaviour)this).NetworkManager;
if (networkManager2 != null && networkManager2.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager2.IsServer || networkManager2.IsHost))
{
ClientRpcParams val3 = default(ClientRpcParams);
FastBufferWriter val4 = ((NetworkBehaviour)this).__beginSendClientRpc(1643187542u, val3, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val4, playerObjectId);
((NetworkBehaviour)this).__endSendClientRpc(ref val4, 1643187542u, val3, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager2.IsClient || networkManager2.IsHost))
{
((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(2);
((EnemyAI)this).SetMovingTowardsTargetPlayer(StartOfRound.Instance.allPlayerScripts[playerObjectId]);
}
}
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_HitchBloodsworthAI()
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Expected O, but got Unknown
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Expected O, but got Unknown
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Expected O, but got Unknown
Dictionary<uint, RpcReceiveHandler> _rpc_func_table = NetworkManager.__rpc_func_table;
object obj = <>O.<0>____rpc_handler_765643871;
if (obj == null)
{
RpcReceiveHandler val = __rpc_handler_765643871;
<>O.<0>____rpc_handler_765643871 = val;
obj = (object)val;
}
_rpc_func_table.Add(765643871u, (RpcReceiveHandler)obj);
Dictionary<uint, RpcReceiveHandler> _rpc_func_table2 = NetworkManager.__rpc_func_table;
object obj2 = <>O.<1>____rpc_handler_1643187542;
if (obj2 == null)
{
RpcReceiveHandler val2 = __rpc_handler_1643187542;
<>O.<1>____rpc_handler_1643187542 = val2;
obj2 = (object)val2;
}
_rpc_func_table2.Add(1643187542u, (RpcReceiveHandler)obj2);
Dictionary<uint, RpcReceiveHandler> _rpc_func_table3 = NetworkManager.__rpc_func_table;
object obj3 = <>O.<2>____rpc_handler_3561751384;
if (obj3 == null)
{
RpcReceiveHandler val3 = __rpc_handler_3561751384;
<>O.<2>____rpc_handler_3561751384 = val3;
obj3 = (object)val3;
}
_rpc_func_table3.Add(3561751384u, (RpcReceiveHandler)obj3);
Dictionary<uint, RpcReceiveHandler> _rpc_func_table4 = NetworkManager.__rpc_func_table;
object obj4 = <>O.<3>____rpc_handler_2545207594;
if (obj4 == null)
{
RpcReceiveHandler val4 = __rpc_handler_2545207594;
<>O.<3>____rpc_handler_2545207594 = val4;
obj4 = (object)val4;
}
_rpc_func_table4.Add(2545207594u, (RpcReceiveHandler)obj4);
}
private static void __rpc_handler_765643871(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)(HitchBloodsworthAI)(object)target).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int playerObjectId = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerObjectId);
((NetworkBehaviour)(HitchBloodsworthAI)(object)target).__rpc_exec_stage = (__RpcExecStage)1;
((HitchBloodsworthAI)(object)target).BeginChasingPlayerServerRpc(playerObjectId);
((NetworkBehaviour)(HitchBloodsworthAI)(object)target).__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1643187542(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)(HitchBloodsworthAI)(object)target).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int playerObjectId = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerObjectId);
((NetworkBehaviour)(HitchBloodsworthAI)(object)target).__rpc_exec_stage = (__RpcExecStage)2;
((HitchBloodsworthAI)(object)target).BeginChasingPlayerClientRpc(playerObjectId);
((NetworkBehaviour)(HitchBloodsworthAI)(object)target).__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3561751384(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)(HitchBloodsworthAI)(object)target).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int playerId = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
((NetworkBehaviour)(HitchBloodsworthAI)(object)target).__rpc_exec_stage = (__RpcExecStage)1;
((HitchBloodsworthAI)(object)target).AttackPlayerServerRpc(playerId);
((NetworkBehaviour)(HitchBloodsworthAI)(object)target).__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2545207594(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)(HitchBloodsworthAI)(object)target).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int playerId = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
((NetworkBehaviour)(HitchBloodsworthAI)(object)target).__rpc_exec_stage = (__RpcExecStage)2;
((HitchBloodsworthAI)(object)target).AttackPlayerClientRpc(playerId);
((NetworkBehaviour)(HitchBloodsworthAI)(object)target).__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected override void __initializeVariables()
{
((EnemyAI)this).__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_HitchBloodsworthAI()
{
//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
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(3904742051u, new RpcReceiveHandler(__rpc_handler_3904742051));
NetworkManager.__rpc_func_table.Add(3777976070u, new RpcReceiveHandler(__rpc_handler_3777976070));
NetworkManager.__rpc_func_table.Add(2403213789u, new RpcReceiveHandler(__rpc_handler_2403213789));
NetworkManager.__rpc_func_table.Add(1518961145u, new RpcReceiveHandler(__rpc_handler_1518961145));
NetworkManager.__rpc_func_table.Add(1898914933u, new RpcReceiveHandler(__rpc_handler_1898914933));
NetworkManager.__rpc_func_table.Add(1582046511u, new RpcReceiveHandler(__rpc_handler_1582046511));
NetworkManager.__rpc_func_table.Add(1622435775u, new RpcReceiveHandler(__rpc_handler_1622435775));
NetworkManager.__rpc_func_table.Add(1382931893u, new RpcReceiveHandler(__rpc_handler_1382931893));
NetworkManager.__rpc_func_table.Add(2163460171u, new RpcReceiveHandler(__rpc_handler_2163460171));
}
private static void __rpc_handler_3904742051(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 animationName = null;
if (flag)
{
((FastBufferReader)(ref reader)).ReadValueSafe(ref animationName, false);
}
target.__rpc_exec_stage = (__RpcExecStage)2;
((HitchBloodsworthAI)(object)target).DoAnimationClientRpc(animationName);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3777976070(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;
((HitchBloodsworthAI)(object)target).SawAttackKillClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2403213789(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;
((HitchBloodsworthAI)(object)target).SawAttackHitClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1518961145(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_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: 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
{
State state = default(State);
((FastBufferReader)(ref reader)).ReadValueSafe<State>(ref state, default(ForEnums));
target.__rpc_exec_stage = (__RpcExecStage)1;
((HitchBloodsworthAI)(object)target).SwitchStateServerRpc(state);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1898914933(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_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
State state = default(State);
((FastBufferReader)(ref reader)).ReadValueSafe<State>(ref state, default(ForEnums));
target.__rpc_exec_stage = (__RpcExecStage)2;
((HitchBloodsworthAI)(object)target).SwitchStateClientRpc(state);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1582046511(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 playerId = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
target.__rpc_exec_stage = (__RpcExecStage)1;
((HitchBloodsworthAI)(object)target).AttackPlayerServerRpc(playerId);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1622435775(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 playerId = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
target.__rpc_exec_stage = (__RpcExecStage)2;
((HitchBloodsworthAI)(object)target).AttackPlayerClientRpc(playerId);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1382931893(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 playerObjectId = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerObjectId);
target.__rpc_exec_stage = (__RpcExecStage)1;
((HitchBloodsworthAI)(object)target).BeginChasingPlayerServerRpc(playerObjectId);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2163460171(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 playerObjectId = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerObjectId);
target.__rpc_exec_stage = (__RpcExecStage)2;
((HitchBloodsworthAI)(object)target).BeginChasingPlayerClientRpc(playerObjectId);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "HitchBloodsworthAI";
}
}
[BepInPlugin("ReavsStuff.HitchBloodsworth", "HitchBloodsworth", "0.0.2")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
internal static ManualLogSource Logger;
public static AssetBundle ModAssets;
internal static PluginConfig BoundConfig { get; private set; }
private void Awake()
{
Logger = ((BaseUnityPlugin)this).Logger;
BoundConfig = new PluginConfig(((BaseUnityPlugin)this).Config);
InitializeNetworkBehaviours();
string path = "HitchBloodsworth";
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 val = ModAssets.LoadAsset<EnemyType>("HitchBloodsworth");
TerminalNode val2 = ModAssets.LoadAsset<TerminalNode>("HitchBloodsworthTN");
TerminalKeyword val3 = ModAssets.LoadAsset<TerminalKeyword>("HitchBloodsworthTK");
NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab);
Enemies.RegisterEnemy(val, BoundConfig.SpawnWeight.Value, (LevelTypes)(-1), val2, val3);
Logger.LogInfo((object)"Plugin ReavsStuff.HitchBloodsworth 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);
}
}
}
}
}
internal class Utilities
{
public static void ApplyLocalPlayerScreenshake(Vector3 position, float minDistance = 14f, float maxDistance = 25f, bool onlySmall = false)
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, position);
if (num < minDistance && !onlySmall)
{
HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
}
else if (num < maxDistance)
{
HUDManager.Instance.ShakeCamera((ScreenShakeType)0);
}
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "ReavsStuff.HitchBloodsworth";
public const string PLUGIN_NAME = "HitchBloodsworth";
public const string PLUGIN_VERSION = "0.0.2";
}
}
namespace HitchBloodsworth.Configuration
{
public class PluginConfig
{
public ConfigEntry<int> SpawnWeight;
public static ConfigEntry<float> HitchVolumeAdjustment;
public static ConfigEntry<float> HitchRoamSpeed;
public float roamValue = 3f;
public static ConfigEntry<float> HitchChaseSpeed;
public float chaseValue = 5f;
public static ConfigEntry<float> HitchRechargeDuration;
public float rechargeDuration = 1f;
public static ConfigEntry<int> HitchDamage;
public int damageValue = 25;
public static ConfigEntry<bool> HitchInstakill;
public bool instakill = false;
public PluginConfig(ConfigFile cfg)
{
SpawnWeight = cfg.Bind<int>("General", "Spawn weight", 20, "The spawn chance weight.\nGoes up from 0, lower is more rare, 100 and up is very common.");
HitchVolumeAdjustment = cfg.Bind<float>("General", "Volume", 1f, "Adjust volume.\n1.0 = 100%, 0.0 = 0%");
HitchDamage = cfg.Bind<int>("General", "Damage", Math.Clamp(damageValue, 15, 35), "How much damage he does.\nMin: 15 Max: 35");
HitchRechargeDuration = cfg.Bind<float>("General", "Recharge Rate", Math.Clamp(rechargeDuration, 0.5f, 2f), "How long it takes to for him to recharge.\nMin: 0.5 Max: 2");
HitchChaseSpeed = cfg.Bind<float>("Speed Variables", "Chasespeed", Math.Clamp(chaseValue, 4f, 8f), "How fast the chase speed is.\nMin: 4 Max: 8");
HitchRoamSpeed = cfg.Bind<float>("Speed Variables", "Roamspeed", Math.Clamp(roamValue, 2f, 6f), "How fast the roam speed is.\nMin: 2 Max: 6");
HitchInstakill = cfg.Bind<bool>("Misc", "Instakill", instakill, "If hitch should be allowed to oneshot\nNo");
ClearUnusedEntries(cfg);
}
private void ClearUnusedEntries(ConfigFile cfg)
{
PropertyInfo property = ((object)cfg).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic);
Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)property.GetValue(cfg, null);
dictionary.Clear();
cfg.Save();
}
}
}
namespace ReavsStuff.HitchBloodsworth.NetcodePatcher
{
[AttributeUsage(AttributeTargets.Module)]
internal class NetcodePatchedAssemblyAttribute : Attribute
{
}
}