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 LethalLib.Modules;
using Microsoft.CodeAnalysis;
using ReavsStuff.ShibaEnemy.NetcodePatcher;
using ShibaEnemy.Configuration;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
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.ShibaEnemy")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.0.3.0")]
[assembly: AssemblyInformationalVersion("0.0.3")]
[assembly: AssemblyProduct("ShibaEnemy")]
[assembly: AssemblyTitle("ReavsStuff.ShibaEnemy")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.3.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 ShibaEnemy
{
[BepInPlugin("ReavsStuff.ShibaEnemy", "ShibaEnemy", "0.0.3")]
[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 = "ShibaBatInu";
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>("ShibaEnemy");
TerminalNode val2 = ModAssets.LoadAsset<TerminalNode>("ShibaEnemyTN");
TerminalKeyword val3 = ModAssets.LoadAsset<TerminalKeyword>("ShibaEnemyTK");
NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab);
Enemies.RegisterEnemy(val, BoundConfig.SpawnWeight.Value, (LevelTypes)(-1), val2, val3);
Logger.LogInfo((object)"Plugin ReavsStuff.ShibaEnemy 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 ShibaEnemyAI : EnemyAI
{
public enum State
{
RoamSearch,
Chasing
}
[CompilerGenerated]
private static class <>O
{
public static RpcReceiveHandler <0>____rpc_handler_567426418;
public static RpcReceiveHandler <1>____rpc_handler_1372410203;
public static RpcReceiveHandler <2>____rpc_handler_3274127472;
public static RpcReceiveHandler <3>____rpc_handler_2179031742;
}
private AISearchRoutine shibaSearchRoutine = null;
public float currentAttackTime = 0f;
public float currentPitchTime = 0f;
public bool canAttack = false;
public bool attackingDone = false;
public bool targetingPlayer = false;
public bool batAttack = false;
public bool attackTriggerBool = false;
private bool lostPlayerInChase;
private bool beginningChasingThisClient;
private bool attackingPlayer;
private bool enteredChaseMode;
public float noticePlayerTimer;
private Coroutine attackingPlayerCoroutine;
private Vector3 lastPositionOfSeenPlayer;
private Vector3 previousPosition;
private float checkLineofSightInterval;
public Transform turnCompass = null;
public Transform attackArea = null;
private int observedState;
private AudioSource audioSource;
public AudioClip AudioClipRoaming;
public AudioClip AudioClipChasing;
public AudioClip AudioClipAttacking;
public AudioClip AudioClipTornadoAttacking;
private float shibaVolume;
private float shibaRoamSpeed;
private float shibaChaseSpeed;
private float shibaDamage;
private int shibaHealth;
private bool shibaFriendly;
private float currentClipLength;
private float maxClipLength;
private readonly float volumeGet = PluginConfig.ShibaVolumeAdjustment.Value;
private readonly float roamSpeedGet = PluginConfig.ShibaRoamSpeed.Value;
private readonly float chaseSpeedGet = PluginConfig.ShibaChaseSpeed.Value;
private readonly float damageGet = PluginConfig.ShibaDamage.Value;
private readonly int healthGet = PluginConfig.ShibaHealth.Value;
private readonly int tornadoChanceGet = PluginConfig.ShibaTornadoChance.Value;
private float temporartyBlindnessTime;
private bool temporaryBlindessDone = false;
private float scanningWidth;
private float scanningWidthDefault = 150f;
private float scanningWidthBlindness = 0f;
private bool enemyHasBeenKilled = false;
public GameObject BatEquipped;
public GameObject BatHolstered;
private int specialAttackChanceValue;
private bool setSpecialAttackChance;
public int specialAttackChance = 5;
private bool takeOutBat = false;
private bool putAwayBat = false;
public VisualEffect visualEffect;
private static VFXExposedProperty tornadoVFXBeginTrigger;
private static VFXExposedProperty tornadoVFXEndTrigger;
private static readonly string tornadoVFXBeginTriggerName = "StartTornado";
private static readonly string tornadoFXEndTriggerName = "StopTornado";
public void SetConfigValues()
{
if (volumeGet > 1f)
{
shibaVolume = 1f;
}
else if (volumeGet < 0.1f)
{
shibaVolume = 0.1f;
}
else
{
shibaVolume = volumeGet;
}
if (roamSpeedGet > 8f)
{
shibaRoamSpeed = 8f;
}
else if (roamSpeedGet < 4f)
{
shibaRoamSpeed = 4f;
}
else
{
shibaRoamSpeed = roamSpeedGet;
}
if (chaseSpeedGet > 12f)
{
shibaChaseSpeed = 12f;
}
else if (chaseSpeedGet < 6f)
{
shibaChaseSpeed = 6f;
}
else
{
shibaChaseSpeed = chaseSpeedGet;
}
if (damageGet > 15f)
{
shibaDamage = 15f;
}
else if (damageGet < 5f)
{
shibaDamage = 5f;
}
else
{
shibaDamage = damageGet;
}
if (healthGet > 6)
{
shibaHealth = 6;
}
else if (healthGet < 2)
{
shibaHealth = 2;
}
else
{
shibaHealth = healthGet;
}
if (tornadoChanceGet > 15)
{
specialAttackChance = 15;
}
else if (tornadoChanceGet < 5)
{
specialAttackChance = 5;
}
else
{
specialAttackChance = tornadoChanceGet;
}
}
public override void Start()
{
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Expected O, but got Unknown
((EnemyAI)this).Start();
SetConfigValues();
audioSource = ((Component)this).GetComponent<AudioSource>();
base.enemyHP = shibaHealth;
base.agent.acceleration = 300f;
base.agent.angularSpeed = 180f;
base.openDoorSpeedMultiplier = 50f;
BatEquipped.SetActive(true);
BatHolstered.SetActive(false);
tornadoVFXBeginTrigger.name = tornadoVFXBeginTriggerName;
tornadoVFXEndTrigger.name = tornadoFXEndTriggerName;
shibaSearchRoutine = new AISearchRoutine();
DoAnimationClientRpc("RoamSeach");
currentAttackTime = 0f;
if (audioSource.isPlaying)
{
maxClipLength = audioSource.clip.length;
}
SwitchState(State.RoamSearch);
}
public void StartAnimVFX()
{
visualEffect.SendEvent(tornadoVFXBeginTrigger.name);
}
public void EndAnimVFX()
{
visualEffect.SendEvent(tornadoVFXBeginTrigger.name);
}
public override void DoAIInterval()
{
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
((EnemyAI)this).DoAIInterval();
if (StartOfRound.Instance.livingPlayers == 0 || base.isEnemyDead || enemyHasBeenKilled)
{
audioSource.loop = false;
audioSource.Stop();
return;
}
switch (base.currentBehaviourStateIndex)
{
case 0:
if (!shibaSearchRoutine.inProgress)
{
((EnemyAI)this).StartSearch(((Component)this).transform.position, shibaSearchRoutine);
}
break;
case 1:
if (lostPlayerInChase)
{
base.movingTowardsTargetPlayer = false;
if (!shibaSearchRoutine.inProgress)
{
shibaSearchRoutine.searchWidth = 30f;
((EnemyAI)this).StartSearch(lastPositionOfSeenPlayer, shibaSearchRoutine);
}
}
else if (shibaSearchRoutine.inProgress)
{
((EnemyAI)this).StopSearch(shibaSearchRoutine, true);
base.movingTowardsTargetPlayer = true;
}
break;
}
}
public override void Update()
{
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_06d2: Unknown result type (might be due to invalid IL or missing references)
//IL_06e2: Unknown result type (might be due to invalid IL or missing references)
//IL_0713: Unknown result type (might be due to invalid IL or missing references)
//IL_072a: Unknown result type (might be due to invalid IL or missing references)
//IL_073a: Unknown result type (might be due to invalid IL or missing references)
//IL_0749: Unknown result type (might be due to invalid IL or missing references)
//IL_074e: Unknown result type (might be due to invalid IL or missing references)
//IL_075e: Unknown result type (might be due to invalid IL or missing references)
//IL_0433: Unknown result type (might be due to invalid IL or missing references)
//IL_0443: Unknown result type (might be due to invalid IL or missing references)
//IL_04c6: Unknown result type (might be due to invalid IL or missing references)
//IL_04d6: Unknown result type (might be due to invalid IL or missing references)
//IL_063e: Unknown result type (might be due to invalid IL or missing references)
//IL_0643: 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();
currentAttackTime += Time.deltaTime;
currentClipLength += Time.deltaTime;
if (temporartyBlindnessTime <= 1.5f && !temporaryBlindessDone)
{
temporartyBlindnessTime += Time.deltaTime;
scanningWidth = scanningWidthBlindness;
}
else if (temporartyBlindnessTime >= 1.5f && !temporaryBlindessDone)
{
scanningWidth = scanningWidthDefault;
temporaryBlindessDone = true;
}
if (GameNetworkManager.Instance.localPlayerController.HasLineOfSightToPosition(((Component)this).transform.position + Vector3.up * 0.25f, 50f, 25, 5f))
{
if (base.currentBehaviourStateIndex == 1)
{
GameNetworkManager.Instance.localPlayerController.IncreaseFearLevelOverTime(0.8f, 1f);
}
else
{
GameNetworkManager.Instance.localPlayerController.IncreaseFearLevelOverTime(0.8f, 0.25f);
}
}
if (currentClipLength >= maxClipLength && audioSource.isPlaying)
{
if (base.currentBehaviourStateIndex == 0)
{
audioSource.pitch = Random.Range(0.85f, 1.15f);
}
else if (base.currentBehaviourStateIndex == 1)
{
audioSource.pitch = Random.Range(0.9f, 1.4f);
}
else
{
audioSource.pitch = Random.Range(0.9f, 1.1f);
}
maxClipLength = audioSource.clip.length;
currentClipLength = 0f;
}
switch (base.currentBehaviourStateIndex)
{
case 0:
{
if (enteredChaseMode)
{
enteredChaseMode = false;
shibaSearchRoutine.searchWidth = 25f;
beginningChasingThisClient = false;
noticePlayerTimer = 0f;
}
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;
}
break;
}
case 1:
{
if (!enteredChaseMode)
{
enteredChaseMode = true;
lostPlayerInChase = false;
checkLineofSightInterval = 0f;
beginningChasingThisClient = false;
}
if (checkLineofSightInterval <= 0.075f)
{
checkLineofSightInterval += Time.deltaTime;
break;
}
checkLineofSightInterval = 0f;
if (!temporaryBlindessDone)
{
break;
}
if (!attackingPlayer && (Object)(object)base.targetPlayer != (Object)null && !setSpecialAttackChance && base.currentBehaviourStateIndex == 1 && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < 6f)
{
specialAttackChanceValue = Random.Range(1, 50);
setSpecialAttackChance = true;
if (specialAttackChanceValue <= specialAttackChance)
{
DoAnimationClientRpc("AttackingTornado");
}
}
if (!attackingPlayer && (Object)(object)base.targetPlayer != (Object)null && attackingPlayerCoroutine == null && base.currentBehaviourStateIndex == 1 && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < 3f)
{
attackingPlayer = true;
batAttack = true;
attackingPlayerCoroutine = ((MonoBehaviour)this).StartCoroutine(AttackingPlayerAnimation((int)base.targetPlayer.playerClientId));
AttackPlayerServerRpc((int)base.targetPlayer.playerClientId);
}
if (base.inSpecialAnimation)
{
break;
}
if (lostPlayerInChase)
{
setSpecialAttackChance = false;
PlayerControllerB val = ((EnemyAI)this).CheckLineOfSightForPlayer(200f, 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(0);
}
}
break;
}
PlayerControllerB val2 = ((EnemyAI)this).CheckLineOfSightForPlayer(180f, 70, -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 == 1 && 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 IEnumerator AttackingPlayerAnimation(int playerID)
{
attackingDone = false;
attackTriggerBool = false;
_ = StartOfRound.Instance.allPlayerScripts[playerID];
if (base.isEnemyDead)
{
yield break;
}
if (specialAttackChanceValue <= specialAttackChance)
{
base.agent.speed = 12f;
audioSource.pitch = Random.Range(0.9f, 1.1f);
audioSource.Stop();
audioSource.loop = false;
DoAnimationClientRpc("AttackingTornado");
for (int i = 0; i < 8; i++)
{
yield return (object)new WaitUntil((Func<bool>)(() => attackTriggerBool));
TornadoAttackHitClientRpc();
}
attackingDone = true;
yield return (object)new WaitUntil((Func<bool>)(() => attackingDone));
base.movingTowardsTargetPlayer = false;
base.agent.isStopped = true;
base.agent.speed = 0f;
DoAnimationClientRpc("PostTornado");
yield return (object)new WaitForSeconds(5f);
}
else
{
base.agent.speed = 8f;
audioSource.pitch = Random.Range(0.9f, 1.1f);
audioSource.Stop();
audioSource.loop = false;
DoAnimationClientRpc("Attacking");
yield return (object)new WaitUntil((Func<bool>)(() => attackTriggerBool));
AttackHitClientRpc();
yield return (object)new WaitUntil((Func<bool>)(() => attackingDone));
base.movingTowardsTargetPlayer = false;
base.agent.isStopped = true;
base.agent.speed = 0f;
yield return (object)new WaitForSeconds(1f);
}
batAttack = false;
base.agent.isStopped = false;
attackingPlayer = false;
attackingPlayerCoroutine = null;
setSpecialAttackChance = false;
((EnemyAI)this).SwitchToBehaviourState(0);
}
public override void FinishedCurrentSearchRoutine()
{
((EnemyAI)this).FinishedCurrentSearchRoutine();
shibaSearchRoutine.searchWidth = Mathf.Clamp(shibaSearchRoutine.searchWidth + 10f, 1f, 100f);
}
private IEnumerator EquipBatCorrutine()
{
takeOutBat = false;
base.agent.speed = 0f;
DoAnimationClientRpc("TakeOutBat");
yield return (object)new WaitUntil((Func<bool>)(() => takeOutBat));
base.agent.speed = shibaChaseSpeed;
}
private IEnumerator UnEquipBatCorrutine()
{
putAwayBat = false;
base.agent.speed = 0f;
DoAnimationClientRpc("PutAwayBat");
yield return (object)new WaitUntil((Func<bool>)(() => putAwayBat));
base.agent.speed = shibaRoamSpeed;
}
public void EquipBatFunction()
{
}
public void UnEquipBatFunction()
{
}
public void BatVisiblityFunction(int Equip)
{
}
public void AttackTriggerFunction()
{
attackTriggerBool = true;
}
public void AttackDoneAnimation()
{
attackingDone = true;
}
[ClientRpc]
public void AttackHitClientRpc()
{
//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_0127: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
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(2741395352u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2741395352u, 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)shibaDamage, true, true, (CauseOfDeath)0, 0, false, default(Vector3));
audioSource.PlayOneShot(AudioClipAttacking, 1f);
currentAttackTime = 0f;
canAttack = false;
attackTriggerBool = false;
}
}
}
[ClientRpc]
public void TornadoAttackHitClientRpc()
{
//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(4075316990u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4075316990u, 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(5, true, true, (CauseOfDeath)0, 0, false, default(Vector3));
audioSource.PlayOneShot(AudioClipAttacking, 1f);
currentAttackTime = 0f;
canAttack = false;
NavMeshAgent agent = base.agent;
agent.speed -= 1f;
attackTriggerBool = 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(926349753u, 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, 926349753u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
base.creatureAnimator.SetTrigger(animationName);
}
}
public void ObserveState()
{
if (base.currentBehaviourStateIndex != observedState)
{
switch (base.currentBehaviourStateIndex)
{
case 0:
base.agent.speed = shibaRoamSpeed;
audioSource.clip = AudioClipRoaming;
audioSource.loop = true;
audioSource.volume = shibaVolume;
audioSource.Play();
DoAnimationClientRpc("RoamSearch");
break;
case 1:
base.agent.speed = shibaChaseSpeed;
audioSource.clip = AudioClipChasing;
audioSource.loop = true;
audioSource.volume = shibaVolume;
audioSource.Play();
DoAnimationClientRpc("Chasing");
break;
}
observedState = base.currentBehaviourStateIndex;
}
}
public IEnumerator KillingEnemyAnimatino()
{
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;
if (((NetworkBehaviour)this).IsOwner && base.enemyHP <= 0)
{
enemyHasBeenKilled = true;
((MonoBehaviour)this).StartCoroutine(KillingEnemyAnimatino());
}
}
public void Footsteps()
{
base.creatureSFX.pitch = Random.Range(0.85f, 1.15f);
base.creatureSFX.PlayOneShot(base.enemyType.audioClips[0]);
}
public void SwitchState(State state)
{
((EnemyAI)this).SwitchToBehaviourState((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(3101552860u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerId);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3101552860u, 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(3274127472u, val3, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val4, playerId);
((NetworkBehaviour)this).__endSendServerRpc(ref val4, 3274127472u, 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(1560467146u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerId);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1560467146u, 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(2179031742u, val3, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val4, playerId);
((NetworkBehaviour)this).__endSendClientRpc(ref val4, 2179031742u, 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(1783507638u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerObjectId);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1783507638u, 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(567426418u, val3, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val4, playerObjectId);
((NetworkBehaviour)this).__endSendServerRpc(ref val4, 567426418u, 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(2468438606u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerObjectId);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2468438606u, 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(1372410203u, val3, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val4, playerObjectId);
((NetworkBehaviour)this).__endSendClientRpc(ref val4, 1372410203u, val3, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager2.IsClient || networkManager2.IsHost))
{
((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(1);
((EnemyAI)this).SetMovingTowardsTargetPlayer(StartOfRound.Instance.allPlayerScripts[playerObjectId]);
}
}
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_ShibaEnemyAI()
{
//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_567426418;
if (obj == null)
{
RpcReceiveHandler val = __rpc_handler_567426418;
<>O.<0>____rpc_handler_567426418 = val;
obj = (object)val;
}
_rpc_func_table.Add(567426418u, (RpcReceiveHandler)obj);
Dictionary<uint, RpcReceiveHandler> _rpc_func_table2 = NetworkManager.__rpc_func_table;
object obj2 = <>O.<1>____rpc_handler_1372410203;
if (obj2 == null)
{
RpcReceiveHandler val2 = __rpc_handler_1372410203;
<>O.<1>____rpc_handler_1372410203 = val2;
obj2 = (object)val2;
}
_rpc_func_table2.Add(1372410203u, (RpcReceiveHandler)obj2);
Dictionary<uint, RpcReceiveHandler> _rpc_func_table3 = NetworkManager.__rpc_func_table;
object obj3 = <>O.<2>____rpc_handler_3274127472;
if (obj3 == null)
{
RpcReceiveHandler val3 = __rpc_handler_3274127472;
<>O.<2>____rpc_handler_3274127472 = val3;
obj3 = (object)val3;
}
_rpc_func_table3.Add(3274127472u, (RpcReceiveHandler)obj3);
Dictionary<uint, RpcReceiveHandler> _rpc_func_table4 = NetworkManager.__rpc_func_table;
object obj4 = <>O.<3>____rpc_handler_2179031742;
if (obj4 == null)
{
RpcReceiveHandler val4 = __rpc_handler_2179031742;
<>O.<3>____rpc_handler_2179031742 = val4;
obj4 = (object)val4;
}
_rpc_func_table4.Add(2179031742u, (RpcReceiveHandler)obj4);
}
private static void __rpc_handler_567426418(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)(ShibaEnemyAI)(object)target).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int playerObjectId = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerObjectId);
((NetworkBehaviour)(ShibaEnemyAI)(object)target).__rpc_exec_stage = (__RpcExecStage)1;
((ShibaEnemyAI)(object)target).BeginChasingPlayerServerRpc(playerObjectId);
((NetworkBehaviour)(ShibaEnemyAI)(object)target).__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1372410203(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)(ShibaEnemyAI)(object)target).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int playerObjectId = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerObjectId);
((NetworkBehaviour)(ShibaEnemyAI)(object)target).__rpc_exec_stage = (__RpcExecStage)2;
((ShibaEnemyAI)(object)target).BeginChasingPlayerClientRpc(playerObjectId);
((NetworkBehaviour)(ShibaEnemyAI)(object)target).__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3274127472(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)(ShibaEnemyAI)(object)target).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int playerId = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
((NetworkBehaviour)(ShibaEnemyAI)(object)target).__rpc_exec_stage = (__RpcExecStage)1;
((ShibaEnemyAI)(object)target).AttackPlayerServerRpc(playerId);
((NetworkBehaviour)(ShibaEnemyAI)(object)target).__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2179031742(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)(ShibaEnemyAI)(object)target).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int playerId = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
((NetworkBehaviour)(ShibaEnemyAI)(object)target).__rpc_exec_stage = (__RpcExecStage)2;
((ShibaEnemyAI)(object)target).AttackPlayerClientRpc(playerId);
((NetworkBehaviour)(ShibaEnemyAI)(object)target).__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected override void __initializeVariables()
{
((EnemyAI)this).__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_ShibaEnemyAI()
{
//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
NetworkManager.__rpc_func_table.Add(2741395352u, new RpcReceiveHandler(__rpc_handler_2741395352));
NetworkManager.__rpc_func_table.Add(4075316990u, new RpcReceiveHandler(__rpc_handler_4075316990));
NetworkManager.__rpc_func_table.Add(926349753u, new RpcReceiveHandler(__rpc_handler_926349753));
NetworkManager.__rpc_func_table.Add(3101552860u, new RpcReceiveHandler(__rpc_handler_3101552860));
NetworkManager.__rpc_func_table.Add(1560467146u, new RpcReceiveHandler(__rpc_handler_1560467146));
NetworkManager.__rpc_func_table.Add(1783507638u, new RpcReceiveHandler(__rpc_handler_1783507638));
NetworkManager.__rpc_func_table.Add(2468438606u, new RpcReceiveHandler(__rpc_handler_2468438606));
}
private static void __rpc_handler_2741395352(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;
((ShibaEnemyAI)(object)target).AttackHitClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_4075316990(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;
((ShibaEnemyAI)(object)target).TornadoAttackHitClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_926349753(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;
((ShibaEnemyAI)(object)target).DoAnimationClientRpc(animationName);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3101552860(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;
((ShibaEnemyAI)(object)target).AttackPlayerServerRpc(playerId);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1560467146(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;
((ShibaEnemyAI)(object)target).AttackPlayerClientRpc(playerId);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1783507638(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;
((ShibaEnemyAI)(object)target).BeginChasingPlayerServerRpc(playerObjectId);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2468438606(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;
((ShibaEnemyAI)(object)target).BeginChasingPlayerClientRpc(playerObjectId);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "ShibaEnemyAI";
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "ReavsStuff.ShibaEnemy";
public const string PLUGIN_NAME = "ShibaEnemy";
public const string PLUGIN_VERSION = "0.0.3";
}
}
namespace ShibaEnemy.Configuration
{
public class PluginConfig
{
public ConfigEntry<int> SpawnWeight;
public static ConfigEntry<float> ShibaVolumeAdjustment;
public static ConfigEntry<float> ShibaRoamSpeed;
public float roamValue = 4f;
public static ConfigEntry<float> ShibaChaseSpeed;
public float chaseValue = 8f;
public static ConfigEntry<int> ShibaDamage;
public int damageValue = 10;
public static ConfigEntry<int> ShibaHealth;
public int healthValue = 4;
public static ConfigEntry<int> ShibaTornadoChance;
public int tornadoChanceValue = 5;
public PluginConfig(ConfigFile cfg)
{
SpawnWeight = cfg.Bind<int>("General", "Spawn weight", 20, "The spawn chance weight for Shiba, relative to other existing enemies.\nGoes up from 0, lower is more rare, 100 and up is very common.");
ShibaVolumeAdjustment = cfg.Bind<float>("General", "Volume", 1f, "Adjust volume.\n1.0 = 100%, 0.0 = 0%");
ShibaDamage = cfg.Bind<int>("General", "Damage", damageValue, "How much damage the doggy does.\nMin: 5 Max: 15");
ShibaHealth = cfg.Bind<int>("General", "Health", healthValue, "How much health the doggy has.\nMin: 2 Max: 6");
ShibaTornadoChance = cfg.Bind<int>("General", "Specialattack Chance", tornadoChanceValue, "The chance for a special attack.\nMin: 2 Max: 15");
ShibaChaseSpeed = cfg.Bind<float>("Speed Variables", "Chasespeed", chaseValue, "How fast the chase speed is.\nMin: 8 Max: 16");
ShibaRoamSpeed = cfg.Bind<float>("Speed Variables", "Roamspeed", roamValue, "How fast the roam speed is.\nMin: 4 Max: 8");
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.ShibaEnemy.NetcodePatcher
{
[AttributeUsage(AttributeTargets.Module)]
internal class NetcodePatchedAssemblyAttribute : Attribute
{
}
}